first commit
This commit is contained in:
@ -63,4 +63,9 @@ public class BaseConstant {
|
||||
* 处理失败 个数 0
|
||||
*/
|
||||
public static final Integer HANDLE_ERROR = 0;
|
||||
|
||||
/**
|
||||
* 租户 key 前缀
|
||||
*/
|
||||
public static final String TENANT_KEY_PREFIX = "tenant_";
|
||||
}
|
||||
|
@ -14,4 +14,38 @@ public class ConfigConstant {
|
||||
*/
|
||||
public static final String SYS_CONFIG_KEY_PREFIX = "sys_config:";
|
||||
|
||||
/**
|
||||
* 参数配置-Token有效期
|
||||
*/
|
||||
public static final String TOKEN_EXPIRE_TIME_KEY = SYS_CONFIG_KEY_PREFIX + "sys.token.expireTime";
|
||||
|
||||
/**
|
||||
* 参数配置-允许同时在线
|
||||
*/
|
||||
public static final String ALLOW_BOTH_ONLINE_KEY = SYS_CONFIG_KEY_PREFIX + "sys.account.allowBothOnline";
|
||||
|
||||
/**
|
||||
* 参数配置-系统注册开关
|
||||
*/
|
||||
public static final String REGISTER_ON_OFF_KEY = SYS_CONFIG_KEY_PREFIX + "sys.account.registerUser";
|
||||
|
||||
/**
|
||||
* 参数配置-验证码开关
|
||||
*/
|
||||
public static final String CAPTCHA_ON_OFF_KEY = SYS_CONFIG_KEY_PREFIX + "sys.account.captchaOnOff";
|
||||
|
||||
/**
|
||||
* 参数配置-黑名单开关
|
||||
*/
|
||||
public static final String BLACKLIST_ON_OFF_KEY = SYS_CONFIG_KEY_PREFIX + "sys.account.blacklistOnOff";
|
||||
|
||||
/**
|
||||
* 开
|
||||
*/
|
||||
public static final String COMMON_ON_VALUE = "true";
|
||||
|
||||
/**
|
||||
* 关
|
||||
*/
|
||||
public static final String COMMON_OFF_VALUE = "false";
|
||||
}
|
||||
|
@ -0,0 +1,71 @@
|
||||
package com.qiaoba.common.base.entity;
|
||||
|
||||
import cn.hutool.http.HttpStatus;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 基础分页封装对象
|
||||
*
|
||||
* @author ailanyin
|
||||
* @version 1.0
|
||||
* @since 2023-04-23 15:37:43
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public class BasePage<T> implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 总记录数
|
||||
*/
|
||||
public long total;
|
||||
|
||||
/**
|
||||
* 列表数据
|
||||
*/
|
||||
public List<T> rows;
|
||||
|
||||
/**
|
||||
* 消息状态码
|
||||
*/
|
||||
public int code;
|
||||
|
||||
/**
|
||||
* 消息内容
|
||||
*/
|
||||
public String msg;
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*
|
||||
* @param list 列表数据
|
||||
* @param total 总记录数
|
||||
*/
|
||||
public BasePage(List<T> list, long total) {
|
||||
this.rows = list;
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
|
||||
public static <T> BasePage<T> build(List<T> list) {
|
||||
BasePage<T> basePage = new BasePage<>();
|
||||
basePage.setCode(HttpStatus.HTTP_OK);
|
||||
basePage.setMsg("查询成功");
|
||||
basePage.setRows(list);
|
||||
basePage.setTotal(list.size());
|
||||
return basePage;
|
||||
}
|
||||
|
||||
public static <T> BasePage<T> build() {
|
||||
BasePage<T> basePage = new BasePage<>();
|
||||
basePage.setCode(HttpStatus.HTTP_OK);
|
||||
basePage.setMsg("查询成功");
|
||||
return basePage;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user