parent
e32c4e2f5b
commit
d0744f7ef3
7 changed files with 149 additions and 41 deletions
@ -0,0 +1,22 @@ |
||||
package com.daqing.financial.guarantee.model.response; |
||||
|
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* @Author chen |
||||
* @DATE 2021/1/5 11:32 |
||||
* @Version 1.0 |
||||
*/ |
||||
@Data |
||||
public class NumResponse { |
||||
|
||||
@ApiModelProperty("发起数") |
||||
private Integer initiateNum = 0; |
||||
|
||||
@ApiModelProperty("待处理数") |
||||
private Integer pendingNum = 0; |
||||
|
||||
@ApiModelProperty("已处理数") |
||||
private Integer processedNum = 0; |
||||
} |
@ -0,0 +1,71 @@ |
||||
package com.daqing.financial.guarantee.util; |
||||
|
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @Author chen |
||||
* @DATE 2021/1/5 11:43 |
||||
* @Version 1.0 |
||||
*/ |
||||
@Data |
||||
public class R { |
||||
|
||||
@ApiModelProperty(value = "是否成功") |
||||
private Boolean success; |
||||
|
||||
@ApiModelProperty(value = "返回码") |
||||
private Integer code; |
||||
|
||||
@ApiModelProperty(value = "返回消息") |
||||
private String message; |
||||
|
||||
@ApiModelProperty(value = "返回数据") |
||||
private Map<String, Object> data = new HashMap<String, Object>(); |
||||
|
||||
private R(){} |
||||
|
||||
public static R ok(){ |
||||
R r = new R(); |
||||
r.setSuccess(true); |
||||
r.setCode(ResultCode.SUCCESS); |
||||
r.setMessage(ResultCode.SUCCESS_MESSAGE); |
||||
return r; |
||||
} |
||||
|
||||
public static R error(){ |
||||
R r = new R(); |
||||
r.setSuccess(false); |
||||
r.setCode(ResultCode.FAILURE); |
||||
r.setMessage(ResultCode.FAILURE_MESSAGE); |
||||
return r; |
||||
} |
||||
|
||||
public R success(Boolean success){ |
||||
this.setSuccess(success); |
||||
return this; |
||||
} |
||||
|
||||
public R message(String message){ |
||||
this.setMessage(message); |
||||
return this; |
||||
} |
||||
|
||||
public R code(Integer code){ |
||||
this.setCode(code); |
||||
return this; |
||||
} |
||||
|
||||
public R data(String key, Object value){ |
||||
this.data.put(key, value); |
||||
return this; |
||||
} |
||||
|
||||
public R data(Map<String, Object> map){ |
||||
this.setData(map); |
||||
return this; |
||||
} |
||||
} |
@ -0,0 +1,13 @@ |
||||
package com.daqing.financial.guarantee.util; |
||||
|
||||
/** |
||||
* @Author chen |
||||
* @DATE 2021/1/5 11:43 |
||||
* @Version 1.0 |
||||
*/ |
||||
public interface ResultCode { |
||||
Integer SUCCESS = 10000;//成功
|
||||
Integer FAILURE = 20000;//失败
|
||||
String SUCCESS_MESSAGE = "成功"; |
||||
String FAILURE_MESSAGE = "失败"; |
||||
} |
Loading…
Reference in new issue