|
@ -32,10 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
@ -45,6 +42,7 @@ import java.util.*;
|
|
|
* @author George
|
|
|
*/
|
|
|
@Controller
|
|
|
@RestController
|
|
|
@RequestMapping(value = "/doctor/health/edu", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
@Api(description = "健康教育")
|
|
|
public class DoctorHealthEduArticleController extends WeixinBaseController {
|
|
@ -607,7 +605,6 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
|
|
|
|
|
|
@RequestMapping(value = "getDoctorArticalList",method = RequestMethod.GET)
|
|
|
@ApiOperation("获取健康教育文章列表")
|
|
|
@ResponseBody
|
|
|
public String getDoctorArticalList(@ApiParam(name = "articleTitle", value = "文章标题")
|
|
|
@RequestParam(value = "articleTitle", required = false) String articleTitle,
|
|
|
@ApiParam(name = "articleState", value = "文章状态(1、正常、2删除 3、草稿)")
|
|
@ -619,12 +616,118 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
|
|
|
@ApiParam(name = "pageSize", value = "每页显示数 ,默认5")
|
|
|
@RequestParam(value = "pageSize", required = false) Integer pageSize){
|
|
|
try {
|
|
|
// String response = healthEducationArticleService.getDoctorArticalList(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,getUID());
|
|
|
String response = healthEducationArticleService.getDoctorArticalList(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,"0de7295862dd11e69faffa163e8aee56");
|
|
|
String response = healthEducationArticleService.getDoctorArticalList(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,getUID());
|
|
|
// String response = healthEducationArticleService.getDoctorArticalList(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,"0de7295862dd11e69faffa163e8aee56");
|
|
|
return write(200,"查询成功!","data",response);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
return write(-1,"查询失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "getCategoryList",method = RequestMethod.GET)
|
|
|
@ApiOperation("获取文章类别")
|
|
|
public String getCategoryList(@ApiParam(name = "categoryLevel", value = "获取类别:1、一级类别 2、二级类别",defaultValue = "1")
|
|
|
@RequestParam(value = "categoryLevel", required = true) String categoryLevel){
|
|
|
try {
|
|
|
String response = healthEducationArticleService.getCategoryList(categoryLevel);
|
|
|
return write(200,"查询成功!","data",response);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
return write(-1,"查询失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "getCollectionArticalList",method = RequestMethod.GET)
|
|
|
@ApiOperation("获取收藏文章列表")
|
|
|
public String getCollectionArticalList(@ApiParam(name = "articleTitle", value = "文章标题")
|
|
|
@RequestParam(value = "articleTitle", required = false) String articleTitle,
|
|
|
@ApiParam(name = "articleState", value = "文章状态(1、正常、2删除 3、草稿)")
|
|
|
@RequestParam(value = "articleState", required = true,defaultValue = "1") Integer articleState,
|
|
|
@ApiParam(name = "firstLevelCategoryId", value = "一级类别ID ,多个逗号隔开")
|
|
|
@RequestParam(value = "firstLevelCategoryId", required = false) String firstLevelCategoryId,
|
|
|
@ApiParam(name = "pageIndex", value = "起始页数 0开始,默认0")
|
|
|
@RequestParam(value = "pageIndex", required = false) Integer pageIndex,
|
|
|
@ApiParam(name = "pageSize", value = "每页显示数 ,默认5")
|
|
|
@RequestParam(value = "pageSize", required = false) Integer pageSize){
|
|
|
try {
|
|
|
String response = healthEducationArticleService.getCollectionArticalList(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,getUID(),1);
|
|
|
// String response = healthEducationArticleService.getCollectionArticalList(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,"0de7295862dd11e69faffa163e8aee56",1);
|
|
|
return write(200,"查询成功!","data",response);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
return write(-1,"查询失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "getArticalById",method = RequestMethod.GET)
|
|
|
@ApiOperation("获取文章详情")
|
|
|
public String getArticalById(@ApiParam(name = "articleId", value = "文章id",defaultValue = "1")
|
|
|
@RequestParam(value = "articleId", required = true) String articleId){
|
|
|
try {
|
|
|
String response = healthEducationArticleService.getArticalById(articleId);
|
|
|
return write(200,"查询成功!","data",response);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
return write(-1,"查询失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "cancelArticleCollection",method = RequestMethod.POST)
|
|
|
@ApiOperation("取消收藏文章")
|
|
|
@ObserverRequired
|
|
|
public String cancelArticleCollection(@ApiParam(name = "articleId", value = "文章id",defaultValue = "1")
|
|
|
@RequestParam(value = "articleId", required = true) String articleId){
|
|
|
try {
|
|
|
// String response = healthEducationArticleService.cancelArticleCollection(articleId,getUID(),1);
|
|
|
String response = healthEducationArticleService.cancelArticleCollection(articleId,"0de7295862dd11e69faffa163e8aee56",1);
|
|
|
return write(200,"查询成功!","data",response);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
return write(-1,"查询失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "saveArticleCollection",method = RequestMethod.POST)
|
|
|
@ApiOperation("收藏文章")
|
|
|
@ObserverRequired
|
|
|
public String saveArticleCollection(@ApiParam(name = "articleId", value = "文章id")
|
|
|
@RequestParam(value = "articleId", required = true) String articleId,
|
|
|
@ApiParam(name = "articleCategoryId", value = "文章类别ID")
|
|
|
@RequestParam(value = "articleCategoryId", required = true,defaultValue = "1") String articleCategoryId,
|
|
|
@ApiParam(name = "articleCategoryName", value = "文章类别名称")
|
|
|
@RequestParam(value = "articleCategoryName", required = true) String articleCategoryName){
|
|
|
try {
|
|
|
// String response = healthEducationArticleService.saveArticleCollection(articleId,articleCategoryId,articleCategoryName,getUID(),1);
|
|
|
String response = healthEducationArticleService.saveArticleCollection(articleId,articleCategoryId,articleCategoryName,"0de7295862dd11e69faffa163e8aee56",1);
|
|
|
|
|
|
return write(200,"查询成功!","data",response);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
return write(-1,"查询失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "getDoctorArticalByUserId",method = RequestMethod.GET)
|
|
|
@ApiOperation("获取医生发表的文章列表")
|
|
|
public String getDoctorArticalByUserId(@ApiParam(name = "articleTitle", value = "文章标题")
|
|
|
@RequestParam(value = "articleTitle", required = false) String articleTitle,
|
|
|
@ApiParam(name = "articleState", value = "文章状态(1、正常、2删除 3、草稿)")
|
|
|
@RequestParam(value = "articleState", required = true,defaultValue = "1") Integer articleState,
|
|
|
@ApiParam(name = "firstLevelCategoryId", value = "一级类别ID ,多个逗号隔开")
|
|
|
@RequestParam(value = "firstLevelCategoryId", required = false) String firstLevelCategoryId,
|
|
|
@ApiParam(name = "pageIndex", value = "起始页数 0开始,默认0")
|
|
|
@RequestParam(value = "pageIndex", required = false) Integer pageIndex,
|
|
|
@ApiParam(name = "pageSize", value = "每页显示数 ,默认5")
|
|
|
@RequestParam(value = "pageSize", required = false) Integer pageSize){
|
|
|
try {
|
|
|
// String response = healthEducationArticleService.getDoctorArticalByUserId(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,getUID());
|
|
|
String response = healthEducationArticleService.getDoctorArticalByUserId(articleTitle,articleState,firstLevelCategoryId,pageIndex,pageSize,"0de7295862dd11e69faffa163e8aee56");
|
|
|
return write(200,"查询成功!","data",response);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
return write(-1,"查询失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|