Forráskód Böngészése

新增宣教--患者端controller、返回类型封装类和类型实体类

zd_123 7 éve
szülő
commit
2c6ccced79

+ 46 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkedu/controller/patient/EduArticleController.java

@ -0,0 +1,46 @@
package com.yihu.wlyy.web.third.jkedu.controller.patient;
import com.yihu.wlyy.entity.jkedu.EduArticle;
import com.yihu.wlyy.web.third.jkedu.vo.ArticleModel;
import com.yihu.wlyy.web.third.jkedu.vo.base.ResultListModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
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 java.util.List;
/**
 * Created by Administrator on 2017/9/30.
 */
@Controller
@Api(description = "居民端--健康宣教文章")
@RequestMapping(value = "/wlyygc/patient/jkedu",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class EduArticleController {
    /*@RequestMapping("/getDoctorArticalList")
    @ApiOperation("获取卫计委认证文章+医生发表未认证文章")
    public ResultListModel<List<EduArticle>> getDoctorArticalList(
            @ApiParam(name = "articleTitle",value = "文章标题",required = false)@RequestParam(value = "articleTitle",required = false)String articleTitle,
            @ApiParam(name = "articleState",value = "文章标题",required = false)@RequestParam(value = "articleTitle",required = false)String articleState,
            @ApiParam(name = "firstLevelCategoryId",value = "文章标题",required = false)@RequestParam(value = "articleTitle",required = false)String firstLevelCategoryId,
            @ApiParam(name = "pageIndex",value = "文章标题",required = false)@RequestParam(value = "articleTitle",required = false)String pageIndex,
            @ApiParam(name = "pageSize",value = "文章标题",required = false)@RequestParam(value = "articleTitle",required = false)String pageSize,
            @ApiParam(name = "userId",value = "文章标题",required = false)@RequestParam(value = "articleTitle",required = false)String userId){
    }*/
    @RequestMapping(value = "/getDoctorArticleList",method = RequestMethod.GET)
    @ApiOperation("获取医生主页中的文章列表")
    public ResultListModel<ArticleModel> getDoctorArticleList(
        @ApiParam(name = "keyWord",value = "搜索关键字",required = false)@RequestParam(value = "keyWord",required = false)String keyWord){
        //根据公众号的openid查询到和患者签约的医生code。
        //根据医生code查询这个医生的所有文章
        return  new ResultListModel();
    }
}

+ 32 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkedu/vo/CategoryModel.java

@ -0,0 +1,32 @@
package com.yihu.wlyy.web.third.jkedu.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
 * Created by Administrator on 2017/9/29.
 */
@ApiModel(description = "文章类型")
public class CategoryModel {
    @ApiModelProperty(value = "类型ID",required = false,access = "response")
    private String categoryid;
    @ApiModelProperty(value = "类型明显",required = false,access = "response")
    private String categoryname;
    public String getCategoryid() {
        return categoryid;
    }
    public void setCategoryid(String categoryid) {
        this.categoryid = categoryid;
    }
    public String getCategoryname() {
        return categoryname;
    }
    public void setCategoryname(String categoryname) {
        this.categoryname = categoryname;
    }
}

+ 45 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkedu/vo/base/BaseResultModel.java

@ -0,0 +1,45 @@
package com.yihu.wlyy.web.third.jkedu.vo.base;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
 * Created by chenweida on 2017/8/17.
 */
@ApiModel("返回实体")
public class BaseResultModel {
    @ApiModelProperty(value = "状态", required = false, access = "response")
    protected Integer status = 10000;
    @ApiModelProperty(value = "信息", required = false, access = "response")
    protected String message = "成功";
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public String getMessage() {
        return message;
    }
    public void setMessage(String message) {
        this.message = message;
    }
    public BaseResultModel() {
    }
    public BaseResultModel(String message) {
        this.message = message;
    }
    public BaseResultModel(Integer status, String message) {
        this.status = status;
        this.message = message;
    }
}

+ 36 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkedu/vo/base/ResultListModel.java

@ -0,0 +1,36 @@
package com.yihu.wlyy.web.third.jkedu.vo.base;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
/**
 * Created by chenweida on 2017/8/17.
 */
public class ResultListModel<T> extends BaseResultModel {
    @ApiModelProperty(value = "返回数据", required = false, access = "response")
    private List<T> result;
    public List<T> getResult() {
        return result;
    }
    public void setResult(List<T> result) {
        this.result = result;
    }
    public ResultListModel(List<T> result) {
        this.result = result;
    }
    public ResultListModel(Integer status, String message) {
        this.status = status;
        this.message = message;
    }
    public ResultListModel() {
    }
}

+ 76 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkedu/vo/state/ErrorStateMessage.java

@ -0,0 +1,76 @@
package com.yihu.wlyy.web.third.jkedu.vo.state;
/**
 * Created by Administrator on 2017/9/30.
 */
public class ErrorStateMessage {
    public  final  static  String success="请求成功";
    public  final  static  String err_20000="api参数缺失或api参数值格式错误";
    public  final  static  String err_20001="路由解析错误";
    public  final  static  String err_20002="未找到可用的路由地址";
    public  final  static  String err_20003="未找到远程接口实现类";
    public  final  static  String err_20004="应用系统返回空结果集";
    public  final  static  String err_20005="IP不在允许访问范围内";
    public  final  static  String err_20006="渠道ID不存在";
    public  final  static  String err_20007="签名验证不通过,请检查secret是否正确/加密方式是否正确";
    public  final  static  String err_20008="已超过每小时的额定调用上限,禁止访问";
    public  final  static  String err_20009="已超过每天的额定调用上限,禁止访问";
    public  final  static  String err_20010="验证不通过:timestamp参数不能为空";
    public  final  static  String err_29999="远程过程调用(RPC)异常";
    public  final  static  String err_30000="响应超时";
    public  final  static  String fail="请求成功";
    public final static String getMessge(int code){
        String message ="";
        switch (code){
            case 10000:
                message = success;
                break;
            case 20000:
                message = err_20000;
                break;
            case 20001:
                message = err_20001;
                break;
            case 20002:
                message = err_20002;
                break;
            case 20003:
                message = err_20003;
                break;
            case 20004:
                message = err_20004;
                break;
            case 20005:
                message = err_20005;
                break;
            case 20006:
                message = err_20006;
                break;
            case 20007:
                message = err_20007;
                break;
            case 20008:
                message = err_20008;
                break;
            case 20009:
                message = err_20009;
                break;
            case 20010:
                message = err_20010;
                break;
            case 29999:
                message = err_29999;
                break;
            case 30000:
                message = err_30000;
                break;
            case -10000:
                message = fail;
                break;
        }
        return message;
    }
}