package com.sqx.ws;

import lombok.Data;

@Data
public class BaseInfoModel<T> {

	private String code;
	private String msg;
	private T data;

	public static <T> BaseResponseMessage success(String type, T data) {
		BaseResponseMessage<T> baseResponseMessage = new BaseResponseMessage<>();
		baseResponseMessage.setCode("0");
		baseResponseMessage.setType(type);
		baseResponseMessage.setMsg("成功");
		baseResponseMessage.setData(data);
		return baseResponseMessage;
	}

	public static <T> BaseResponseMessage error(String type,String code,String msg, T data) {
		BaseResponseMessage<T> baseResponseMessage = new BaseResponseMessage<>();
		baseResponseMessage.setCode(code);
		baseResponseMessage.setType(type);
		baseResponseMessage.setMsg(msg);
		baseResponseMessage.setData(data);
		return baseResponseMessage;
	}

}
