定义返回结果 Resultmodel
web: checkPath: localhost:9099 success: 1 error: 0
package com.worker.config; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; /* * * gen by beetlsql 2018-08-23 */ @Configuration public class Resultmodel { public static Integer SUCCESS;//成功 public static Integer ERROR;//失败 @Value("${web.success}") public void setSUCCESS(Integer success) { SUCCESS = success; } @Value("${web.error}") public void setERROR(Integer error) { ERROR = error; } public int code; public String msg; public Object data; public Resultmodel() { } public Resultmodel(int code, String msg, Object data) { this.code = code; this.msg = msg; this.data = data; } public Resultmodel(int code, String msg) { this.code = code; this.msg = msg; } public int getCode() { return code; } public void setCode(int code) { this.code = code; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public Object getData() { return data; } public void setData(Object data) { this.data = data; } }
SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

更多精彩