Selaa lähdekoodia

居民端健教文章接口修改

huangwenjie 7 vuotta sitten
vanhempi
commit
f39028b97e

+ 47 - 47
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/HealthEduArticleController.java

@ -268,52 +268,52 @@ public class HealthEduArticleController extends BaseController {
        }
    }
    
    @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 = false,defaultValue = "1") String articleCategoryId,
                                        @ApiParam(name = "articleCategoryName", value = "文章类别名称")
                                        @RequestParam(value = "articleCategoryName", required = false) String articleCategoryName){
        try {
            thirdJkEduArticleService.saveArticleCollection(articleId,articleCategoryId,articleCategoryName,getRepUID(),2);
//            thirdJkEduArticleService.saveArticleCollection(articleId,articleCategoryId,articleCategoryName,"0de7295862dd11e69faffa163e8aee56",1);
            
            return success("收藏成功!");
        }catch (Exception e){
            e.printStackTrace();
            return error(-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 {
            thirdJkEduArticleService.cancelArticleCollection(articleId,getRepUID(),2);
//            thirdJkEduArticleService.cancelArticleCollection(articleId,"0de7295862dd11e69faffa163e8aee56",1);
            return success("取消成功!");
        }catch (Exception e){
            e.printStackTrace();
            return error(-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 {
            com.alibaba.fastjson.JSONObject response = thirdJkEduArticleService.getArticalById(articleId,getRepUID());
            return write(200,"查询成功!","data",response);
        }catch (Exception e){
            e.printStackTrace();
            return error(-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 = false,defaultValue = "1") String articleCategoryId,
//                                        @ApiParam(name = "articleCategoryName", value = "文章类别名称")
//                                        @RequestParam(value = "articleCategoryName", required = false) String articleCategoryName){
//        try {
//            thirdJkEduArticleService.saveArticleCollection(articleId,articleCategoryId,articleCategoryName,getRepUID(),2);
////            thirdJkEduArticleService.saveArticleCollection(articleId,articleCategoryId,articleCategoryName,"0de7295862dd11e69faffa163e8aee56",1);
//
//            return success("收藏成功!");
//        }catch (Exception e){
//            e.printStackTrace();
//            return error(-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 {
//            thirdJkEduArticleService.cancelArticleCollection(articleId,getRepUID(),2);
////            thirdJkEduArticleService.cancelArticleCollection(articleId,"0de7295862dd11e69faffa163e8aee56",1);
//            return success("取消成功!");
//        }catch (Exception e){
//            e.printStackTrace();
//            return error(-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 {
//            com.alibaba.fastjson.JSONObject response = thirdJkEduArticleService.getArticalById(articleId,getRepUID());
//            return write(200,"查询成功!","data",response);
//        }catch (Exception e){
//            e.printStackTrace();
//            return error(-1,"查询失败!");
//        }
//    }
}