博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
web返回状态信息类
阅读量:3950 次
发布时间:2019-05-24

本文共 938 字,大约阅读时间需要 3 分钟。

web返回状态信息类

package com.example.youruan.day01.entity;import lombok.AllArgsConstructor;import lombok.Data;import lombok.NoArgsConstructor;@Data@AllArgsConstructor@NoArgsConstructorpublic class ResultEntity
{
private static final String SUCCESS = "success"; private static final String ERROR = "error"; private String status;//请求成功还是失败 private String message;//失败得原因 private T data;//返回得数据 public static
ResultEntity
success() {
return new ResultEntity<>(SUCCESS, null, null); } public static
ResultEntity
success(T t) {
return new ResultEntity<>(SUCCESS, null, t); } public static
ResultEntity
error(String message) { return new ResultEntity<>(ERROR, message, null); } public static ResultEntity responseClient(boolean flag) { if (flag) { return ResultEntity.success(); } else { return ResultEntity.error("失败"); } }}

转载地址:http://shrwi.baihongyu.com/

你可能感兴趣的文章
ubuntu安装命令
查看>>
和上司沟通必备8个黄金句
查看>>
联系查看两张卡的未接电话记录
查看>>
把拒接电话作为已经接电话写到call log中
查看>>
FDN号码完全匹配
查看>>
Cosmos 拨号界面保存号码时先提示选择存储位置
查看>>
换卡或不插卡时删除通话记录
查看>>
静音模式下,来闹钟能响铃。
查看>>
调整提醒的优先级
查看>>
如何添加一个提醒
查看>>
Displaying Card Flip Animations 显示卡片翻转动画
查看>>
Zooming a View 缩放视图
查看>>
Animating Layout Changes 动画布局的更改
查看>>
Controlling Your App’s Volume and Playback 控制应用程序的音量和播放
查看>>
Dealing with Audio Output Hardware 处理音频输出硬件设备
查看>>
Monitoring the Battery Level and Charging State 监测电池电量和充电状态
查看>>
Determining and Monitoring the Docking State and Type 判断并监测设备的停驻状态与类型
查看>>
Custom Drawing 自定义绘制
查看>>
跨平台的文字编码转换方法--ICU
查看>>
ICU4C 4.4 静态库的编译
查看>>