parent
118fc413d3
commit
d5ad605b35
@ -0,0 +1,46 @@
|
||||
package cn.teammodel.common;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author winter
|
||||
* @create 2024-02-01 15:30
|
||||
*/
|
||||
|
||||
public enum ChatAppScopeEnum {
|
||||
PUBLIC("public", "公共"),
|
||||
SCHOOL("school", "学校"),
|
||||
PRIVATE("private", "私人");
|
||||
private final String code;
|
||||
private final String name;
|
||||
public static List<String> codes() {
|
||||
return Arrays.stream(values()).map(ChatAppScopeEnum::getCode).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 name 获取 code
|
||||
*/
|
||||
public static String getCodeByName(String name) {
|
||||
ChatAppScopeEnum chatAppScopeEnum = Arrays.stream(values()).filter(item -> item.getName().equals(name)).findFirst().orElse(null);
|
||||
String res = null;
|
||||
if (chatAppScopeEnum != null) {
|
||||
res = chatAppScopeEnum.getCode();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
ChatAppScopeEnum(String code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package cn.teammodel.model.dto.ai;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* @author winter
|
||||
* @create 2024-02-01 15:40
|
||||
*/
|
||||
@Data
|
||||
public class SearchAppDto {
|
||||
@NotBlank(message = "scope不能为空")
|
||||
private String scope;
|
||||
private String bizType;
|
||||
private String lang;
|
||||
private String itemType;;
|
||||
private String period;
|
||||
private String subject;
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package cn.teammodel.utils;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* @author winter
|
||||
* @create 2024-02-01 16:18
|
||||
*/
|
||||
public class StrUtil {
|
||||
public static String blankToNull(String str) {
|
||||
return StringUtils.isBlank(str) ? null : str;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue