食谱模板功能完成
This commit is contained in:
@ -1,68 +0,0 @@
|
||||
package com.stdiet.web.controller.custom;
|
||||
|
||||
import com.stdiet.common.core.controller.BaseController;
|
||||
import com.stdiet.common.core.domain.AjaxResult;
|
||||
import com.stdiet.common.core.page.TableDataInfo;
|
||||
import com.stdiet.custom.domain.SysRecipesPlanModel;
|
||||
import com.stdiet.custom.service.ISysRecipesPlanModelService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 食谱模板
|
||||
*
|
||||
* @author wonder
|
||||
* @date 2021-02-27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/recipes/model")
|
||||
public class SysRecipesPlanModelController extends BaseController {
|
||||
@Autowired
|
||||
private ISysRecipesPlanModelService iSysRecipesPlanModelService;
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('recipes:recipesModel:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysRecipesPlanModel sysRecipesPlanModel) {
|
||||
startPage();
|
||||
List<SysRecipesPlanModel> list = iSysRecipesPlanModelService.selectRecipesModelListByCondition(sysRecipesPlanModel);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('recipes:recipesModel:edit')")
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(SysRecipesPlanModel sysRecipesPlanModel) {
|
||||
return toAjax(iSysRecipesPlanModelService.insertRecipsesModel(sysRecipesPlanModel));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param sysRecipesPlanModel
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('recipes:recipesPlan:list')")
|
||||
@PutMapping(value = "/update")
|
||||
public AjaxResult update(SysRecipesPlanModel sysRecipesPlanModel) {
|
||||
return toAjax(iSysRecipesPlanModelService.updateRecipesModel(sysRecipesPlanModel));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('recipes:recipesPlan:query')")
|
||||
@DeleteMapping(value = "/delete/{id}")
|
||||
public AjaxResult delete(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(iSysRecipesPlanModelService.removeRecipesModel(id));
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package com.stdiet.web.controller.custom;
|
||||
|
||||
import com.stdiet.common.core.controller.BaseController;
|
||||
import com.stdiet.common.core.domain.AjaxResult;
|
||||
import com.stdiet.common.core.page.TableDataInfo;
|
||||
import com.stdiet.custom.domain.SysRecipesTemplate;
|
||||
import com.stdiet.custom.service.ISysRecipesTemplateService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 食谱模板
|
||||
*
|
||||
* @author wonder
|
||||
* @date 2021-02-27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/recipes/template")
|
||||
public class SysRecipesTemplateController extends BaseController {
|
||||
@Autowired
|
||||
private ISysRecipesTemplateService iSysRecipesTemplateService;
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('recipes:recipesTemplate:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysRecipesTemplate sysRecipesTemplate) {
|
||||
startPage();
|
||||
List<SysRecipesTemplate> list = iSysRecipesTemplateService.selectRecipesTemplateListByCondition(sysRecipesTemplate);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('recipes:recipesTemplate:list')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult detail(@PathVariable Long id) {
|
||||
return AjaxResult.success(iSysRecipesTemplateService.getRecipesTemplateById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('recipes:recipesTemplate:edit')")
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody SysRecipesTemplate sysRecipesTemplate) {
|
||||
return toAjax(iSysRecipesTemplateService.insertRecipsesTemplate(sysRecipesTemplate));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('recipes:recipesTemplate:list')")
|
||||
@PutMapping(value = "/update")
|
||||
public AjaxResult update(@RequestBody SysRecipesTemplate sysRecipesTemplate) {
|
||||
return toAjax(iSysRecipesTemplateService.updateRecipesTemplate(sysRecipesTemplate));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('recipes:recipesTemplate:query')")
|
||||
@DeleteMapping(value = "/delete/{id}")
|
||||
public AjaxResult delete(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(iSysRecipesTemplateService.removeRecipesTemplate(id));
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user