|
@ -324,6 +324,47 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 医生把文章推送给居民
|
|
|
* [
|
|
|
* {"user": "用户code"},
|
|
|
* {"userName": "用户名称"},
|
|
|
* {"relationCode": "文章code或者问卷code"},
|
|
|
* {"relationType": "1、文章 2、问卷 3、指导 4、im咨询"},
|
|
|
* {"relationName": "文章名称"},
|
|
|
* {"fabulous": "1已赞0未赞"},
|
|
|
* {"isRead": "1已读0未读"},
|
|
|
* {"share": "1已分享0未分享"},
|
|
|
* {"collection": "是否收藏1是0否"},
|
|
|
* {"used": "1常用0不常用"},
|
|
|
* {"del": "是否删除,1正常,0删除"}
|
|
|
* ]
|
|
|
*/
|
|
|
@PostMapping(value = "/sendArticleToUser")
|
|
|
@ApiOperation(value = "发送文章/问卷")
|
|
|
public ListEnvelop sendArticleToUser(
|
|
|
@ApiParam(name = "json", value = "发送文章/问卷") @RequestParam(value = "json", required = false) String json
|
|
|
) throws Exception {
|
|
|
try {
|
|
|
System.out.println("sendArticleToUser==>"+json);
|
|
|
JSONArray jsonArray = JSONArray.parseArray(json);
|
|
|
List<KnowledgeArticleUserDO> knowledgeArticleUserDOList = new ArrayList<>();
|
|
|
for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
JSONObject jsonObject = jsonArray.getJSONObject(i);
|
|
|
KnowledgeArticleUserDO entity = toEntity(jsonObject.toJSONString(), KnowledgeArticleUserDO.class);
|
|
|
knowledgeArticleUserDOList.add(entity);
|
|
|
}
|
|
|
List<KnowledgeArticleUserDO> list= knowledgeArticleUserService.sendArticleToUser(knowledgeArticleUserDOList);
|
|
|
ListEnvelop listEnvelop = new ListEnvelop();
|
|
|
listEnvelop.setDetailModelList(list);
|
|
|
return listEnvelop;
|
|
|
} catch (Exception e) {
|
|
|
return failedListEnvelopException(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.setArticleUsed)
|
|
|
@ApiOperation(value = "设置文章为常用/不常用")
|
|
|
public ObjEnvelop setArticleUsed(
|
|
@ -339,6 +380,8 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.searchPatientArticle)
|
|
|
@ApiOperation(value = "获取患者文章列表")
|
|
|
public Envelop searchPatientArticle(
|