Commit 125ee580 by huyi

新建Controller的返回

parent 8d3299d8
package com.fhkj.oltinspection.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping (value = "/index")
public class IndexController {
}
\ No newline at end of file
package com.fhkj.oltinspection.pojo;
import java.io.Serializable;
/**
* @author 胡懿
* @see 用这个类对象作为每个controller的返回类型,返回时直接使用构造方法即可
*
*/
public class Result implements Serializable {
private static final long serialVersionUID = -8216936893545820837L;
private Integer code;
private String msg;
private Object data;
public Result () {
super ();
this.code = null;
this.msg = "";
this.data = null;
}
public Result (Integer code) {
this.code = code;
}
public Result (String msg) {
this.msg = msg;
}
public Result (Object data) {
this.data = data;
}
public Result (Integer code, String msg) {
this.code = code;
this.msg = msg;
}
public Result (Integer code, Object data) {
this.code = code;
this.data = data;
}
public Result (String msg, Object data) {
this.msg = msg;
this.data = data;
}
public Result (Integer code, String msg, Object data) {
this.code = code;
this.msg = msg;
this.data = data;
}
/**
* @return the code
*/
public Integer getCode() {
return code;
}
/**
* @param code the code to set
*/
public void setCode(Integer code) {
this.code = code;
}
/**
* @return the msg
*/
public String getMsg() {
return msg;
}
/**
* @param msg the msg to set
*/
public void setMsg(String msg) {
this.msg = msg;
}
/**
* @return the data
*/
public Object getData() {
return data;
}
/**
* @param data the data to set
*/
public void setData(Object data) {
this.data = data;
}
@Override
public String toString () {
return "code:" + this.code + ", msg:" + this.msg + ", data:" + this.data;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment