定义返回结果 Resultmodel

时间:2023-01-07 06:22:54
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;
    }
}