package cn.superdesk.uniorder.common.rest.response;

import cn.superdesk.uniorder.common.constants.ResponseResultConstants;

/**
 * @Description: 暂定:外部用
 * @Author: linjinyu
 * @CreateDate: 2021/3/5 下午1:38
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021/3/5 下午1:38
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public class ResponseResultOuterUtils {

	public static <T> R<T> createSuccesResult() {
		return new R<T>(ResponseResultConstants.SUCCESS, "操作成功", null);
	}

	public static <T> R<T> createSuccesResult(String msg) {
		return new R<T>(ResponseResultConstants.SUCCESS, msg, null);
	}

	public static <T> R<Object> createSuccesResult(Object data) {
		return new R<Object>(ResponseResultConstants.SUCCESS, "操作成功", data, true);
	}

//	public static R<Object> createSuccesResult(String msg, Object data) {
//		return new R<Object>(ResultConstants.SUCCESS_CODE, msg, data, true);
//	}

	public static <T> R<T> createSuccesResult(String msg, T data) {
		return new R<T>(ResponseResultConstants.SUCCESS, msg, data, true);
	}

	public static <T> R<T> createErrorResult(String code, String msg) {
		return new R<T>(code, msg, null, false);
	}

	public static R<Object> createCommonResult(String code, String msg, Object data) {
		return new R<Object>(code, msg, data, true);
	}
}
