package com.wechat.model.responseDto;

import com.wechat.global.message.InfoMsg;

public class ResultEntity<T> {
	private String code;
	private String msg;//提示信息  前台显示
	private T result;
	
	public ResultEntity() {
		this.code = InfoMsg.SUCCESS_REQUEST.getCode();
		this.msg = InfoMsg.SUCCESS_REQUEST.getMsg();
	}
	
	public ResultEntity(String code){
		this.code = code;
	}
	public ResultEntity(InfoMsg msg){
		this.code = msg.getCode();
		this.msg = msg.getMsg();
	}
	public ResultEntity(InfoMsg msg,T result){
		this.code = msg.getCode();
		this.msg = msg.getMsg();
		this.result = result;
	}
	
	public ResultEntity(String code,String info){
		this.code = code;
		this.msg = info;
	}
	public ResultEntity(String code, String info ,T result){
		this.code = code;
		this.msg = info;
		this.result = result;
	}
	
	public void setResultEntity(InfoMsg msg){
		this.code = msg.getCode();
		this.msg = msg.getMsg();
	}
	
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	
	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}
	
	public void setMsg(InfoMsg msg) {
		this.code = msg.getCode();
		this.msg = msg.getMsg();
	}

	public T getResult() {
		return result;
	}
	public void setResult(T result) {
		this.result = result;
	}

}
