wip: 通知公告开发临时提交
通知公告开发临时提交
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package com.youlai.boot.common.enums;
|
||||
|
||||
import com.youlai.boot.common.base.IBaseEnum;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* 通知类型枚举
|
||||
* 1-系统通知 0-系统消息
|
||||
*
|
||||
* @since 2024-9-1 17:33:06
|
||||
* @author Theo
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum NoticeTypeEnum implements IBaseEnum<Integer> {
|
||||
|
||||
SYSTEM_NOTICE(1, "系统通知"),
|
||||
SYSTEM_MESSAGE (0, "系统消息");
|
||||
|
||||
@Getter
|
||||
private Integer value;
|
||||
|
||||
@Getter
|
||||
private String label;
|
||||
|
||||
NoticeTypeEnum(Integer value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
||||
63
src/main/java/com/youlai/boot/common/util/CommonUtil.java
Normal file
63
src/main/java/com/youlai/boot/common/util/CommonUtil.java
Normal file
@@ -0,0 +1,63 @@
|
||||
package com.youlai.boot.common.util;
|
||||
|
||||
import com.youlai.boot.common.constant.SymbolConstant;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 通用工具类
|
||||
*
|
||||
* @author Theo
|
||||
* @since 2024-9-1 23:42:33
|
||||
* @version 1.0.0
|
||||
*/
|
||||
public class CommonUtil {
|
||||
|
||||
private CommonUtil(){}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 将List转换为字符串
|
||||
*
|
||||
* @param list List
|
||||
* @param separator 分隔符
|
||||
* @return 字符串
|
||||
*/
|
||||
public static String listToStr(List<String> list, String separator) {
|
||||
return list.stream().collect(Collectors.joining(separator));
|
||||
}
|
||||
|
||||
/**
|
||||
* 将字符串转换为List
|
||||
*
|
||||
* @param list List
|
||||
* @return List
|
||||
*/
|
||||
public static String listToStr(List<String> list) {
|
||||
return listToStr(list, SymbolConstant.COMMA);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将字符串转换为List
|
||||
*
|
||||
* @param str 字符串
|
||||
* @return List
|
||||
*/
|
||||
public static List<String> strToList(String str) {
|
||||
return strToList(str, SymbolConstant.COMMA);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将字符串转换为List
|
||||
*
|
||||
* @param str 字符串
|
||||
* @param separator 分隔符
|
||||
* @return List
|
||||
*/
|
||||
public static List<String> strToList(String str, String separator) {
|
||||
return List.of(str.split(separator));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user