|
@ -47,6 +47,31 @@ public class DoctorQuickReplyController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/modify", method = RequestMethod.POST)
|
|
|
@ApiOperation(value = "修改快捷回复")
|
|
|
public String modifyReply(@RequestParam @ApiParam(value = "快捷回复ID") Long id,
|
|
|
@RequestParam @ApiParam(value = "快捷回复内容") String content) {
|
|
|
try {
|
|
|
if (id == null || id < 1) {
|
|
|
return error(-1, "快捷回复ID不能为空");
|
|
|
}
|
|
|
if (StringUtils.isEmpty(content)) {
|
|
|
return error(-1, "快捷回复内容不能为空");
|
|
|
}
|
|
|
|
|
|
DoctorQuickReply reply = quickReplyService.modifyReply(id, content);
|
|
|
|
|
|
if (reply != null) {
|
|
|
return write(200, "添加成功", "data", reply);
|
|
|
} else {
|
|
|
return error(-1, "添加失败");
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return error(-1, "添加失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
|
|
@ApiOperation(value = "删除快捷回复")
|
|
|
public String delReply(@RequestParam @ApiParam(value = "快捷回复ID") Long id) {
|
|
@ -99,6 +124,31 @@ public class DoctorQuickReplyController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/sortList", method = RequestMethod.POST)
|
|
|
@ApiOperation(value = "快捷回复排序")
|
|
|
public String sortReplyList(@RequestParam @ApiParam(value = "快捷回复ID")String id) {
|
|
|
try {
|
|
|
if (StringUtils.isEmpty(id)) {
|
|
|
return error(-1, "请输入排序后的回复ID");
|
|
|
}
|
|
|
|
|
|
int result = quickReplyService.sortReplyList(id);
|
|
|
|
|
|
if (result == 1) {
|
|
|
return write(200, "排序成功");
|
|
|
} else if (result == -1) {
|
|
|
return error(-1, "快捷回复不存在或已删除");
|
|
|
} else if (result == -2) {
|
|
|
return error(-1, "快捷回复已在排序位置");
|
|
|
} else {
|
|
|
return error(-1, "排序失败");
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return error(-1, "排序失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
|
@ApiOperation(value = "快捷回复列表")
|
|
|
public String replyList() {
|