package com.njcn.utils;


import com.njcn.pojo.advanced.EntityResultData;
import com.njcn.pojo.advanced.EnumCode;

public class UtilPackageData {
	public static <T> EntityResultData<T> success(T object) {
		EntityResultData<T> entityResultData = new EntityResultData<T>();
		entityResultData.setCode(EnumCode.SUCCESS.getCode());
		entityResultData.setDescription(EnumCode.SUCCESS.getDescription());
		entityResultData.setObject(object);
		return entityResultData;
	}

	public static <T> EntityResultData<T> abnormal(Integer code, String description, T object) {
		EntityResultData<T> entityResultData = new EntityResultData<>();
		entityResultData.setCode(code);
		entityResultData.setDescription(description);
		entityResultData.setObject(object);
		return entityResultData;
	}
}
