Commit 64885d5c by songxiang

大老板的紧急需求

parent f89670d4
...@@ -14,7 +14,8 @@ public enum RoleCodeEnum { ...@@ -14,7 +14,8 @@ public enum RoleCodeEnum {
merchant("merchant"), // 商户 merchant("merchant"), // 商户
channel("channel"), // 渠道 channel("channel"), // 渠道
agent("agent"), // 代理 agent("agent"), // 代理
adviser("adviser"); // 顾问 adviser("adviser"), // 顾问
platform("platform"); // 平台
/** /**
* 值 * 值
......
...@@ -17,43 +17,63 @@ import com.pcloud.common.page.PageBeanNew; ...@@ -17,43 +17,63 @@ import com.pcloud.common.page.PageBeanNew;
*/ */
public class ResultUtils { public class ResultUtils {
/** /**
* 集合查询结果判断 * 单个对象实例化
* *
* @param lists * @param t
* @return * @param clazz
*/ * @return
public static <T> List<T> list(List<T> lists) { * @author songx
if (!ListUtils.isEmpty(lists)) { * @date 2019年1月14日,下午7:32:35
return lists; */
} public static <T> T object(T t, Class<T> clazz) {
return Lists.newArrayList(); if (t == null) {
} return null;
}
/** try {
* map查询结果判断 return clazz.newInstance();
* } catch (Exception e) {
* @param lists }
* @return return null;
*/ }
public static <K, V> Map<K, V> map(Map<K, V> map) {
if (!MapUtils.isEmpty(map)) { /**
return map; * 集合查询结果判断
} *
return Maps.newHashMap(); * @param lists
} * @return
*/
/** public static <T> List<T> list(List<T> lists) {
* 分页查询结果判断 if (!ListUtils.isEmpty(lists)) {
* return lists;
* @param pageBeanNew }
* @return return Lists.newArrayList();
*/ }
public static <T> PageBeanNew<T> pageBeanNew(PageBeanNew<T> pageBeanNew, Integer currentPage, Integer numPerPage) {
if (pageBeanNew != null) { /**
return pageBeanNew; * map查询结果判断
} *
return new PageBeanNew<T>(currentPage, numPerPage, 0, Lists.newArrayList()); * @param lists
} * @return
*/
public static <K, V> Map<K, V> map(Map<K, V> map) {
if (!MapUtils.isEmpty(map)) {
return map;
}
return Maps.newHashMap();
}
/**
* 分页查询结果判断
*
* @param pageBeanNew
* @return
*/
public static <T> PageBeanNew<T> pageBeanNew(PageBeanNew<T> pageBeanNew, Integer currentPage, Integer numPerPage) {
if (pageBeanNew != null) {
return pageBeanNew;
}
return new PageBeanNew<T>(currentPage, numPerPage, 0, Lists.newArrayList());
}
} }
/**
*
*/
package com.pcloud.common.vo;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
/**
* VO父类
*
* @author:songx
* @date:2019年1月14日,下午8:53:01
*/
@JsonInclude(value = Include.NON_NULL)
public class BaseVO implements Serializable {
/**
*
*/
private static final long serialVersionUID = -5943734920212204836L;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment