修改成功消息结构,新增即时消息返回结果

This commit is contained in:
wanggeng888 2021-01-18 13:01:54 +08:00
parent 9885a36bfc
commit 541dee8f1f
3 changed files with 223 additions and 2 deletions

View File

@ -12,8 +12,9 @@ import java.io.Serializable;
* @Version: 1.0
**/
@ApiModel
public class SuccessResultData<T> extends SuccessResult implements Serializable {
public class SuccessResultData<T> extends SuccessResult {
private static final long serialVersionUID = 2292105832378967169L;
private T data;
public SuccessResultData(T data) {

View File

@ -0,0 +1,219 @@
package com.cm.common.result;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
/**
* When you feel like quitting. Think about why you started
* 当你想要放弃的时候想想当初你为何开始
*
* @ClassName: SuccessResultLayImData
* @Description: layim返回结果
* @Author: wanggeng
* @Date: 2021/1/15 10:08 上午
* @Version: 1.0
*/
@ApiModel
public class SuccessResultLayImData<T> extends SuccessResult {
private static final long serialVersionUID = 4541100893920060211L;
@ApiModelProperty(name = "code", value = "0表示成功其它表示失败")
private Integer code;
@ApiModelProperty(name = "msg", value = "失败信息")
private String msg;
@ApiModelProperty(name = "data", value = "内容")
private T data;
public SuccessResultLayImData() {
}
public SuccessResultLayImData(Integer code, String msg, T data) {
this.code = code;
this.msg = msg;
this.data = data;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
@ApiModel
public static class InitData {
@ApiModelProperty(name = "mine", value = "我的信息")
private User mine;
@ApiModelProperty(name = "friend", value = "好友列表")
private List<Friend> friend;
@ApiModelProperty(name = "group", value = "群组列表")
private List<Group> group;
public User getMine() {
return mine;
}
public void setMine(User mine) {
this.mine = mine;
}
public List<Friend> getFriend() {
return friend;
}
public void setFriend(List<Friend> friend) {
this.friend = friend;
}
public List<Group> getGroup() {
return group;
}
public void setGroup(List<Group> group) {
this.group = group;
}
}
@ApiModel
public static class User {
@ApiModelProperty(name = "username", value = "我的昵称")
private String username;
@ApiModelProperty(name = "id", value = "我的ID")
private String id;
@ApiModelProperty(name = "status", value = "在线状态 online在线、hide隐身")
private String status;
@ApiModelProperty(name = "sign", value = "我的签名")
private String sign;
@ApiModelProperty(name = "avatar", value = "我的头像")
private String avatar;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getSign() {
return sign;
}
public void setSign(String sign) {
this.sign = sign;
}
public String getAvatar() {
return avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
}
@ApiModel
public static class Friend {
@ApiModelProperty(name = "groupname", value = "好友分组名")
private String groupname;
@ApiModelProperty(name = "id", value = "分组ID")
private String id;
@ApiModelProperty(name = "list", value = "分组下的好友列表")
private List<User> list;
public String getGroupname() {
return groupname;
}
public void setGroupname(String groupname) {
this.groupname = groupname;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public List<User> getList() {
return list;
}
public void setList(List<User> list) {
this.list = list;
}
}
@ApiModel
public static class Group {
@ApiModelProperty(name = "groupname", value = "群组名")
private String groupname;
@ApiModelProperty(name = "id", value = "群组ID")
private String id;
@ApiModelProperty(name = "id", value = "群组头像")
private String avatar;
public String getGroupname() {
return groupname;
}
public void setGroupname(String groupname) {
this.groupname = groupname;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getAvatar() {
return avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
}
}

View File

@ -13,8 +13,9 @@ import java.io.Serializable;
* @Version: 1.0
**/
@ApiModel
public class SuccessResultList<List> extends SuccessResult implements Serializable {
public class SuccessResultList<List> extends SuccessResult {
private static final long serialVersionUID = 7152646978840034322L;
@ApiModelProperty(name = "rows", value = "数据列表")
private List rows;
@ApiModelProperty(name = "page", value = "当前页码", example = "1")