当前位置: 首页 > news >正文

无锡做网站价格百度推广登陆入口

无锡做网站价格,百度推广登陆入口,用软件做的网站权限管理,体验做愛网站目的:给返回对象补充一些信息,告诉前端这个请求在业务层面上是成功还是失败,以及具体的描述信息。 我们需要自定义错误码(因为前端的HTTP状态码默认的值比较少)和正常错误返回类。 ErrorCode : package …

目的:给返回对象补充一些信息,告诉前端这个请求在业务层面上是成功还是失败,以及具体的描述信息。

我们需要自定义错误码(因为前端的HTTP状态码默认的值比较少)和正常错误返回类。

ErrorCode :

package com.heo.ezyuserbackend.common;public enum ErrorCode {SUCCESS(0, "ok", ""),PARAMS_ERROR(40000, "请求参数错误", ""),NULL_ERROR(40001, "请求参数为空", ""),NOT_LOGIN(40100, "未登录", ""),NO_AUTH(40101, "无权限", ""),SYSTEM_ERROR(50000,"系统内部异常","");private final int code;/*** 状态码信息*/private  final String message;public int getCode() {return code;}public String getMessage() {return message;}public String getDescription() {return description;}/*** 状态码描述(详情)*/private final String description;ErrorCode(int code, String message, String description) {this.code = code;this.message = message;this.description = description;}
}

BaseResponse:

package com.heo.ezyuserbackend.common;import lombok.Data;import java.io.Serializable;/*** 通用返回类** @param <T>*/
@Data
public class BaseResponse<T> implements Serializable {private int code;private T data;private String message;private String description;public BaseResponse(int code, T data, String message, String description) {this.code = code;this.data = data;this.message = message;this.description = description;}public BaseResponse(int code, T data,String message) {this(code, data, message,"");}public BaseResponse(int code, T data) {this(code, data, "", "");}public BaseResponse(ErrorCode errorCode) {this(errorCode.getCode(), null, errorCode.getMessage(), errorCode.getDescription());}
}

ResultUtil :

package com.heo.ezyuserbackend.common;import com.fasterxml.jackson.databind.ser.Serializers;/*** 返回工具类*/
public class ResultUtil {/*** 成功** @param data* @param <T>* @return*/public static <T> BaseResponse<T> success(T data) {return new BaseResponse<>(0, data, "ok");}/*** 失败** @param errorCode* @return*/public static <T> BaseResponse<T> error(ErrorCode errorCode) {return new BaseResponse<>(errorCode);}/*** 失败** @param code* @param message* @param description* @param <T>* @return*/public static <T> BaseResponse<T> error(int code, String message, String description) {return new BaseResponse<>(code, null, message, description);}/*** 失败** @param errorCode* @param message* @param description* @param <T>* @return*/public static <T> BaseResponse<T> error(ErrorCode errorCode, String message, String description) {return new BaseResponse<>(errorCode.getCode(), null, message, description);}/*** 失败** @param errorCode* @param description* @return*/public static BaseResponse error(ErrorCode errorCode, String description) {return new BaseResponse<>(errorCode.getCode(), errorCode.getMessage(), description);}
}
http://www.hkea.cn/news/716968/

相关文章:

  • 深圳南山做网站的公司百度投诉中心
  • 辽宁建设工程信息网业绩认定武汉网站优化公司
  • 莱芜都市人才网上海网站seo公司
  • 广州做鞋的网站怎么让某个关键词排名上去
  • 温州平阳县网站建设兼职东莞网络推广哪家公司奿
  • 做单页网站价格微信朋友圈广告在哪里做
  • 濮阳家电网站建设一般开车用什么导航最好
  • html5 图片展示网站大作设计网站
  • 河北正规网站建设比较百度一下你就知道官页
  • 企业网站建设哪家服务好福州网站关键词推广
  • 惠州悦商做网站软件开发一般需要多少钱
  • 做衣服外单网站优化大师官方正版下载
  • 专门做酒店的网站百度排行
  • 上海做手机网站建设盐城网站优化
  • html论坛模板东营seo整站优化
  • 天津网站建设582345网址导航桌面版
  • 东莞纸箱厂东莞网站建设经典模板网站建设
  • 贺州同城购物网站建设中国网站排名100
  • 黄骅港旅游景点爱站网seo工具包
  • 网站 图文混编提高网站搜索排名
  • 北京怀柔网站制作教育机构
  • 网站建设费 大创友链交换平台
  • o2o商城网站系统开发微信群拉人的营销方法
  • 帝国cms做淘宝客网站网页设计用什么软件
  • 营销型网站建设的优缺点视频优化软件
  • 珠海响应式网站建设推广公司网络营销发展方案策划书
  • 中国人自己的空间站每日英语新闻
  • 教师可以做网站吗seo常用工具包括
  • 武山建设局网站什么是seo
  • 做文案需要用到的网站全网模板建站系统