|
@ -1,7 +1,9 @@
|
|
package com.yihu.jw.hospital.endpoint.article;
|
|
package com.yihu.jw.hospital.endpoint.article;
|
|
|
|
|
|
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDO;
|
|
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDO;
|
|
|
|
import com.yihu.jw.entity.hospital.article.KnowledgeCategoryDO;
|
|
import com.yihu.jw.hospital.service.consult.KnowledgeArticleService;
|
|
import com.yihu.jw.hospital.service.consult.KnowledgeArticleService;
|
|
|
|
import com.yihu.jw.hospital.service.consult.KnowledgeCategoryService;
|
|
import com.yihu.jw.restmodel.web.Envelop;
|
|
import com.yihu.jw.restmodel.web.Envelop;
|
|
import com.yihu.jw.restmodel.web.ListEnvelop;
|
|
import com.yihu.jw.restmodel.web.ListEnvelop;
|
|
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
|
|
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
|
|
@ -26,6 +28,9 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
|
|
@Autowired
|
|
@Autowired
|
|
private KnowledgeArticleService knowledgeArticleService;
|
|
private KnowledgeArticleService knowledgeArticleService;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private KnowledgeCategoryService knowledgeCategoryService;
|
|
|
|
|
|
@GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.searchKnowledgePageList)
|
|
@GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.searchKnowledgePageList)
|
|
@ApiOperation(value = "获取文章列表")
|
|
@ApiOperation(value = "获取文章列表")
|
|
public ListEnvelop searchKnowledgePageList(
|
|
public ListEnvelop searchKnowledgePageList(
|
|
@ -81,4 +86,57 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
|
|
knowledgeArticleService.saveArticle(jsonData);
|
|
knowledgeArticleService.saveArticle(jsonData);
|
|
return success("操作成功");
|
|
return success("操作成功");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PostMapping (value = BaseHospitalRequestMapping.KnowledgeArticle.reviewArticle)
|
|
|
|
@ApiOperation(value = "审核/退回文章")
|
|
|
|
public Envelop saveArticle(
|
|
|
|
@ApiParam(name = "articleId", value = "文章ID")
|
|
|
|
@RequestParam(value = "articleId", required = true) String articleId,
|
|
|
|
@ApiParam(name = "status", value = "0未审核,1已审核,2退回")
|
|
|
|
@RequestParam(value = "status", required = true) Integer status
|
|
|
|
)throws Exception {
|
|
|
|
knowledgeArticleService.reviewArticle(articleId,status);
|
|
|
|
return success("操作成功");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.searchCategoryList)
|
|
|
|
@ApiOperation(value = "获取分类列表")
|
|
|
|
public ListEnvelop searchCategoryList(
|
|
|
|
@ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
|
|
|
|
@RequestParam(value = "fields", required = false) String fields,
|
|
|
|
@ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
|
|
|
|
@RequestParam(value = "filters", required = false) String filters,
|
|
|
|
@ApiParam(name = "sorts", value = "排序,规则参见说明文档")
|
|
|
|
@RequestParam(value = "sorts", required = false) String sorts,
|
|
|
|
@ApiParam(name = "page", value = "第几页,从1开始", required = true, defaultValue = "1")
|
|
|
|
@RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
|
|
|
|
@ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
|
|
|
|
@RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize)throws Exception{
|
|
|
|
List<KnowledgeCategoryDO> result = knowledgeCategoryService.search(fields,filters,sorts,page,pageSize);
|
|
|
|
return success(result);
|
|
|
|
}
|
|
|
|
|
|
|
|
@PostMapping (value = BaseHospitalRequestMapping.KnowledgeArticle.saveCategory)
|
|
|
|
@ApiOperation(value = "保存/更新分类")
|
|
|
|
public Envelop saveCategory(
|
|
|
|
@ApiParam(name = "jsonData", value = "Json数据", required = true)
|
|
|
|
@RequestParam String jsonData)throws Exception {
|
|
|
|
knowledgeCategoryService.saveCategory(jsonData);
|
|
|
|
return success("操作成功");
|
|
|
|
}
|
|
|
|
|
|
|
|
@PostMapping (value = BaseHospitalRequestMapping.KnowledgeArticle.updateDel)
|
|
|
|
@ApiOperation(value = "根据分类code删除分类")
|
|
|
|
public Envelop updateDel(
|
|
|
|
@ApiParam(name = "id", value = "id", required = true)
|
|
|
|
@RequestParam(value = "id", required = true)String id)throws Exception {
|
|
|
|
Boolean flag = knowledgeCategoryService.updateDel(id);
|
|
|
|
if (!flag) {
|
|
|
|
return success("操作成功");
|
|
|
|
}else{
|
|
|
|
return failed("操作失败");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
}
|