增加c端登录

This commit is contained in:
menxipeng
2025-07-13 20:42:14 +08:00
commit 05403e3485
619 changed files with 66815 additions and 0 deletions

View File

@@ -0,0 +1,79 @@
package com.ruoyi.common.enums;
import org.apache.commons.lang3.StringUtils;
/**
* @author Administrator
*/
public enum Audio {
/**
* Specifies a WAVE file.
*/
WAVE(1, "WAVE", "wav"),
/**
* Specifies an AU file.
*/
AU(2, "AU", "au"),
/**
* Specifies an AIFF file.
*/
AIFF(3, "AIFF", "aif"),
/**
* Specifies an AIFF-C file.
*/
AIFF_C(4, "AIFF-C", "aifc"),
/**
* Specifies an SND file.
*/
SND(5, "SND", "snd"),
/**
* Specifies an MP3 file.
*/
MP3(6, "MP3", "mp3"),
/**
* Specifies an FLAC file.
*/
FLAC(7, "FLAC", "flac");
private int index;
private String type;
private String suffix;
Audio(int index, String type, String suffix) {
this.index = index;
this.type = type;
this.suffix = suffix;
}
public int index() {
return index;
}
public static int getIndex(String name) {
if (StringUtils.isBlank(name)) {
throw new RuntimeException("文件名称为空!");
}
name = StringUtils.substring(name, StringUtils.lastIndexOf(name, ".") + 1);
for (Audio audio : values()) {
if (StringUtils.equalsIgnoreCase(audio.suffix, name)) {
return audio.index;
}
}
return -1;
}
public static boolean isSupport(String name) {
if (StringUtils.isBlank(name)) {
throw new RuntimeException("文件名称为空!");
}
name = StringUtils.substring(name, StringUtils.lastIndexOf(name, ".") + 1);
for (Audio audio : values()) {
if (StringUtils.equalsIgnoreCase(audio.suffix, name)) {
return true;
}
}
return false;
}
}

View File

@@ -0,0 +1,20 @@
package com.ruoyi.common.enums;
/**
* 操作状态
*
* @author ruoyi
*
*/
public enum BusinessStatus
{
/**
* 成功
*/
SUCCESS,
/**
* 失败
*/
FAIL,
}

View File

@@ -0,0 +1,59 @@
package com.ruoyi.common.enums;
/**
* 业务操作类型
*
* @author ruoyi
*/
public enum BusinessType
{
/**
* 其它
*/
OTHER,
/**
* 新增
*/
INSERT,
/**
* 修改
*/
UPDATE,
/**
* 删除
*/
DELETE,
/**
* 授权
*/
GRANT,
/**
* 导出
*/
EXPORT,
/**
* 导入
*/
IMPORT,
/**
* 强退
*/
FORCE,
/**
* 生成代码
*/
GENCODE,
/**
* 清空数据
*/
CLEAN,
}

View File

@@ -0,0 +1,19 @@
package com.ruoyi.common.enums;
/**
* 数据源
*
* @author ruoyi
*/
public enum DataSourceType
{
/**
* 主库
*/
MASTER,
/**
* 从库
*/
SLAVE
}

View File

@@ -0,0 +1,59 @@
package com.ruoyi.common.enums;
import java.util.function.Function;
import com.ruoyi.common.utils.DesensitizedUtil;
/**
* 脱敏类型
*
* @author ruoyi
*/
public enum DesensitizedType
{
/**
* 姓名第2位星号替换
*/
USERNAME(s -> s.replaceAll("(\\S)\\S(\\S*)", "$1*$2")),
/**
* 密码,全部字符都用*代替
*/
PASSWORD(DesensitizedUtil::password),
/**
* 身份证中间10位星号替换
*/
ID_CARD(s -> s.replaceAll("(\\d{4})\\d{10}(\\d{3}[Xx]|\\d{4})", "$1** **** ****$2")),
/**
* 手机号中间4位星号替换
*/
PHONE(s -> s.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2")),
/**
* 电子邮箱,仅显示第一个字母和@后面的地址显示,其他星号替换
*/
EMAIL(s -> s.replaceAll("(^.)[^@]*(@.*$)", "$1****$2")),
/**
* 银行卡号保留最后4位其他星号替换
*/
BANK_CARD(s -> s.replaceAll("\\d{15}(\\d{3})", "**** **** **** **** $1")),
/**
* 车牌号码,包含普通车辆、新能源车辆
*/
CAR_LICENSE(DesensitizedUtil::carLicense);
private final Function<String, String> desensitizer;
DesensitizedType(Function<String, String> desensitizer)
{
this.desensitizer = desensitizer;
}
public Function<String, String> desensitizer()
{
return desensitizer;
}
}

View File

@@ -0,0 +1,36 @@
package com.ruoyi.common.enums;
import java.util.HashMap;
import java.util.Map;
import org.springframework.lang.Nullable;
/**
* 请求方式
*
* @author ruoyi
*/
public enum HttpMethod
{
GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE;
private static final Map<String, HttpMethod> mappings = new HashMap<>(16);
static
{
for (HttpMethod httpMethod : values())
{
mappings.put(httpMethod.name(), httpMethod);
}
}
@Nullable
public static HttpMethod resolve(@Nullable String method)
{
return (method != null ? mappings.get(method) : null);
}
public boolean matches(String method)
{
return (this == resolve(method));
}
}

View File

@@ -0,0 +1,20 @@
package com.ruoyi.common.enums;
/**
* 限流类型
*
* @author ruoyi
*/
public enum LimitType
{
/**
* 默认策略全局限流
*/
DEFAULT,
/**
* 根据请求者IP进行限流
*/
IP
}

View File

@@ -0,0 +1,24 @@
package com.ruoyi.common.enums;
/**
* 操作人类别
*
* @author ruoyi
*/
public enum OperatorType
{
/**
* 其它
*/
OTHER,
/**
* 后台用户
*/
MANAGE,
/**
* 手机端用户
*/
MOBILE
}

View File

@@ -0,0 +1,30 @@
package com.ruoyi.common.enums;
/**
* 用户状态
*
* @author ruoyi
*/
public enum UserStatus
{
OK("0", "正常"), DISABLE("1", "停用"), DELETED("2", "删除");
private final String code;
private final String info;
UserStatus(String code, String info)
{
this.code = code;
this.info = info;
}
public String getCode()
{
return code;
}
public String getInfo()
{
return info;
}
}