1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- package com.yihu.iot.model;
- 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 = statusEm.success.getCode();
- @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 enum statusEm {
- success(10000, "请求成功"),//请求成功
- error_Appid(40004, "appid不存在"),//appid不存在
- error_AppSecret(40001, "AppSecret不存在"),//AppSecret不存在
- token_out_effect(-9002, "无效的token"),//token无效
- token_no_power(-9003, "用户没权限"),// 没权限 包括未授权 或者uri错误
- token_out_time(-9004, "accesstoken已过期"),//token无效
- token_null(-9005, "accesstoken为空"),// 没权限 包括未授权 或者uri错误
- error_params(-10000, "请求失败 参数错误"),//请求失败 参数错误
- error_no_ip(-10010, "请求失败,获取IP失败"),//请求失败,获取IP失败
- login_system_error(-10020, "系统异常"),
- login_publickey_error(-10030, "获取公钥失败"),
- file_upload_error(-10040, "文件上传失败"),
- find_error(-10050, "查询失败"),
- opera_error(-10060, "操作失败"),
- no_openid(-30000,"用户openId为空无法发送"),
- login_account_error(-20010, "账号不存在"),
- login_password_error(-20020, "密码错误"),
- login_IMEI_error(-20030, "获取imei失败");
- ;
- statusEm(Integer code, String message) {
- this.code = code;
- this.message = message;
- }
- private Integer code;
- private String message;
- public Integer getCode() {
- return code;
- }
- public void setCode(Integer code) {
- this.code = code;
- }
- 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;
- }
- }
|