公用的请求和相应
请求
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "基本请求")
public class BaseRequest<T> implements Serializable{
@ApiModelProperty(value = "请求令牌")
private String token;
@ApiModelProperty(value = "请求参数")
private T params;
}
响应
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "基本响应")
@Data
public class BaseResponse<T> {
@ApiModelProperty(value = "错误码")
private String errCode = ResponseCode.SUCCESS.getCode();
@ApiModelProperty(value = "错误信息")
private String errMsg = ResponseCode.SUCCESS.getDesc();
@ApiModelProperty(value = "结果")
private T result;
}
转载请注明原文地址:https://ipadbbs.8miu.com/read-1053.html