package com.cym.utils;

import com.fasterxml.jackson.annotation.JsonInclude;

import cn.hutool.json.JSONUtil;
import io.swagger.v3.oas.annotations.media.Schema;

/**
 * Author: D.Yang Email: koyangslash@gmail.com Date: 16/8/31 Time: 下午5:50
 * Describe: 封装Json返回信息
 */
@Schema(description = "返回结果")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class JsonResult<T> {
	@Schema(description = "请求结果")
	private boolean success;
	@Schema(description = "请求状态 200:请求成功 401:token无效 500:服务器错误")
	private String status;
	@Schema(description = "错误信息")
	private String msg;
	@Schema(description = "时间")
	private String time;
	@Schema(description = "返回内容")
	private T obj;

	
	public String getTime() {
		return time;
	}

	public void setTime(String time) {
		this.time = time;
	}

	public String toString() {
		return JSONUtil.toJsonStr(this);
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public T getObj() {
		return obj;
	}

	public void setObj(T obj) {
		this.obj = obj;
	}

}
