prescript
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.PrescriptCategoryEntity;
|
||||
@@ -51,6 +52,46 @@ public class PrescriptController {
|
||||
return R.ok().put("prescript",prescript);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加方剂文章
|
||||
* @param p
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/addPrescript")
|
||||
public R addPrescript(@RequestBody PrescriptEntity p){
|
||||
if(p.getImages()!=null&&p.getImageList().size()>0){
|
||||
p.setImages(JSON.toJSONString(p.getImageList()));
|
||||
}
|
||||
prescriptService.save(p);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改方剂文章
|
||||
* @param p
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/editPrescript")
|
||||
public R editPrescript(@RequestBody PrescriptEntity p){
|
||||
if(p.getImages()!=null&&p.getImageList().size()>0){
|
||||
p.setImages(JSON.toJSONString(p.getImageList()));
|
||||
}
|
||||
prescriptService.updateById(p);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除方剂文章
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/delPrescript")
|
||||
public R delPrescript(@RequestBody Map<String,Object> map){
|
||||
Integer integer = Integer.valueOf(map.get("prescriptId").toString());
|
||||
prescriptService.removeById(integer);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取方剂分类列表
|
||||
@@ -97,7 +138,7 @@ public class PrescriptController {
|
||||
if(b){
|
||||
return R.ok();
|
||||
}else{
|
||||
return R.error(303,"删除失败");
|
||||
return R.code(303,"删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user