浏览代码

统一APP接口

huangwenjie 7 年之前
父节点
当前提交
c03eab407c

+ 96 - 96
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEdu/DoctorJMJkEduArticleController.java

@ -342,69 +342,69 @@ public class DoctorJMJkEduArticleController extends BaseController {
        }
        }
    }
    }
    @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,getUID());
            return write(200,"查询成功!","data",response);
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"查询失败!");
        }
    }
    /**
     * 医生端端文章列表
     * @param firstLevelCategoryId
     * @param secondLevelCategoryId
     * @param insertTimeStart
     * @param articlelevel
     * @param articleTitle
     * @return
     */
    @RequestMapping(value = "queryArticlePcList", method = RequestMethod.GET)
    @ApiOperation("医生端文章列表")
    public  String queryArticlePcList(@ApiParam(name = "firstLevelCategoryId", value = "文章一级分类")
                                      @RequestParam(value = "firstLevelCategoryId", required = false) String firstLevelCategoryId,
                                      @ApiParam(name = "secondLevelCategoryId", value = "文章二级分类")
                                      @RequestParam(value = "secondLevelCategoryId", required = false) String secondLevelCategoryId,
                                      @ApiParam(name = "insertTimeStart", value = "新增文章开始时间")
                                      @RequestParam(value = "insertTimeStart", required = false) String insertTimeStart,
                                      @ApiParam(name = "insertTimeEnd", value = "新增文章结束时间")
                                      @RequestParam(value = "insertTimeEnd", required = false) String insertTimeEnd,
                                      @ApiParam(name = "articlelevel", value = "文章级别")
                                      @RequestParam(value = "articlelevel", required = false) String articlelevel,
                                      @ApiParam(name = "articleTitle", value = "文章标题关键字")
                                      @RequestParam(value = "articleTitle", required = false) String articleTitle,
                                      @ApiParam(name = "currentUserRole", value = "当前登录的角色")
                                      @RequestParam(value = "currentUserRole", required = true) String currentUserRole,
                                      @ApiParam(name = "currentUserRoleLevel", value = "当前登录的角色级别")
                                      @RequestParam(value = "currentUserRoleLevel", required = false )String currentUserRoleLevel,
                                      @ApiParam(name = "isAuthentication", value = "是否认证")
                                      @RequestParam(value = "isAuthentication", required = false) String isAuthentication,
                                      @ApiParam(name = "isMyArticle", value = "是否过滤我的文章")
                                      @RequestParam(value = "isMyArticle", required = false) Boolean isMyArticle,
                                      @ApiParam(name = "page", value = "当前页")
                                      @RequestParam(value = "page", required = true) Integer page,
                                      @ApiParam(name = "pageSize", value = "分页数")
                                      @RequestParam(value = "pageSize", required = true) Integer pageSize,
                                      @ApiParam(name = "roleType", value = "1、普通医生,2、管理员")
                                      @RequestParam(value = "roleType", required = false) Integer roleType){
        try {
            com.alibaba.fastjson.JSONObject response = jmJkEduArticleService.queryArticlePcList(firstLevelCategoryId, secondLevelCategoryId, insertTimeStart, insertTimeEnd, articlelevel, articleTitle,
                    getUID(), currentUserRole, currentUserRoleLevel, isAuthentication, isMyArticle, page, pageSize,null,roleType);
//    @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,getUID());
//            return write(200,"查询成功!","data",response);
//        }catch (Exception e){
//            e.printStackTrace();
//            return error(-1,"查询失败!");
//        }
//    }
            return write(200,"查询成功!","data",response);
        } catch (Exception e){
            e.printStackTrace();
            return error(-1,"查询失败!");
        }
    }
//    /**
//     * 医生端端文章列表
//     * @param firstLevelCategoryId
//     * @param secondLevelCategoryId
//     * @param insertTimeStart
//     * @param articlelevel
//     * @param articleTitle
//     * @return
//     */
//    @RequestMapping(value = "queryArticlePcList", method = RequestMethod.GET)
//    @ApiOperation("医生端文章列表")
//    public  String queryArticlePcList(@ApiParam(name = "firstLevelCategoryId", value = "文章一级分类")
//                                      @RequestParam(value = "firstLevelCategoryId", required = false) String firstLevelCategoryId,
//                                      @ApiParam(name = "secondLevelCategoryId", value = "文章二级分类")
//                                      @RequestParam(value = "secondLevelCategoryId", required = false) String secondLevelCategoryId,
//                                      @ApiParam(name = "insertTimeStart", value = "新增文章开始时间")
//                                      @RequestParam(value = "insertTimeStart", required = false) String insertTimeStart,
//                                      @ApiParam(name = "insertTimeEnd", value = "新增文章结束时间")
//                                      @RequestParam(value = "insertTimeEnd", required = false) String insertTimeEnd,
//                                      @ApiParam(name = "articlelevel", value = "文章级别")
//                                      @RequestParam(value = "articlelevel", required = false) String articlelevel,
//                                      @ApiParam(name = "articleTitle", value = "文章标题关键字")
//                                      @RequestParam(value = "articleTitle", required = false) String articleTitle,
//                                      @ApiParam(name = "currentUserRole", value = "当前登录的角色")
//                                      @RequestParam(value = "currentUserRole", required = true) String currentUserRole,
//                                      @ApiParam(name = "currentUserRoleLevel", value = "当前登录的角色级别")
//                                      @RequestParam(value = "currentUserRoleLevel", required = false )String currentUserRoleLevel,
//                                      @ApiParam(name = "isAuthentication", value = "是否认证")
//                                      @RequestParam(value = "isAuthentication", required = false) String isAuthentication,
//                                      @ApiParam(name = "isMyArticle", value = "是否过滤我的文章")
//                                      @RequestParam(value = "isMyArticle", required = false) Boolean isMyArticle,
//                                      @ApiParam(name = "page", value = "当前页")
//                                      @RequestParam(value = "page", required = true) Integer page,
//                                      @ApiParam(name = "pageSize", value = "分页数")
//                                      @RequestParam(value = "pageSize", required = true) Integer pageSize,
//                                      @ApiParam(name = "roleType", value = "1、普通医生,2、管理员")
//                                      @RequestParam(value = "roleType", required = false) Integer roleType){
//        try {
//
//
//
//            com.alibaba.fastjson.JSONObject response = jmJkEduArticleService.queryArticlePcList(firstLevelCategoryId, secondLevelCategoryId, insertTimeStart, insertTimeEnd, articlelevel, articleTitle,
//                    getUID(), currentUserRole, currentUserRoleLevel, isAuthentication, isMyArticle, page, pageSize,null,roleType);
//
//            return write(200,"查询成功!","data",response);
//        } catch (Exception e){
//            e.printStackTrace();
//            return error(-1,"查询失败!");
//        }
//    }
//    @RequestMapping(value = "saveArticle", method = RequestMethod.POST)
//    @RequestMapping(value = "saveArticle", method = RequestMethod.POST)
//    @ApiOperation("添加文章")
//    @ApiOperation("添加文章")
@ -445,40 +445,40 @@ public class DoctorJMJkEduArticleController 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,getUID(),1);
//            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,getUID(),1);
//            thirdJkEduArticleService.cancelArticleCollection(articleId,"0de7295862dd11e69faffa163e8aee56",1);
            return success("取消成功!");
        }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,getUID(),1);
////            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,getUID(),1);
////            thirdJkEduArticleService.cancelArticleCollection(articleId,"0de7295862dd11e69faffa163e8aee56",1);
//            return success("取消成功!");
//        }catch (Exception e){
//            e.printStackTrace();
//            return error(-1,"取消失败!");
//        }
//    }
    /*************************************************************************医生角色end***************************************************************************************************/
    /*************************************************************************医生角色end***************************************************************************************************/

+ 11 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEduPC/DoctorJMJkEduArticlePCController.java

@ -94,10 +94,10 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
                                      @RequestParam(value = "articlelevel", required = false) String articlelevel,
                                      @RequestParam(value = "articlelevel", required = false) String articlelevel,
                                      @ApiParam(name = "articleTitle", value = "文章标题关键字")
                                      @ApiParam(name = "articleTitle", value = "文章标题关键字")
                                      @RequestParam(value = "articleTitle", required = false) String articleTitle,
                                      @RequestParam(value = "articleTitle", required = false) String articleTitle,
//                                      @ApiParam(name = "currentUserRole", value = "当前登录的角色")
//                                      @RequestParam(value = "currentUserRole", required = true) String currentUserRole,
//                                      @ApiParam(name = "currentUserRoleLevel", value = "当前登录的角色级别")
//                                      @RequestParam(value = "currentUserRoleLevel", required = true )String currentUserRoleLevel,
                                      @ApiParam(name = "currentUserRole", value = "当前登录的角色")
                                      @RequestParam(value = "currentUserRole", required = false) String currentUserRole,
                                      @ApiParam(name = "currentUserRoleLevel", value = "当前登录的角色级别")
                                      @RequestParam(value = "currentUserRoleLevel", required = false )String currentUserRoleLevel,
                                      @ApiParam(name = "isAuthentication", value = "是否认证")
                                      @ApiParam(name = "isAuthentication", value = "是否认证")
                                      @RequestParam(value = "isAuthentication", required = false) String isAuthentication,
                                      @RequestParam(value = "isAuthentication", required = false) String isAuthentication,
                                      @ApiParam(name = "isMyArticle", value = "是否过滤我的文章")
                                      @ApiParam(name = "isMyArticle", value = "是否过滤我的文章")
@ -111,10 +111,15 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
                                      @ApiParam(name = "roleType", value = "1、普通医生,2、管理员")
                                      @ApiParam(name = "roleType", value = "1、普通医生,2、管理员")
                                      @RequestParam(value = "roleType", required = false) Integer roleType){
                                      @RequestParam(value = "roleType", required = false) Integer roleType){
        try {
        try {
            if(StringUtils.isNotEmpty(currentUserRole)){
                currentUserRole=getCurrentRoleCode();
            }
            if(StringUtils.isNotEmpty(currentUserRoleLevel)){
                currentUserRoleLevel=getCurrentRoleLevel();
            }
            JSONObject response = jmJkEduArticleService.queryArticlePcList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,articleTitle,
            JSONObject response = jmJkEduArticleService.queryArticlePcList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,articleTitle,
                    getUID(),getCurrentRoleCode(),getCurrentRoleLevel(),isAuthentication,isMyArticle,page,pageSize,sEcho,roleType);
                    getUID(),currentUserRole,currentUserRoleLevel,isAuthentication,isMyArticle,page,pageSize,sEcho,roleType);
            return write(200,"查询成功!","data",response);
            return write(200,"查询成功!","data",response);
        } catch (Exception e){
        } catch (Exception e){

+ 10 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkEduArticle/ThirdJkEduArticleController.java

@ -87,7 +87,7 @@ public class ThirdJkEduArticleController extends BaseController {
    public String getArticalById(@ApiParam(name = "articleId", value = "文章id",defaultValue = "1")
    public String getArticalById(@ApiParam(name = "articleId", value = "文章id",defaultValue = "1")
                                 @RequestParam(value = "articleId", required = true) String articleId){
                                 @RequestParam(value = "articleId", required = true) String articleId){
        try {
        try {
            com.alibaba.fastjson.JSONObject response = thirdJkEduArticleService.getArticalById(articleId,"");
            com.alibaba.fastjson.JSONObject response = thirdJkEduArticleService.getArticalById(articleId,getRepUID());
            return write(200,"查询成功!","data",response);
            return write(200,"查询成功!","data",response);
        }catch (Exception e){
        }catch (Exception e){
            e.printStackTrace();
            e.printStackTrace();
@ -99,9 +99,12 @@ public class ThirdJkEduArticleController extends BaseController {
    @ApiOperation("取消收藏文章")
    @ApiOperation("取消收藏文章")
    @ObserverRequired
    @ObserverRequired
    public String cancelArticleCollection(@ApiParam(name = "articleId", value = "文章id",defaultValue = "1")
    public String cancelArticleCollection(@ApiParam(name = "articleId", value = "文章id",defaultValue = "1")
                                          @RequestParam(value = "articleId", required = true) String articleId){
                                          @RequestParam(value = "articleId", required = true) String articleId,
                                          @ApiParam(name = "userType", value = "用户类型:1医生,2居民",defaultValue = "1")
                                          @RequestParam(value = "userType", required = true) Integer userType
                                          ){
        try {
        try {
            thirdJkEduArticleService.cancelArticleCollection(articleId,getRepUID(),1);
            thirdJkEduArticleService.cancelArticleCollection(articleId,getRepUID(),userType);
//            thirdJkEduArticleService.cancelArticleCollection(articleId,"0de7295862dd11e69faffa163e8aee56",1);
//            thirdJkEduArticleService.cancelArticleCollection(articleId,"0de7295862dd11e69faffa163e8aee56",1);
            return success("取消成功!");
            return success("取消成功!");
        }catch (Exception e){
        }catch (Exception e){
@ -118,9 +121,11 @@ public class ThirdJkEduArticleController extends BaseController {
                                        @ApiParam(name = "articleCategoryId", value = "文章类别ID")
                                        @ApiParam(name = "articleCategoryId", value = "文章类别ID")
                                        @RequestParam(value = "articleCategoryId", required = false,defaultValue = "1") String articleCategoryId,
                                        @RequestParam(value = "articleCategoryId", required = false,defaultValue = "1") String articleCategoryId,
                                        @ApiParam(name = "articleCategoryName", value = "文章类别名称")
                                        @ApiParam(name = "articleCategoryName", value = "文章类别名称")
                                        @RequestParam(value = "articleCategoryName", required = false) String articleCategoryName){
                                        @RequestParam(value = "articleCategoryName", required = false) String articleCategoryName,
                                        @ApiParam(name = "userType", value = "用户类型:1医生,2居民",defaultValue = "1")
                                            @RequestParam(value = "userType", required = true) Integer userType){
        try {
        try {
            thirdJkEduArticleService.saveArticleCollection(articleId,articleCategoryId,articleCategoryName,getRepUID(),1);
            thirdJkEduArticleService.saveArticleCollection(articleId,articleCategoryId,articleCategoryName,getRepUID(),userType);
//            thirdJkEduArticleService.saveArticleCollection(articleId,articleCategoryId,articleCategoryName,"0de7295862dd11e69faffa163e8aee56",1);
//            thirdJkEduArticleService.saveArticleCollection(articleId,articleCategoryId,articleCategoryName,"0de7295862dd11e69faffa163e8aee56",1);
            return success("收藏成功!");
            return success("收藏成功!");