prescript
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.PrescriptCategoryEntity;
|
||||
import com.peanut.modules.book.entity.PrescriptEntity;
|
||||
import com.peanut.modules.book.service.PrescriptCategoryService;
|
||||
import com.peanut.modules.book.service.PrescriptService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -22,6 +24,34 @@ public class PrescriptController {
|
||||
@Autowired
|
||||
private PrescriptCategoryService prescriptCategoryService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取方剂文章列表
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getPrescriptList")
|
||||
public R getPrescriptList(@RequestBody Map<String,Object> map){
|
||||
Integer limit = Integer.valueOf(map.get("limit").toString());
|
||||
Integer page = Integer.valueOf(map.get("page").toString());
|
||||
Integer prescriptCategoryId = Integer.valueOf(map.get("prescriptCategoryId").toString());
|
||||
Page<PrescriptEntity> prescriptList = prescriptService.getPrescriptList(prescriptCategoryId, limit, page);
|
||||
return R.ok().put("page",prescriptList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取方剂文章详情
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getPrescriptDetail")
|
||||
public R getPrescriptDetail(@RequestBody Map<String,Object> map){
|
||||
Integer integer = Integer.valueOf(map.get("prescriptId").toString());
|
||||
PrescriptEntity prescript = prescriptService.getById(integer);
|
||||
return R.ok().put("prescript",prescript);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取方剂分类列表
|
||||
* @return
|
||||
@@ -67,7 +97,7 @@ public class PrescriptController {
|
||||
if(b){
|
||||
return R.ok();
|
||||
}else{
|
||||
return R.error();
|
||||
return R.error(303,"删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user