后端基础框架
This commit is contained in:
commit
b964b54fc6
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/mvnw text eol=lf
|
||||
*.cmd text eol=crlf
|
||||
33
.gitignore
vendored
Normal file
33
.gitignore
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
HELP.md
|
||||
target/
|
||||
.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
3
.mvn/wrapper/maven-wrapper.properties
vendored
Normal file
3
.mvn/wrapper/maven-wrapper.properties
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
wrapperVersion=3.3.4
|
||||
distributionType=only-script
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.12/apache-maven-3.9.12-bin.zip
|
||||
85
api-service/pom.xml
Normal file
85
api-service/pom.xml
Normal file
@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>oailab.com</groupId>
|
||||
<artifactId>ai-base</artifactId>
|
||||
<version>${revision}</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>api-service</artifactId>
|
||||
<version>${revision}</version>
|
||||
<name>api-service</name>
|
||||
<description>api-service</description>
|
||||
<url/>
|
||||
<licenses>
|
||||
<license/>
|
||||
</licenses>
|
||||
<developers>
|
||||
<developer/>
|
||||
</developers>
|
||||
<scm>
|
||||
<connection/>
|
||||
<developerConnection/>
|
||||
<tag/>
|
||||
<url/>
|
||||
</scm>
|
||||
<properties>
|
||||
<java.version>21</java.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-batch</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>21</source>
|
||||
<target>21</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@ -0,0 +1,22 @@
|
||||
package oailab.com.apiservice.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* skip login validation annotation
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
* @version 1.0
|
||||
**/
|
||||
@Target({ElementType.METHOD, ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface PassToken {
|
||||
|
||||
boolean required() default true;
|
||||
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package oailab.com.apiservice.annotation;
|
||||
|
||||
|
||||
import oailab.com.apiservice.enums.sys.SearchConditionEnum;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* search parameter annotation
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
* @version 1.0
|
||||
**/
|
||||
@Target(ElementType.FIELD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface SearchParam {
|
||||
|
||||
/**
|
||||
* 字段名称
|
||||
*/
|
||||
String[] name();
|
||||
|
||||
/**
|
||||
* 执行条件
|
||||
*/
|
||||
SearchConditionEnum[] condition();
|
||||
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
package oailab.com.apiservice.config;
|
||||
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import org.springframework.batch.core.configuration.support.DefaultBatchConfiguration;
|
||||
import org.springframework.batch.core.repository.JobRepository;
|
||||
import org.springframework.batch.core.repository.support.JobRepositoryFactoryBean;
|
||||
import org.springframework.batch.support.DatabaseType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* Spring Batch configuration for KingbaseES support
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @since 11/12/25
|
||||
* @version 1.0
|
||||
*/
|
||||
@Configuration
|
||||
public class BatchConfig extends DefaultBatchConfiguration {
|
||||
|
||||
@Autowired
|
||||
private DataSource dataSource;
|
||||
|
||||
@Autowired
|
||||
private PlatformTransactionManager transactionManager;
|
||||
|
||||
/**
|
||||
* Override job repository creation to support KingbaseES
|
||||
*/
|
||||
@Bean
|
||||
@Override
|
||||
public JobRepository jobRepository() {
|
||||
JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean();
|
||||
factory.setDataSource(dataSource);
|
||||
factory.setTransactionManager(transactionManager);
|
||||
factory.setDatabaseType(getDatabaseType());
|
||||
factory.setIsolationLevelForCreate("ISOLATION_DEFAULT");
|
||||
factory.setTablePrefix("BATCH_");
|
||||
factory.setMaxVarCharLength(1000);
|
||||
try {
|
||||
factory.afterPropertiesSet();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
try {
|
||||
return factory.getObject();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get database type with KingbaseES support
|
||||
*/
|
||||
@NotNull
|
||||
public String getDatabaseType() {
|
||||
try (Connection connection = dataSource.getConnection()) {
|
||||
DatabaseMetaData metaData = connection.getMetaData();
|
||||
String databaseProductName = metaData.getDatabaseProductName();
|
||||
|
||||
if (databaseProductName.toLowerCase().contains("mysql")) {
|
||||
return DatabaseType.MYSQL.getProductName();
|
||||
} else if (databaseProductName.toLowerCase().contains("kingbase")) {
|
||||
// Use MySQL dialect for KingbaseES since they are compatible
|
||||
return DatabaseType.MYSQL.getProductName();
|
||||
} else if (databaseProductName.toLowerCase().contains("postgresql")) {
|
||||
return DatabaseType.POSTGRES.getProductName();
|
||||
} else {
|
||||
// Default to MySQL
|
||||
return DatabaseType.MYSQL.getProductName();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
// Default to MySQL on error
|
||||
return DatabaseType.MYSQL.getProductName();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package oailab.com.apiservice.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
/**
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 10/22/24
|
||||
**/
|
||||
@Configuration
|
||||
public class ExecutorConfig {
|
||||
@Bean
|
||||
public ExecutorService executorService() {
|
||||
return Executors.newFixedThreadPool(10);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package oailab.com.apiservice.config;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONWriter;
|
||||
import org.springframework.data.redis.serializer.RedisSerializer;
|
||||
import org.springframework.data.redis.serializer.SerializationException;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/**
|
||||
* Redis serialization by fastjson
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
**/
|
||||
public class FastJson2JsonRedisSerializer<T> implements RedisSerializer<T> {
|
||||
|
||||
public static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8;
|
||||
|
||||
private final Class<T> clazz;
|
||||
|
||||
public FastJson2JsonRedisSerializer(Class<T> clazz) {
|
||||
super();
|
||||
this.clazz = clazz;
|
||||
}
|
||||
|
||||
/**
|
||||
* 序列化
|
||||
*/
|
||||
@Override
|
||||
public byte[] serialize(T t) throws SerializationException {
|
||||
if (null == t) {
|
||||
return new byte[0];
|
||||
}
|
||||
|
||||
return JSON.toJSONString(t, JSONWriter.Feature.WriteClassName).getBytes(DEFAULT_CHARSET);
|
||||
}
|
||||
|
||||
/**
|
||||
* 反序列化
|
||||
*/
|
||||
@Override
|
||||
public T deserialize(byte[] bytes) throws SerializationException {
|
||||
if (null == bytes || bytes.length == 0) {
|
||||
return null;
|
||||
}
|
||||
String str = new String(bytes, DEFAULT_CHARSET);
|
||||
try {
|
||||
return JSON.parseObject(str, clazz);
|
||||
} catch (Exception e) {
|
||||
return (T) str;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,83 @@
|
||||
package oailab.com.apiservice.config;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.DbType;
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.BlockAttackInnerInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||
import org.apache.ibatis.mapping.DatabaseIdProvider;
|
||||
import org.apache.ibatis.mapping.VendorDatabaseIdProvider;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* MyBatis Plus configuration
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
* @version 1.0
|
||||
**/
|
||||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
@MapperScan(basePackages = "oailab.com.apiservice.mybatis.mapper")
|
||||
public class MybatisPlusConfig {
|
||||
|
||||
@Bean
|
||||
public MybatisPlusInterceptor mybatisPlusInterceptor(DataSource dataSource) {
|
||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||
// 乐观锁插件
|
||||
interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());
|
||||
// 分页插件,根据数据库类型自动适配
|
||||
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(getDbType(dataSource)));
|
||||
// 防全表更新与删除插件
|
||||
interceptor.addInnerInterceptor(new BlockAttackInnerInterceptor());
|
||||
return interceptor;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据数据源判断数据库类型
|
||||
* @param dataSource 数据源
|
||||
* @return 数据库类型
|
||||
*/
|
||||
private DbType getDbType(DataSource dataSource) {
|
||||
try (Connection connection = dataSource.getConnection()) {
|
||||
DatabaseMetaData metaData = connection.getMetaData();
|
||||
String databaseProductName = metaData.getDatabaseProductName();
|
||||
|
||||
if (databaseProductName.toLowerCase().contains("mysql")) {
|
||||
return DbType.MYSQL;
|
||||
} else if (databaseProductName.toLowerCase().contains("kingbase")) {
|
||||
return DbType.KINGBASE_ES;
|
||||
} else {
|
||||
// 默认使用MySQL方言
|
||||
return DbType.MYSQL;
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
// 默认使用MySQL方言
|
||||
return DbType.MYSQL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置databaseIdProvider以支持多数据库
|
||||
* @return DatabaseIdProvider
|
||||
*/
|
||||
@Bean
|
||||
public DatabaseIdProvider databaseIdProvider() {
|
||||
VendorDatabaseIdProvider databaseIdProvider = new VendorDatabaseIdProvider();
|
||||
Properties properties = new Properties();
|
||||
properties.setProperty("MySQL", "mysql");
|
||||
properties.setProperty("KingbaseES", "kingbase");
|
||||
databaseIdProvider.setProperties(properties);
|
||||
return databaseIdProvider;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package oailab.com.apiservice.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
|
||||
/**
|
||||
* Redis configuration
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
**/
|
||||
@Configuration
|
||||
public class RedisConfig {
|
||||
|
||||
@Bean
|
||||
public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory factory) {
|
||||
RedisTemplate<Object, Object> template = new RedisTemplate<>();
|
||||
template.setConnectionFactory(factory);
|
||||
FastJson2JsonRedisSerializer<Object> fastJsonRedisSerializer = new FastJson2JsonRedisSerializer<>(Object.class);
|
||||
|
||||
StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
|
||||
// key采用String的序列化方式
|
||||
template.setKeySerializer(stringRedisSerializer);
|
||||
// hash的key也采用String的序列化方式
|
||||
template.setHashKeySerializer(stringRedisSerializer);
|
||||
|
||||
// value序列化方式采用fastJson
|
||||
template.setValueSerializer(fastJsonRedisSerializer);
|
||||
// hash的value序列化方式采用fastJson
|
||||
template.setHashValueSerializer(fastJsonRedisSerializer);
|
||||
|
||||
template.afterPropertiesSet();
|
||||
return template;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package oailab.com.apiservice.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.security.web.SecurityFilterChain;
|
||||
|
||||
/**
|
||||
* Security configuration
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
* @version 1.0
|
||||
**/
|
||||
@Configuration
|
||||
@EnableWebSecurity
|
||||
public class SecurityConfig {
|
||||
|
||||
@Bean
|
||||
public BCryptPasswordEncoder passwordEncoder() {
|
||||
return new BCryptPasswordEncoder();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||
http
|
||||
.csrf(AbstractHttpConfigurer::disable)
|
||||
.authorizeHttpRequests((authorizeHttpRequests)->authorizeHttpRequests.anyRequest().permitAll());
|
||||
return http.build();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,113 @@
|
||||
package oailab.com.apiservice.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 系统配置文件
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 9/4/24
|
||||
**/
|
||||
@Component
|
||||
@Data
|
||||
public class SysConfig {
|
||||
|
||||
@Value("${sys.secret-key}")
|
||||
private String secretKey;
|
||||
|
||||
/**
|
||||
* API 地址
|
||||
*/
|
||||
@Value("${sys.console-api-url}")
|
||||
private String consoleApiUrl;
|
||||
@Value("${sys.console-web-url}")
|
||||
private String consoleWebUrl;
|
||||
|
||||
/**
|
||||
* 模型
|
||||
*/
|
||||
@Value("${sys.multimodal-send-image-format}")
|
||||
private String multimodalSendImageFormat;
|
||||
|
||||
/**
|
||||
* 文件
|
||||
*/
|
||||
@Value("${sys.files-url}")
|
||||
private String filesUrl;
|
||||
|
||||
/**
|
||||
* 存储
|
||||
*/
|
||||
@Value("${sys.storage-type}")
|
||||
private String storageType;
|
||||
@Value("${sys.storage-local-path}")
|
||||
private String storageLocalPath;
|
||||
|
||||
// Aliyun oss
|
||||
@Value("${sys.aliyun-oss-bucket-name}")
|
||||
private String aliyunOssBucketName;
|
||||
@Value("${sys.aliyun-oss-access-key}")
|
||||
private String aliyunOssAccessKey;
|
||||
@Value("${sys.aliyun-oss-secret-key}")
|
||||
private String aliyunOssSecretKey;
|
||||
@Value("${sys.aliyun-oss-endpoint}")
|
||||
private String aliyunOssEndpoint;
|
||||
@Value("${sys.aliyun-oss-auth-version}")
|
||||
private String aliyunOssAuthVersion;
|
||||
@Value("${sys.aliyun-oss-region}")
|
||||
private String aliyunOssRegion;
|
||||
|
||||
/**
|
||||
* 上传
|
||||
*/
|
||||
@Value("${upload.upload-file-size-limit}")
|
||||
private Integer uploadFileSizeLimit;
|
||||
@Value("${upload.upload-image-file-size-limit}")
|
||||
private Integer uploadImageFileSizeLimit;
|
||||
|
||||
/**
|
||||
* 向量数据库
|
||||
*/
|
||||
// @Value("${vector.store}")
|
||||
// private String vectorStore;
|
||||
|
||||
// weaviate
|
||||
// @Value("${vector.weaviate.endpoint}")
|
||||
// private String weaviateEndpoint;
|
||||
// @Value("${vector.weaviate.api_key}")
|
||||
// private String weaviateApiKey;
|
||||
// @Value("${vector.weaviate.grpc_enabled}")
|
||||
// private Boolean weaviateGrpcEnabled;
|
||||
// @Value("${vector.weaviate.batch_size}")
|
||||
// private Integer weaviateBatchSize;
|
||||
|
||||
/**
|
||||
* OAI大模型接口参数
|
||||
*/
|
||||
// @Value("${sys.oai.api_key.ai_writting}")
|
||||
// private String oaiApiKeyAiWritting;
|
||||
// @Value("${sys.oai.api_key.ai_outline}")
|
||||
// private String oaiApiKeyAiOutline;
|
||||
// @Value("${sys.oai.api_key.ai_polishing}")
|
||||
// private String oaiApiKeyAiPolishing;
|
||||
// @Value("${sys.oai.api_key.ai_checking}")
|
||||
// private String oaiApiKeyAiChecking;
|
||||
// @Value("${sys.oai.api_key.ai_evaluating}")
|
||||
// private String oaiApiKeyAiEvaluating;
|
||||
// // @Value("${sys.oai.url}")
|
||||
//// private String oaiUrl;
|
||||
// @Value("${sys.oai.timeout}")
|
||||
// private Long oaiTimeout;
|
||||
// @Value("${sys.oai.response_mode}")
|
||||
// private String oaiResponseMode;
|
||||
// @Value("${sys.oai.customize_word_libary_url}")
|
||||
// private String customizeWordLibaryURL;
|
||||
// @Value("${sys.oai.agent_url}")
|
||||
// private String agentUrl;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package oailab.com.apiservice.constants;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Login-related constants
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
**/
|
||||
@Data
|
||||
public class LoginConstants {
|
||||
|
||||
// 头部信息:token
|
||||
public static final String LOGIN_AUTHORIZATION = "Authorization";
|
||||
|
||||
// 头部信息:工作间ID
|
||||
public static final String HEADER_WORKSPACE_ID = "OAI-Workspace-Id";
|
||||
|
||||
// 系统登录,用户账号保存字段
|
||||
public static final String SYS_LOGIN_USER_ACCOUNT = "SYS_LOGIN_USER_ACCOUNT";
|
||||
|
||||
// web
|
||||
public static final String APP_CODE = "X-App-Code";
|
||||
public static final String WEB_LOGIN_USER_ACCOUNT = "WEB_LOGIN_USER_ACCOUNT";
|
||||
|
||||
// api
|
||||
public static final String API_APP_ID = "API_APP_ID";
|
||||
public static final String API_APP_TOKEN = "API_APP_TOKEN";
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package oailab.com.apiservice.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IEnum;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* enumeration base
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
* @version 1.0
|
||||
**/
|
||||
public interface BaseEnum<T extends Serializable> extends IEnum<T> {
|
||||
|
||||
@Override
|
||||
T getValue();
|
||||
|
||||
String getDesc();
|
||||
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package oailab.com.apiservice.enums.account;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import oailab.com.apiservice.enums.BaseEnum;
|
||||
|
||||
|
||||
/**
|
||||
* AccountStatusEnum
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 9/24/24
|
||||
**/
|
||||
public enum AccountRoleEnum implements BaseEnum<Integer> {
|
||||
|
||||
USER(0, "user"),
|
||||
ADMIN(1, "admin"),
|
||||
VIP(2, "vip"),
|
||||
;
|
||||
|
||||
AccountRoleEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
private String getName() {
|
||||
return this.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static AccountRoleEnum create(Object code) {
|
||||
return AccountRoleEnum.valueOf((String) code);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package oailab.com.apiservice.enums.account;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import oailab.com.apiservice.enums.BaseEnum;
|
||||
|
||||
|
||||
/**
|
||||
* AccountStatusEnum
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 9/24/24
|
||||
**/
|
||||
public enum AccountStatusEnum implements BaseEnum<Integer> {
|
||||
|
||||
PENDING(0, "pending"),
|
||||
UNINITIALIZED(1, "uninitialized"),
|
||||
ACTIVE(2, "active"),
|
||||
BANNED(3, "banned"),
|
||||
CLOSED(4, "banned"),
|
||||
;
|
||||
|
||||
AccountStatusEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
private String getName() {
|
||||
return this.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static AccountStatusEnum create(Object code) {
|
||||
return AccountStatusEnum.valueOf((String) code);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package oailab.com.apiservice.enums.common;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName EnumOutput
|
||||
* @Description 枚举输出
|
||||
* @Author bianmaren
|
||||
* @blog 编码人
|
||||
* @date 2023/8/25 12:03
|
||||
* @Version 1.0
|
||||
**/
|
||||
@Data
|
||||
public class EnumOutput {
|
||||
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
private Integer value;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package oailab.com.apiservice.enums.extensions;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import oailab.com.apiservice.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* StorageTypeEnum
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 9/4/24
|
||||
**/
|
||||
public enum StorageTypeEnum implements BaseEnum<Integer> {
|
||||
|
||||
LOCAL(0, "local"),
|
||||
ALIYUN_OSS(1, "aliyun-oss"),
|
||||
TENCENT_COS(2, "tencent-cos"),
|
||||
;
|
||||
|
||||
StorageTypeEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
private String getName() {
|
||||
return this.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static StorageTypeEnum create(Object code) {
|
||||
return StorageTypeEnum.valueOf((String) code);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
package oailab.com.apiservice.enums.license;
|
||||
|
||||
// 部署类型枚举
|
||||
public enum LicenseDeploymentType {
|
||||
ONLINE, // 线上部署(SaaS)
|
||||
ON_PREMISE // 本地部署(私有化)
|
||||
;
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
package oailab.com.apiservice.enums.mail;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import oailab.com.apiservice.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* MailTypeEnum
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 9/24/24
|
||||
**/
|
||||
public enum MailTypeEnum implements BaseEnum<Integer> {
|
||||
|
||||
DEFAULT(0, "default"),
|
||||
ALIYUN_MAIL_PUSH(1, "aliyun-mail-push"),
|
||||
;
|
||||
|
||||
MailTypeEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
private String getName() {
|
||||
return this.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static MailTypeEnum create(Object code) {
|
||||
return MailTypeEnum.valueOf((String) code);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package oailab.com.apiservice.enums.provider;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import oailab.com.apiservice.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* Quota type enumeration
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
* @version 1.0
|
||||
**/
|
||||
public enum ProviderQuotaTypeEnum implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
PAID(0, "paid"),
|
||||
FREE(1, "free"),
|
||||
TRIAL(2, "trial"),
|
||||
;
|
||||
|
||||
ProviderQuotaTypeEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
private String getName(){
|
||||
return this.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static ProviderQuotaTypeEnum create(Object code) {
|
||||
return ProviderQuotaTypeEnum.valueOf((String) code);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package oailab.com.apiservice.enums.provider;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import oailab.com.apiservice.enums.BaseEnum;
|
||||
|
||||
|
||||
/**
|
||||
* Model supplier type enumeration
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
**/
|
||||
public enum ProviderTypeEnum implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
CUSTOM(0, "custom"),
|
||||
SYSTEM(1, "system"),
|
||||
;
|
||||
|
||||
ProviderTypeEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
private String getName() {
|
||||
return this.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static ProviderTypeEnum create(Object code) {
|
||||
return ProviderTypeEnum.valueOf((String) code);
|
||||
}
|
||||
|
||||
public static ProviderTypeEnum getByDesc(String desc) {
|
||||
for (ProviderTypeEnum type : values()) {
|
||||
if (type.getDesc().equals(desc)) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,122 @@
|
||||
package oailab.com.apiservice.enums.sys;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import oailab.com.apiservice.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* Error message enumeration
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
**/
|
||||
public enum ErrorCodeEnum implements BaseEnum<Integer> {
|
||||
|
||||
Success(0, "Operation successful"),
|
||||
Fail(1, "Operation failed"),
|
||||
AccountDoesNotExist(10001, "Account does not exist"),
|
||||
PasswordError(10002, "Password incorrect"),
|
||||
RecordNotExist(10003, "Record does not exist"),
|
||||
PasswordInconsistency(10004, "Passwords do not match"),
|
||||
Timeout(10005, "Timeout"),
|
||||
ValueError(10006, "Value error"),
|
||||
Unauthorized(10007, "Unauthorized"),
|
||||
AccountStatusUnavailable(10008, "Account status unavailable"),
|
||||
NoPermission(10009, "No permission"),
|
||||
InvalidURL(10010, "Invalid URL"),
|
||||
TheReturnValueIsEmpty(10011, "The return value is empty"),
|
||||
AccountAlreadyExists(10012, "账户已存在!"),
|
||||
|
||||
TokenIsNull(20001, "Login invalid"),
|
||||
AuthTokenInvalid(20002, "Login invalid"),
|
||||
UnauthorizedOperation(20003, "No permission"),
|
||||
WorkspaceNotFound(20004, "Workspace not found"),
|
||||
ModelConfigurationFileMissing(20005, "Model configuration file missing"),
|
||||
UnsupportedResponseMode(20006, "Unsupported response mode"),
|
||||
AppNotExist(20007, "Application does not exist"),
|
||||
DatasetNotExist(20008, "Dataset does not exist"),
|
||||
ModelConfigError(20009, "Model config error"),
|
||||
AppNotFound(20010, "App not found"),
|
||||
FileNotExist(20011, "File does not exist"),
|
||||
DatasetRuleNotExist(20012, "Dataset rule does not exist"),
|
||||
NoFileUploadedError(20013, "No file uploaded"),
|
||||
UnsupportedFileTypeError(20014, "Unsupported file type"),
|
||||
FileTooLargeError(20015, "File too large"),
|
||||
FileUploadFail(20016, "File upload fail"),
|
||||
MailPushFail(20017, "Mail push fail"),
|
||||
EmailRegistered(20018, "Email registered"),
|
||||
VerificationCodeError(20019, "Verification code error"),
|
||||
InvitationHasExpired(20020, "Invitation has expired"),
|
||||
InvitationPersonNotMatch(20021, "The invited person does not match the current login account"),
|
||||
AlreadyInWorkspace(20022, "Already in this workspace"),
|
||||
InvalidNameLength(20023, "Name must be between 1 to 40 characters."),
|
||||
InvalidDescriptionLength(20024, "Description cannot exceed 400 characters."),
|
||||
ToolsNameAlreadyExists(20025, "Tools name already exists."),
|
||||
ToolApiSchemaError(20026, "Invalid api schema."),
|
||||
|
||||
// LLM exceptions.
|
||||
InvokeConnectionError(30001, "Connection Error"),
|
||||
InvokeServerUnavailableError(30002, "Server Unavailable Error"),
|
||||
InvokeRateLimitError(30003, "Rate Limit Error"),
|
||||
InvokeAuthorizationError(30004, "Incorrect model credentials provided, please check and try again. "),
|
||||
InvokeBadRequestError(30005, "Bad Request Error"),
|
||||
ConversationNotExistsError(30006, "Conversation not exists"),
|
||||
SuggestedQuestionsAfterAnswerDisabledError(30007, "Suggested questions after answer disabled"),
|
||||
ProviderTokenNotInitError(30008, "Provider token not init"),
|
||||
MessageNotExistsError(30009, "Message not exists"),
|
||||
AppModelConfigBrokenError(30010, "App model config broken"),
|
||||
QuotaExceededError(30011, "Quota exceeded error"),
|
||||
CredentialsValidateFailedError(30012, "Credentials validate failed"),
|
||||
ToolProviderNotFoundError(30013, "Tool provider not found"),
|
||||
NotImplementedError(30014, "Not implemented error"),
|
||||
NoApiKey(30015, "No api key"),
|
||||
InputRequired(30016, "Input required"),
|
||||
InvalidTimezone(30017, "Invalid timezone"),
|
||||
AgentChatAppDoesNotSupportBlockingMode(30018, "Agent Chat App does not support blocking mode"),
|
||||
QueryIsRequired(30019, "query is required"),
|
||||
DocumentContentIsEmpty(30020, " document content is empty"),
|
||||
UnSupportedFileType(30021, " unsupported file type"),
|
||||
|
||||
// 会员权益相关错误码(从40001开始,避免与现有冲突)
|
||||
BenefitNotExist(40001, "权益不存在"),
|
||||
BenefitNameDuplicate(40002, "权益名称已存在"),
|
||||
BenefitTypeInvalid(40003, "权益类型无效"),
|
||||
BenefitInUse(40004, "权益正在使用中,无法删除"),
|
||||
MemberPlanNotExist(40005, "会员套餐不存在"),
|
||||
MemberPlanNameDuplicate(40006, "会员套餐名称已存在"),
|
||||
MemberPlanTypeInvalid(40007, "会员套餐类型无效"),
|
||||
MemberPlanInUse(40008, "会员套餐正在使用中,无法删除"),
|
||||
MemberPlanFail(40009, "创建会员套餐失败"),
|
||||
MemberPlanValueError(40010, "会员套餐参数值错误"),
|
||||
MemberBenefitInvalid(40011, "无效的会员权益"), // 对应"无效的权益名称"
|
||||
MemberBenefitSaveFail(40012, "会员权益保存失败"), // 对应"权益保存失败"
|
||||
MemberPlanTypeDuplicate(40013,"会员套餐已存在"),
|
||||
MemberNotExist(40014, "会员不存在"),
|
||||
|
||||
;
|
||||
|
||||
|
||||
private final Integer code;
|
||||
private final String msg;
|
||||
|
||||
ErrorCodeEnum(Integer code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return this.msg;
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static ErrorCodeEnum create(Object code) {
|
||||
return ErrorCodeEnum.valueOf((String) code);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
package oailab.com.apiservice.enums.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import oailab.com.apiservice.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* Query condition enumeration
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
* @version 1.0
|
||||
**/
|
||||
public enum SearchConditionEnum implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 查询条件
|
||||
*/
|
||||
eq(0, "等于"),
|
||||
ne(1, "不等于"),
|
||||
like(2, "模糊匹配"),
|
||||
gt(3, "大于"),
|
||||
ge(4, "大于等于"),
|
||||
lt(5, "小于"),
|
||||
le(6, "小于等于");
|
||||
|
||||
SearchConditionEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonValue
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static SearchConditionEnum create(Object code) {
|
||||
return SearchConditionEnum.valueOf((String) code);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package oailab.com.apiservice.enums.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import oailab.com.apiservice.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* Tenant status enumeration
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
* @version 1.0
|
||||
**/
|
||||
public enum TenantStatusEnum implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 查询条件
|
||||
*/
|
||||
NORMAL(0, "normal"),
|
||||
DISABLED(1, "disabled"),
|
||||
EXPIRED(2, "expired"),
|
||||
;
|
||||
|
||||
TenantStatusEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
private String getName(){
|
||||
return this.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static TenantStatusEnum create(Object code) {
|
||||
return TenantStatusEnum.valueOf((String) code);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package oailab.com.apiservice.enums.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import oailab.com.apiservice.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* Workspace member role enumeration
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
* @version 1.0
|
||||
**/
|
||||
public enum WorkspaceRoleEnum implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 查询条件
|
||||
*/
|
||||
OWNER(0, "owner"),
|
||||
ADMIN(1, "admin"),
|
||||
MEMBER(2, "member"),
|
||||
EDITOR(3, "editor"),
|
||||
;
|
||||
|
||||
WorkspaceRoleEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
private String getName(){
|
||||
return this.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static WorkspaceRoleEnum create(Object code) {
|
||||
return WorkspaceRoleEnum.valueOf((String) code);
|
||||
}
|
||||
|
||||
public static WorkspaceRoleEnum getByDesc(String desc) {
|
||||
for (WorkspaceRoleEnum type : values()) {
|
||||
if (type.getDesc().equals(desc)) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package oailab.com.apiservice.enums.tools;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import oailab.com.apiservice.enums.BaseEnum;
|
||||
import oailab.com.apiservice.enums.provider.ProviderTypeEnum;
|
||||
|
||||
|
||||
/**
|
||||
* 变量值枚举
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 10/12/24
|
||||
**/
|
||||
public enum VariableKeyEnum implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
IMAGE(0, "image"),
|
||||
;
|
||||
|
||||
VariableKeyEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
private String getName() {
|
||||
return this.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static ProviderTypeEnum create(Object code) {
|
||||
return ProviderTypeEnum.valueOf((String) code);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package oailab.com.apiservice.enums.web;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import oailab.com.apiservice.enums.BaseEnum;
|
||||
import oailab.com.apiservice.enums.provider.ProviderTypeEnum;
|
||||
|
||||
|
||||
/**
|
||||
* CustomizeTokenStrategyEnum
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 8/19/24
|
||||
**/
|
||||
public enum CustomizeTokenStrategyEnum implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
MUST(0, "must"),
|
||||
ALLOW(1, "allow"),
|
||||
NOT_ALLOW(2, "not_allow"),
|
||||
;
|
||||
|
||||
CustomizeTokenStrategyEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
private String getName(){
|
||||
return this.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static ProviderTypeEnum create(Object code) {
|
||||
return ProviderTypeEnum.valueOf((String) code);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package oailab.com.apiservice.enums.web;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import oailab.com.apiservice.enums.BaseEnum;
|
||||
import oailab.com.apiservice.enums.provider.ProviderTypeEnum;
|
||||
|
||||
|
||||
/**
|
||||
* FromSourceEnum
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 8/19/24
|
||||
**/
|
||||
public enum FromSourceEnum implements BaseEnum<Integer> {
|
||||
|
||||
CONSOLE(0, "console"),
|
||||
API(1, "api"),
|
||||
;
|
||||
|
||||
FromSourceEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
private String getName(){
|
||||
return this.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static ProviderTypeEnum create(Object code) {
|
||||
return ProviderTypeEnum.valueOf((String) code);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package oailab.com.apiservice.enums.web;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import oailab.com.apiservice.enums.BaseEnum;
|
||||
import oailab.com.apiservice.enums.provider.ProviderTypeEnum;
|
||||
|
||||
|
||||
/**
|
||||
* SiteStatusEnum
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 8/19/24
|
||||
**/
|
||||
public enum SiteStatusEnum implements BaseEnum<Integer> {
|
||||
|
||||
NORMAL(0, "normal"),
|
||||
DISABLE(1, "disable"),
|
||||
;
|
||||
|
||||
SiteStatusEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
private String getName() {
|
||||
return this.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static ProviderTypeEnum create(Object code) {
|
||||
return ProviderTypeEnum.valueOf((String) code);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package oailab.com.apiservice.enums.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import oailab.com.apiservice.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* application mode enumeration
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
**/
|
||||
public enum AppModeEnum implements BaseEnum<Integer> {
|
||||
|
||||
CHAT(0, "chat"),
|
||||
ADVANCED_CHAT(1, "advanced-chat"),
|
||||
COMPLETION(2, "completion"),
|
||||
AGENT_CHAT(3, "agent-chat"),
|
||||
WORKFLOW(4, "workflow"),
|
||||
CHANNEL(5, "channel"),
|
||||
;
|
||||
|
||||
AppModeEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getName() {
|
||||
return this.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static AppModeEnum create(Object code) {
|
||||
return AppModeEnum.valueOf((String) code);
|
||||
}
|
||||
|
||||
public static AppModeEnum getByDesc(String desc) {
|
||||
for (AppModeEnum item : AppModeEnum.values()) {
|
||||
if (item.getDesc().equals(desc)) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package oailab.com.apiservice.enums.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import oailab.com.apiservice.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* application status enumeration
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
* @version 1.0
|
||||
**/
|
||||
public enum AppsStatusEnum implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
NORMAL(0, "normal"),
|
||||
DISABLE(1, "disable"),
|
||||
;
|
||||
|
||||
AppsStatusEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
private String getName(){
|
||||
return this.name();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static AppsStatusEnum create(Object code) {
|
||||
return AppsStatusEnum.valueOf((String) code);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package oailab.com.apiservice.enums.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import oailab.com.apiservice.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* ChatRoleEnum
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 8/6/24
|
||||
**/
|
||||
public enum ChatRoleEnum implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
USER(0, "user"),
|
||||
ASSISTANT(1, "assistant"),
|
||||
SYSTEM(1, "system"),
|
||||
;
|
||||
|
||||
ChatRoleEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
private String getName(){
|
||||
return this.name();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static ChatRoleEnum create(Object code) {
|
||||
return ChatRoleEnum.valueOf((String) code);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package oailab.com.apiservice.enums.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import oailab.com.apiservice.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* Status enumeration
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
**/
|
||||
public enum CommonStatusEnum implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
ACTIVE(0, "active"),
|
||||
DISABLE(1, "disable"),
|
||||
;
|
||||
|
||||
CommonStatusEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
private String getName() {
|
||||
return this.name();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static CommonStatusEnum create(Object code) {
|
||||
return CommonStatusEnum.valueOf((String) code);
|
||||
}
|
||||
|
||||
public static CommonStatusEnum valueByDesc(String desc) {
|
||||
for (CommonStatusEnum item : values()) {
|
||||
if (item.getDesc().equals(desc)) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
package oailab.com.apiservice.enums.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import oailab.com.apiservice.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* CurrencyEnums
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 8/6/24
|
||||
**/
|
||||
public enum CurrencyEnums implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
RMB(0, "RMB"),
|
||||
USD(1, "USD"),
|
||||
;
|
||||
|
||||
CurrencyEnums(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
private String getName(){
|
||||
return this.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static CurrencyEnums create(Object code) {
|
||||
return CurrencyEnums.valueOf((String) code);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package oailab.com.apiservice.enums.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import oailab.com.apiservice.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* Configuration status enumeration
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
* @version 1.0
|
||||
**/
|
||||
public enum CustomConfigurationStatusEnum implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
ACTIVE(0, "active"),
|
||||
NO_CONFIGURE(1, "no-configure"),
|
||||
INACTIVE(2, "inactive"),
|
||||
;
|
||||
|
||||
CustomConfigurationStatusEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
private String getName(){
|
||||
return this.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static CustomConfigurationStatusEnum create(Object code) {
|
||||
return CustomConfigurationStatusEnum.valueOf((String) code);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package oailab.com.apiservice.enums.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import oailab.com.apiservice.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* Origin model type enumeration
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
* @version 1.0
|
||||
**/
|
||||
public enum OriginModelTypeEnum implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
LLM(0, "text-generation"),
|
||||
TEXT_EMBEDDING(1, "embeddings"),
|
||||
RERANK(2, "reranking"),
|
||||
SPEECH2TEXT(3, "speech2text"),
|
||||
TTS(4, "tts"),
|
||||
MODERATION(5, "moderation"),
|
||||
TEXT2IMG(6, "text2img"),
|
||||
;
|
||||
|
||||
OriginModelTypeEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
private String getName(){
|
||||
return this.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static OriginModelTypeEnum create(Object code) {
|
||||
return OriginModelTypeEnum.valueOf((String) code);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
package oailab.com.apiservice.enums.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import oailab.com.apiservice.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* TODORetriveTypeEnum
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 9/2/24
|
||||
**/
|
||||
public enum RetriveTypeEnum implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
SINGLE(0, "single"),
|
||||
MULTIPLE(1, "multiple"),
|
||||
;
|
||||
|
||||
RetriveTypeEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
private String getName() {
|
||||
return this.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static RetriveTypeEnum create(Object code) {
|
||||
return RetriveTypeEnum.valueOf((String) code);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
package oailab.com.apiservice.enums.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import oailab.com.apiservice.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 2025/3/27
|
||||
**/
|
||||
public enum SitesTypeEnum implements BaseEnum<Integer> {
|
||||
|
||||
CHAT(0, "聊天对话"),
|
||||
CUSTOM_DATA_SETTING(1, "自定义词库设置"),
|
||||
;
|
||||
|
||||
SitesTypeEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getName() {
|
||||
return this.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static SitesTypeEnum create(Object code) {
|
||||
return SitesTypeEnum.valueOf((String) code);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
package oailab.com.apiservice.enums.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import oailab.com.apiservice.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* Tag type enumeration
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
* @version 1.0
|
||||
**/
|
||||
public enum TagsTypeEnum implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
APP(0, "应用"),
|
||||
KNOWLEDGE(1, "知识库"),
|
||||
;
|
||||
|
||||
TagsTypeEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
private String getName(){
|
||||
return this.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static TagsTypeEnum create(Object code) {
|
||||
return TagsTypeEnum.valueOf((String) code);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package oailab.com.apiservice.enums.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import oailab.com.apiservice.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* TransferMethodEnum
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 8/30/24
|
||||
**/
|
||||
public enum TransferMethodEnum implements BaseEnum<Integer> {
|
||||
|
||||
ALL(0, "all"),
|
||||
LOCAL_FILE(1, "local_file"),
|
||||
REMOTE_URL(2, "remote_url"),
|
||||
;
|
||||
|
||||
TransferMethodEnum(Integer value, String desc) {
|
||||
this.value = value;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
@EnumValue
|
||||
private final Integer value;
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getName() {
|
||||
return this.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.desc;
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static TransferMethodEnum create(Object code) {
|
||||
return TransferMethodEnum.valueOf((String) code);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
package oailab.com.apiservice.exception;
|
||||
|
||||
// 自定义异常类:权限不足异常
|
||||
public class AccessDeniedException extends RuntimeException {
|
||||
public AccessDeniedException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
package oailab.com.apiservice.exception;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.Getter;
|
||||
import oailab.com.apiservice.enums.sys.ErrorCodeEnum;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* Business exception
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
* @version 1.0
|
||||
**/
|
||||
@Getter
|
||||
public class BizException extends RuntimeException {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -7928912227190116681L;
|
||||
|
||||
private final int code;
|
||||
private final String name;
|
||||
|
||||
public BizException() {
|
||||
super(ErrorCodeEnum.Fail.getDesc());
|
||||
this.code = ErrorCodeEnum.Fail.getValue();
|
||||
this.name = ErrorCodeEnum.Fail.name();
|
||||
}
|
||||
public BizException(int code, String message, String name) {
|
||||
super(message);
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
public BizException(ErrorCodeEnum error) {
|
||||
super(error.getDesc());
|
||||
this.code = error.getValue();
|
||||
this.name = error.name();
|
||||
}
|
||||
public BizException(ErrorCodeEnum error,String message) {
|
||||
super(StrUtil.isNotEmpty(message)?message:error.getDesc());
|
||||
this.code = error.getValue();
|
||||
this.name = error.name();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package oailab.com.apiservice.mybatis.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import lombok.Data;
|
||||
import oailab.com.apiservice.annotation.SearchParam;
|
||||
import oailab.com.apiservice.enums.sys.SearchConditionEnum;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 实体基类
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
**/
|
||||
@Data
|
||||
public class BaseEntity implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@SearchParam(name = "数据ID", condition = SearchConditionEnum.eq)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@SearchParam(name = {"开始时间", "结束时间"}, condition = {SearchConditionEnum.ge, SearchConditionEnum.le})
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date modifyTime;
|
||||
|
||||
/**
|
||||
* 乐观锁
|
||||
*/
|
||||
@Version
|
||||
@JsonIgnore
|
||||
private Integer version = 0;
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*/
|
||||
@TableLogic
|
||||
@JsonIgnore
|
||||
private Boolean deleted = false;
|
||||
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package oailab.com.apiservice.mybatis.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 可排序的实体基类
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
**/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class OrderEntity extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer orders = 0;
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package oailab.com.apiservice.mybatis.entity.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import oailab.com.apiservice.mybatis.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* @author dennis
|
||||
* @since 2025-04-02 11:35:49
|
||||
*/
|
||||
@TableName("t_sys_parameter")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class SystemParam extends BaseEntity {
|
||||
|
||||
|
||||
/**
|
||||
* 参数名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 参数值
|
||||
*/
|
||||
private String value;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package oailab.com.apiservice.mybatis.entity.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import oailab.com.apiservice.enums.sys.TenantStatusEnum;
|
||||
import oailab.com.apiservice.mybatis.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 租户表
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
**/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "t_sys_tenant")
|
||||
@Data
|
||||
public class Tenant extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 租户状态
|
||||
*/
|
||||
private TenantStatusEnum status;
|
||||
|
||||
/**
|
||||
* 租户名称
|
||||
*/
|
||||
private String tenantName;
|
||||
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
package oailab.com.apiservice.mybatis.entity.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import oailab.com.apiservice.mybatis.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 租户账号
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
**/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "t_sys_tenant_account")
|
||||
@Data
|
||||
public class TenantAccount extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
private String account;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@JsonIgnore
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* from AccountStatusEnum
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* from AccountStatusEnum
|
||||
*/
|
||||
private String role = "user";
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package oailab.com.apiservice.mybatis.entity.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import oailab.com.apiservice.mybatis.entity.OrderEntity;
|
||||
|
||||
/**
|
||||
* 租户工作空间
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
**/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "t_sys_tenant_workspace")
|
||||
@Data
|
||||
public class TenantWorkspace extends OrderEntity {
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 工作间头像
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 是否是系统创建
|
||||
* 系统创建的工作间不能删除
|
||||
*/
|
||||
private Boolean sysFlag;
|
||||
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package oailab.com.apiservice.mybatis.entity.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import oailab.com.apiservice.enums.sys.WorkspaceRoleEnum;
|
||||
import oailab.com.apiservice.mybatis.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 账户和空间关系绑定表
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
**/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "t_sys_tenant_workspace_join ")
|
||||
@Data
|
||||
public class TenantWorkspaceJoin extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 工作间ID
|
||||
*/
|
||||
private String workspaceId;
|
||||
|
||||
/**
|
||||
* 成员账号
|
||||
*/
|
||||
private String accountId;
|
||||
|
||||
/**
|
||||
* 角色
|
||||
*/
|
||||
private WorkspaceRoleEnum role;
|
||||
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
package oailab.com.apiservice.mybatis.entity.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import oailab.com.apiservice.mybatis.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 终端用户表
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 8/12/24
|
||||
**/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "t_end_users")
|
||||
@Data
|
||||
public class EndUsers extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 应用ID
|
||||
*/
|
||||
private String appId;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
* browser
|
||||
* service_api
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 外部用户ID
|
||||
*/
|
||||
private String externalUserId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 是否是匿名
|
||||
*/
|
||||
private Boolean isAnonymous;
|
||||
|
||||
/**
|
||||
* 会话ID
|
||||
*/
|
||||
private String sessionId;
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,58 @@
|
||||
package oailab.com.apiservice.mybatis.entity.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import oailab.com.apiservice.mybatis.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 模型配置表
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
**/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "t_provider_model_settings")
|
||||
@Data
|
||||
public class ProviderModelSettings extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 工作间ID
|
||||
*/
|
||||
private String workspaceId;
|
||||
|
||||
/**
|
||||
* 模型提供者名称
|
||||
*/
|
||||
private String providerName;
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
*/
|
||||
private String modelName;
|
||||
|
||||
/**
|
||||
* 模型类型
|
||||
* 参考模型yaml文件里面的类型
|
||||
*/
|
||||
private String modelType;
|
||||
|
||||
/**
|
||||
* 是否可用
|
||||
*/
|
||||
private Boolean enabled = true;
|
||||
|
||||
/**
|
||||
* 是否开启负载均衡
|
||||
*/
|
||||
private Boolean loadBalancingEnabled = false;
|
||||
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package oailab.com.apiservice.mybatis.entity.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import oailab.com.apiservice.mybatis.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 自定义模型表
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 8/18/24
|
||||
**/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "t_provider_models")
|
||||
@Data
|
||||
public class ProviderModels extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 工作间
|
||||
*/
|
||||
private String workspaceId;
|
||||
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
private String providerName;
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
*/
|
||||
private String modelName;
|
||||
|
||||
/**
|
||||
* 模型类型
|
||||
*/
|
||||
private String modelType;
|
||||
|
||||
/**
|
||||
* 加密配置
|
||||
*/
|
||||
private String encryptedConfig;
|
||||
|
||||
/**
|
||||
* 是否可用
|
||||
*/
|
||||
private Boolean isValid;
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package oailab.com.apiservice.mybatis.entity.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import oailab.com.apiservice.enums.provider.ProviderQuotaTypeEnum;
|
||||
import oailab.com.apiservice.enums.provider.ProviderTypeEnum;
|
||||
import oailab.com.apiservice.mybatis.entity.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 模型供应商表
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
**/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "t_providers")
|
||||
@Data
|
||||
public class Providers extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 所属工作间
|
||||
*/
|
||||
private String workspaceId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String providerName;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private ProviderTypeEnum providerType = ProviderTypeEnum.CUSTOM;
|
||||
|
||||
/**
|
||||
* 加密配置
|
||||
*/
|
||||
private String encryptedConfig;
|
||||
|
||||
/**
|
||||
* 是否可用
|
||||
*/
|
||||
private Boolean isValid;
|
||||
|
||||
/**
|
||||
* 上次使用时间
|
||||
*/
|
||||
private Date lastUsed;
|
||||
|
||||
/**
|
||||
* 配额类型
|
||||
*/
|
||||
private ProviderQuotaTypeEnum quotaType = ProviderQuotaTypeEnum.TRIAL;
|
||||
|
||||
/**
|
||||
* 配额限制数量
|
||||
*/
|
||||
private Long quotaLimit;
|
||||
|
||||
/**
|
||||
* 配额已使用数量
|
||||
*/
|
||||
private Long quotaUsed;
|
||||
|
||||
}
|
||||
@ -0,0 +1,116 @@
|
||||
package oailab.com.apiservice.mybatis.entity.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import oailab.com.apiservice.enums.web.CustomizeTokenStrategyEnum;
|
||||
import oailab.com.apiservice.enums.web.SiteStatusEnum;
|
||||
import oailab.com.apiservice.enums.workspace.SitesTypeEnum;
|
||||
import oailab.com.apiservice.mybatis.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 站点表
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 8/12/24
|
||||
**/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "t_sites")
|
||||
@Data
|
||||
public class Sites extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private SitesTypeEnum type = SitesTypeEnum.CHAT;
|
||||
|
||||
/**
|
||||
* 应用ID
|
||||
*/
|
||||
private String appId;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 图标背景
|
||||
*/
|
||||
private String iconBackground;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 默认语言
|
||||
*/
|
||||
private String defaultLanguage;
|
||||
|
||||
/**
|
||||
* 版权
|
||||
*/
|
||||
private String copyright;
|
||||
|
||||
/**
|
||||
* 隐私政策
|
||||
*/
|
||||
private String privacyPolicy;
|
||||
|
||||
/**
|
||||
* 自定义域名
|
||||
*/
|
||||
private String customizeDomain;
|
||||
|
||||
/**
|
||||
* from CustomizeTokenStrategyEnum
|
||||
*/
|
||||
private String customizeTokenStrategy = CustomizeTokenStrategyEnum.NOT_ALLOW.getDesc();
|
||||
|
||||
/**
|
||||
* 提示词是否公开
|
||||
*/
|
||||
private Boolean promptPublic = false;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
* from SiteStatusEnum
|
||||
*/
|
||||
private String status = SiteStatusEnum.NORMAL.getDesc();
|
||||
|
||||
/**
|
||||
* 免责声明
|
||||
*/
|
||||
private String customDisclaimer;
|
||||
|
||||
/**
|
||||
* 是否显示工作流步骤
|
||||
*/
|
||||
private Boolean showWorkflowSteps = true;
|
||||
|
||||
/**
|
||||
* 聊天背景色
|
||||
*/
|
||||
private String chatColorTheme;
|
||||
|
||||
/**
|
||||
* 聊天背景色反转
|
||||
*/
|
||||
private Boolean chatColorThemeInverted = false;
|
||||
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package oailab.com.apiservice.mybatis.entity.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import oailab.com.apiservice.mybatis.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 标签绑定表
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
**/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "t_tag_bindings")
|
||||
@Data
|
||||
public class TagBindings extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 标签ID
|
||||
*/
|
||||
private String tagId;
|
||||
|
||||
/**
|
||||
* 绑定目标
|
||||
*/
|
||||
private String targetId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String creatorBy;
|
||||
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
package oailab.com.apiservice.mybatis.entity.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import oailab.com.apiservice.enums.workspace.TagsTypeEnum;
|
||||
import oailab.com.apiservice.mybatis.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 标签表
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
**/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "t_tags")
|
||||
@Data
|
||||
public class Tags extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 所属工作空间ID
|
||||
*/
|
||||
private String workspaceId;
|
||||
|
||||
/**
|
||||
* 标签名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 标签类型
|
||||
*/
|
||||
private TagsTypeEnum type;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String creatorBy;
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package oailab.com.apiservice.mybatis.entity.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import oailab.com.apiservice.mybatis.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 租户默认模型表
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
**/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "t_tenant_default_models")
|
||||
@Data
|
||||
public class TenantDefaultModels extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 工作间ID
|
||||
*/
|
||||
private String workspaceId;
|
||||
|
||||
/**
|
||||
* 模型提供者名称
|
||||
*/
|
||||
private String providerName;
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
*/
|
||||
private String modelName;
|
||||
|
||||
/**
|
||||
* 模型类型
|
||||
* 参考模型yaml文件里面的类型
|
||||
*/
|
||||
private String modelType;
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package oailab.com.apiservice.mybatis.entity.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import oailab.com.apiservice.mybatis.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 租户首选模型供应商
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 8/23/24
|
||||
**/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "t_tenant_preferred_model_providers")
|
||||
@Data
|
||||
public class TenantPreferredModelProviders extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 工作间ID
|
||||
*/
|
||||
private String workspaceId;
|
||||
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
private String providerName;
|
||||
|
||||
/**
|
||||
* 首选模型供应商类型
|
||||
*/
|
||||
private String preferredProviderType;
|
||||
}
|
||||
@ -0,0 +1,109 @@
|
||||
package oailab.com.apiservice.mybatis.entity.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import oailab.com.apiservice.mybatis.entity.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @ClassName Datasets
|
||||
* @Description 上传文件实体表
|
||||
* @Author dennis
|
||||
* @blog
|
||||
* @date 8/3/24 AM10:30
|
||||
* @Version 1.0
|
||||
**/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "t_upload_files")
|
||||
@Data
|
||||
public class UploadFiles extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@JsonProperty(value = "tenant_id")
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 所属工作空间ID
|
||||
*/
|
||||
@JsonProperty(value = "workspace_id")
|
||||
private String workspaceId;
|
||||
|
||||
/**
|
||||
* 存储类型
|
||||
*/
|
||||
@JsonProperty(value = "storage_type")
|
||||
private String storageType;
|
||||
|
||||
/**
|
||||
* key
|
||||
*/
|
||||
@JsonProperty(value = "file_key")
|
||||
private String fileKey;
|
||||
|
||||
/**
|
||||
* 文档名称
|
||||
*/
|
||||
@JsonProperty(value = "name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 文档大小
|
||||
*/
|
||||
@JsonProperty(value = "size")
|
||||
private Long size;
|
||||
|
||||
/**
|
||||
* 文档扩展名
|
||||
*/
|
||||
@JsonProperty(value = "extension")
|
||||
private String extension;
|
||||
|
||||
/**
|
||||
* 文档类型
|
||||
*/
|
||||
@JsonProperty(value = "mime_type")
|
||||
private String mimeType;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@JsonProperty(value = "created_by")
|
||||
private String createdBy;
|
||||
|
||||
|
||||
/**
|
||||
* 是否使用
|
||||
*/
|
||||
private Boolean used = false;
|
||||
|
||||
/**
|
||||
* 使用者
|
||||
*/
|
||||
@JsonProperty(value = "used_by")
|
||||
private String usedBy;
|
||||
|
||||
/**
|
||||
* 使用时间
|
||||
*/
|
||||
@JsonProperty(value = "used_at")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date usedAt;
|
||||
|
||||
/**
|
||||
* hash
|
||||
*/
|
||||
private String hash;
|
||||
|
||||
/**
|
||||
* 创建者角色
|
||||
*/
|
||||
@JsonProperty(value = "created_by_role")
|
||||
private String createdByRole = "account";
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package oailab.com.apiservice.mybatis.mapper.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import oailab.com.apiservice.mybatis.entity.sys.SystemParam;
|
||||
|
||||
/**
|
||||
* @ClassName SystemParamMapper
|
||||
* @Description
|
||||
* @Author dennis
|
||||
* @blog
|
||||
* @date 8/1/24 AM11:42
|
||||
* @Version 1.0
|
||||
**/
|
||||
public interface SystemParamMapper extends BaseMapper<SystemParam> {
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package oailab.com.apiservice.mybatis.mapper.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import oailab.com.apiservice.mybatis.entity.sys.TenantAccount;
|
||||
|
||||
/**
|
||||
* Tenant account mapper.
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
* @version 1.0
|
||||
**/
|
||||
public interface TenantAccountMapper extends BaseMapper<TenantAccount> {
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package oailab.com.apiservice.mybatis.mapper.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import oailab.com.apiservice.mybatis.entity.sys.Tenant;
|
||||
|
||||
/**
|
||||
* Tenant mapper.
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
* @version 1.0
|
||||
**/
|
||||
public interface TenantMapper extends BaseMapper<Tenant> {
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package oailab.com.apiservice.mybatis.mapper.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import oailab.com.apiservice.mybatis.entity.sys.TenantWorkspaceJoin;
|
||||
|
||||
/**
|
||||
* Workspace join mapper.
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
* @version 1.0
|
||||
**/
|
||||
public interface TenantWorkspaceJoinMapper extends BaseMapper<TenantWorkspaceJoin> {
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package oailab.com.apiservice.mybatis.mapper.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import oailab.com.apiservice.mybatis.entity.sys.TenantWorkspace;
|
||||
|
||||
/**
|
||||
* Workspace mapper.
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
* @version 1.0
|
||||
**/
|
||||
public interface TenantWorkspaceMapper extends BaseMapper<TenantWorkspace> {
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package oailab.com.apiservice.mybatis.mapper.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import oailab.com.apiservice.mybatis.entity.workspace.EndUsers;
|
||||
|
||||
|
||||
/**
|
||||
* EndUsersMapper
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 8/12/24
|
||||
**/
|
||||
public interface EndUsersMapper extends BaseMapper<EndUsers> {
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package oailab.com.apiservice.mybatis.mapper.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import oailab.com.apiservice.mybatis.entity.workspace.ProviderModelSettings;
|
||||
|
||||
/**
|
||||
* @ClassName ProviderModelSettingsMapper
|
||||
* @Description
|
||||
* @Author bianmaren
|
||||
* @blog <a href="http://www.bianmaren.com">编码人</a>
|
||||
* @date 7/11/24 AM2:38
|
||||
* @Version 1.0
|
||||
**/
|
||||
public interface ProviderModelSettingsMapper extends BaseMapper<ProviderModelSettings> {
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package oailab.com.apiservice.mybatis.mapper.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import oailab.com.apiservice.mybatis.entity.workspace.ProviderModels;
|
||||
|
||||
/**
|
||||
* ProviderModelsMapper
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 8/18/24
|
||||
**/
|
||||
public interface ProviderModelsMapper extends BaseMapper<ProviderModels> {
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package oailab.com.apiservice.mybatis.mapper.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import oailab.com.apiservice.mybatis.entity.workspace.Providers;
|
||||
|
||||
/**
|
||||
* @ClassName ProvidersMapper
|
||||
* @Description
|
||||
* @Author bianmaren
|
||||
* @blog <a href="http://www.bianmaren.com">编码人</a>
|
||||
* @date 7/10/24 PM10:19
|
||||
* @Version 1.0
|
||||
**/
|
||||
public interface ProvidersMapper extends BaseMapper<Providers> {
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package oailab.com.apiservice.mybatis.mapper.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import oailab.com.apiservice.mybatis.entity.workspace.Sites;
|
||||
|
||||
/**
|
||||
* SitesMapper
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 8/12/24
|
||||
**/
|
||||
public interface SitesMapper extends BaseMapper<Sites> {
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package oailab.com.apiservice.mybatis.mapper.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import oailab.com.apiservice.mybatis.entity.workspace.TagBindings;
|
||||
|
||||
/**
|
||||
* @ClassName TagBindingsMapper
|
||||
* @Description
|
||||
* @Author bianmaren
|
||||
* @blog <a href="http://www.bianmaren.com">编码人</a>
|
||||
* @date 7/3/24 PM11:40
|
||||
* @Version 1.0
|
||||
**/
|
||||
public interface TagBindingsMapper extends BaseMapper<TagBindings> {
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package oailab.com.apiservice.mybatis.mapper.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import oailab.com.apiservice.mybatis.entity.workspace.Tags;
|
||||
|
||||
/**
|
||||
* @ClassName TagsMapper
|
||||
* @Description
|
||||
* @Author bianmaren
|
||||
* @blog <a href="http://www.bianmaren.com">编码人</a>
|
||||
* @date 7/3/24 PM11:40
|
||||
* @Version 1.0
|
||||
**/
|
||||
public interface TagsMapper extends BaseMapper<Tags> {
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package oailab.com.apiservice.mybatis.mapper.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import oailab.com.apiservice.mybatis.entity.workspace.TenantDefaultModels;
|
||||
|
||||
/**
|
||||
* @ClassName TenantDefaultModelsMapper
|
||||
* @Description
|
||||
* @Author bianmaren
|
||||
* @blog <a href="http://www.bianmaren.com">编码人</a>
|
||||
* @date 7/11/24 AM2:38
|
||||
* @Version 1.0
|
||||
**/
|
||||
public interface TenantDefaultModelsMapper extends BaseMapper<TenantDefaultModels> {
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package oailab.com.apiservice.mybatis.mapper.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import oailab.com.apiservice.mybatis.entity.workspace.TenantPreferredModelProviders;
|
||||
|
||||
/**
|
||||
* TenantPreferredModelProvidersMapper
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 8/23/24
|
||||
**/
|
||||
public interface TenantPreferredModelProvidersMapper extends BaseMapper<TenantPreferredModelProviders> {
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package oailab.com.apiservice.mybatis.mapper.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import oailab.com.apiservice.mybatis.entity.workspace.UploadFiles;
|
||||
|
||||
/**
|
||||
* @ClassName UploadFilesMapper
|
||||
* @Description
|
||||
* @Author dennis
|
||||
* @blog
|
||||
* @date 8/3/24 AM10:42
|
||||
* @Version 1.0
|
||||
**/
|
||||
public interface UploadFilesMapper extends BaseMapper<UploadFiles> {
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package oailab.com.apiservice.mybatis.service.impl.sys;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import oailab.com.apiservice.mybatis.entity.sys.SystemParam;
|
||||
import oailab.com.apiservice.mybatis.mapper.sys.SystemParamMapper;
|
||||
import oailab.com.apiservice.mybatis.service.sys.SystemParamService;
|
||||
import oailab.com.apiservice.request.input.sys.SystemParamsUpdateInput;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 9/13/24
|
||||
**/
|
||||
@Service
|
||||
public class SystemParamServiceImpl extends ServiceImpl<SystemParamMapper, SystemParam> implements SystemParamService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = RuntimeException.class)
|
||||
public Boolean updateSystemParam(SystemParamsUpdateInput input) {
|
||||
Integer updateCount = 0;
|
||||
|
||||
// 循环处理 Map
|
||||
for (String key : input.getSysParams().keySet()) {
|
||||
SystemParam param = baseMapper.selectOne(new QueryWrapper<SystemParam>().eq("name", key));
|
||||
|
||||
if (null == param) {
|
||||
param = new SystemParam();
|
||||
}
|
||||
param.setName(key);
|
||||
SystemParam item = JSON.parseObject(input.getSysParams().get(key).toString(), SystemParam.class);
|
||||
param.setValue(item.getValue());
|
||||
this.saveOrUpdate(param);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getSystemParamValue(String name) {
|
||||
SystemParam systemParam = baseMapper.selectOne(new QueryWrapper<SystemParam>().eq("name", name));
|
||||
return systemParam != null ? systemParam.getValue() : null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,186 @@
|
||||
package oailab.com.apiservice.mybatis.service.impl.sys;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import oailab.com.apiservice.enums.account.AccountStatusEnum;
|
||||
import oailab.com.apiservice.enums.sys.ErrorCodeEnum;
|
||||
import oailab.com.apiservice.enums.sys.TenantStatusEnum;
|
||||
import oailab.com.apiservice.enums.sys.WorkspaceRoleEnum;
|
||||
import oailab.com.apiservice.exception.BizException;
|
||||
import oailab.com.apiservice.mybatis.entity.sys.Tenant;
|
||||
import oailab.com.apiservice.mybatis.entity.sys.TenantAccount;
|
||||
import oailab.com.apiservice.mybatis.entity.sys.TenantWorkspace;
|
||||
import oailab.com.apiservice.mybatis.entity.sys.TenantWorkspaceJoin;
|
||||
import oailab.com.apiservice.mybatis.mapper.sys.TenantAccountMapper;
|
||||
import oailab.com.apiservice.mybatis.service.sys.TenantAccountService;
|
||||
import oailab.com.apiservice.mybatis.service.sys.TenantService;
|
||||
import oailab.com.apiservice.mybatis.service.sys.TenantWorkspaceJoinService;
|
||||
import oailab.com.apiservice.mybatis.service.sys.TenantWorkspaceService;
|
||||
import oailab.com.apiservice.request.input.sys.ModifyPwInput;
|
||||
import oailab.com.apiservice.request.input.sys.RecoverPwInput;
|
||||
import oailab.com.apiservice.request.input.sys.RegisterInput;
|
||||
import oailab.com.apiservice.request.input.sys.TenantAccountUpdateInput;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* TenantAccountServiceImpl
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/27/24 PM11:19
|
||||
**/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class TenantAccountServiceImpl extends ServiceImpl<TenantAccountMapper, TenantAccount> implements TenantAccountService {
|
||||
|
||||
@Value(value = "${jwt.token-validity-days}")
|
||||
private Integer tokenValidityDays;
|
||||
@Resource
|
||||
private BCryptPasswordEncoder passwordEncoder;
|
||||
@Resource
|
||||
private TenantService tenantService;
|
||||
@Resource
|
||||
private TenantWorkspaceService tenantWorkspaceService;
|
||||
@Resource
|
||||
private TenantWorkspaceJoinService tenantWorkspaceJoinService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = RuntimeException.class)
|
||||
public void updateAccountRole(String accountId, String roleCode) {
|
||||
if (StrUtil.isEmpty(accountId)) {
|
||||
throw new BizException(ErrorCodeEnum.AccountDoesNotExist);
|
||||
}
|
||||
if (StrUtil.isEmpty(roleCode)) {
|
||||
throw new BizException(ErrorCodeEnum.ValueError);
|
||||
}
|
||||
|
||||
LambdaUpdateWrapper<TenantAccount> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(TenantAccount::getId, accountId)
|
||||
.set(TenantAccount::getRole, roleCode);
|
||||
this.update(updateWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = RuntimeException.class)
|
||||
public String register(RegisterInput input) {
|
||||
// Check if account already exists
|
||||
if (this.lambdaQuery().eq(TenantAccount::getAccount, input.getUsername()).exists()) {
|
||||
throw new RuntimeException("Account already exists");
|
||||
}
|
||||
|
||||
Tenant tenant = new Tenant();
|
||||
tenant.setTenantName(input.getUsername());
|
||||
tenant.setStatus(TenantStatusEnum.NORMAL);
|
||||
tenantService.save(tenant);
|
||||
|
||||
TenantAccount account = new TenantAccount();
|
||||
account.setTenantId(tenant.getId());
|
||||
account.setAccount(input.getUsername());
|
||||
account.setPassword(passwordEncoder.encode(input.getPassword()));
|
||||
String nickname = StringUtils.hasText(input.getNickname())
|
||||
? input.getNickname()
|
||||
: "用户" + (input.getUsername().length() >= 5 ? input.getUsername().substring(0, 5) : input.getUsername());
|
||||
|
||||
account.setNickname(nickname);
|
||||
account.setStatus(AccountStatusEnum.ACTIVE.getDesc());
|
||||
if (input.getRole() != null) {
|
||||
account.setRole(input.getRole());
|
||||
} else {
|
||||
account.setRole("user"); // 默认为user
|
||||
}
|
||||
this.save(account);
|
||||
|
||||
TenantWorkspace workspace = new TenantWorkspace();
|
||||
workspace.setTenantId(tenant.getId());
|
||||
workspace.setName("默认工作空间");
|
||||
workspace.setSysFlag(true);
|
||||
tenantWorkspaceService.save(workspace);
|
||||
|
||||
TenantWorkspaceJoin join = new TenantWorkspaceJoin();
|
||||
join.setWorkspaceId(workspace.getId());
|
||||
join.setAccountId(account.getId());
|
||||
join.setRole(WorkspaceRoleEnum.OWNER);
|
||||
tenantWorkspaceJoinService.save(join);
|
||||
return account.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TenantAccount getByAccount(String account) {
|
||||
LambdaQueryWrapper<TenantAccount> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(TenantAccount::getAccount, account);
|
||||
queryWrapper.eq(TenantAccount::getDeleted, false);
|
||||
return baseMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getJwtPayload(TenantAccount account) {
|
||||
return new HashMap<>() {
|
||||
{
|
||||
put("id", account.getId());
|
||||
put("account", account.getAccount());
|
||||
put("expire_time", System.currentTimeMillis() + 1000L * 60 * 60 * 24 * tokenValidityDays);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public TenantAccount update(TenantAccountUpdateInput input, String accountId) {
|
||||
if (StrUtil.isNotEmpty(input.getNickname())) {
|
||||
LambdaUpdateWrapper<TenantAccount> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(TenantAccount::getId, accountId);
|
||||
updateWrapper.set(TenantAccount::getNickname, input.getNickname());
|
||||
this.update(updateWrapper);
|
||||
}
|
||||
|
||||
if (StrUtil.isNotEmpty(input.getAvatar())) {
|
||||
LambdaUpdateWrapper<TenantAccount> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(TenantAccount::getId, accountId);
|
||||
updateWrapper.set(TenantAccount::getAvatar, input.getAvatar());
|
||||
this.update(updateWrapper);
|
||||
}
|
||||
|
||||
return this.getById(accountId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePassword(String accountId, ModifyPwInput input) {
|
||||
TenantAccount account = this.getById(accountId);
|
||||
|
||||
if (!passwordEncoder.matches(input.getOldPassword(), account.getPassword())) {
|
||||
throw new BizException(ErrorCodeEnum.PasswordError);
|
||||
}
|
||||
|
||||
if (!input.getNewPassword().equals(input.getConfirmPassword())) {
|
||||
throw new BizException(ErrorCodeEnum.PasswordInconsistency);
|
||||
}
|
||||
|
||||
LambdaUpdateWrapper<TenantAccount> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(TenantAccount::getId, accountId);
|
||||
updateWrapper.set(TenantAccount::getPassword, passwordEncoder.encode(input.getNewPassword()));
|
||||
this.update(updateWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String resetPassword(String accountId, RecoverPwInput input) {
|
||||
LambdaUpdateWrapper<TenantAccount> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(TenantAccount::getId, accountId);
|
||||
updateWrapper.set(TenantAccount::getPassword, passwordEncoder.encode(input.getNewPw()));
|
||||
|
||||
if (this.update(updateWrapper)) {
|
||||
return "success";
|
||||
}
|
||||
return "error";
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package oailab.com.apiservice.mybatis.service.impl.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import oailab.com.apiservice.mybatis.entity.sys.Tenant;
|
||||
import oailab.com.apiservice.mybatis.mapper.sys.TenantMapper;
|
||||
import oailab.com.apiservice.mybatis.service.sys.TenantService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* TenantServiceImpl
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/27/24 PM11:19
|
||||
* @version 1.0
|
||||
**/
|
||||
@Service
|
||||
public class TenantServiceImpl extends ServiceImpl<TenantMapper, Tenant> implements TenantService {
|
||||
@Override
|
||||
public TenantMapper getBaseMapper() {
|
||||
return super.getBaseMapper();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package oailab.com.apiservice.mybatis.service.impl.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import oailab.com.apiservice.mybatis.entity.sys.TenantWorkspaceJoin;
|
||||
import oailab.com.apiservice.mybatis.mapper.sys.TenantWorkspaceJoinMapper;
|
||||
import oailab.com.apiservice.mybatis.service.sys.TenantWorkspaceJoinService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* TenantWorkspaceJoinServiceImpl
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
* @version 1.0
|
||||
**/
|
||||
@Service
|
||||
public class TenantWorkspaceJoinServiceImpl extends ServiceImpl<TenantWorkspaceJoinMapper, TenantWorkspaceJoin> implements TenantWorkspaceJoinService {
|
||||
|
||||
/**
|
||||
* 是否加入工作间
|
||||
* @param accountId 账户ID
|
||||
* @param workspaceId 工作间ID
|
||||
*/
|
||||
@Override
|
||||
public boolean isJoin(String accountId, String workspaceId){
|
||||
LambdaQueryWrapper<TenantWorkspaceJoin> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(TenantWorkspaceJoin::getWorkspaceId,workspaceId);
|
||||
queryWrapper.eq(TenantWorkspaceJoin::getAccountId,accountId);
|
||||
long count = count(queryWrapper);
|
||||
return count>0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工作间参与
|
||||
* @param workspaceId 工作间ID
|
||||
*/
|
||||
@Override
|
||||
public List<TenantWorkspaceJoin> getJoins(String workspaceId){
|
||||
LambdaQueryWrapper<TenantWorkspaceJoin> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(TenantWorkspaceJoin::getWorkspaceId,workspaceId);
|
||||
queryWrapper.eq(TenantWorkspaceJoin::getDeleted,false);
|
||||
return list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TenantWorkspaceJoin getJoin(String workspaceId, String accountId){
|
||||
LambdaQueryWrapper<TenantWorkspaceJoin> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(TenantWorkspaceJoin::getWorkspaceId,workspaceId);
|
||||
queryWrapper.eq(TenantWorkspaceJoin::getAccountId,accountId);
|
||||
queryWrapper.eq(TenantWorkspaceJoin::getDeleted,false);
|
||||
return getOne(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,101 @@
|
||||
package oailab.com.apiservice.mybatis.service.impl.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import oailab.com.apiservice.enums.sys.ErrorCodeEnum;
|
||||
import oailab.com.apiservice.enums.sys.WorkspaceRoleEnum;
|
||||
import oailab.com.apiservice.exception.BizException;
|
||||
import oailab.com.apiservice.mybatis.entity.sys.TenantAccount;
|
||||
import oailab.com.apiservice.mybatis.entity.sys.TenantWorkspace;
|
||||
import oailab.com.apiservice.mybatis.entity.sys.TenantWorkspaceJoin;
|
||||
import oailab.com.apiservice.mybatis.mapper.sys.TenantWorkspaceMapper;
|
||||
import oailab.com.apiservice.mybatis.service.sys.TenantWorkspaceJoinService;
|
||||
import oailab.com.apiservice.mybatis.service.sys.TenantWorkspaceService;
|
||||
import oailab.com.apiservice.request.input.workspace.TenantWorkspaceUpdateInput;
|
||||
import oailab.com.apiservice.request.input.workspace.TenantWorkspaceCreateInput;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Workspace service
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
* @version 1.0
|
||||
**/
|
||||
@Service
|
||||
public class TenantWorkspaceServiceImpl extends ServiceImpl<TenantWorkspaceMapper, TenantWorkspace> implements TenantWorkspaceService {
|
||||
|
||||
@Resource
|
||||
private TenantWorkspaceJoinService tenantWorkspaceJoinService;
|
||||
|
||||
@Override
|
||||
public TenantWorkspace getDefaultWorkspace(String accountId){
|
||||
|
||||
String getJoinWorkspaceIdSql = "select workspace_id from t_sys_tenant_workspace_join where "
|
||||
+ " account_id = "+accountId
|
||||
+" and deleted = 0 " +
|
||||
"and role = " + WorkspaceRoleEnum.OWNER.getValue();
|
||||
|
||||
QueryWrapper<TenantWorkspace> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().inSql(TenantWorkspace::getId,getJoinWorkspaceIdSql);
|
||||
queryWrapper.lambda().orderByAsc(TenantWorkspace::getOrders);
|
||||
queryWrapper.lambda().orderByAsc(TenantWorkspace::getCreateTime);
|
||||
queryWrapper.last("limit 1");
|
||||
return getOne(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the workspaces the current account has joined
|
||||
*/
|
||||
@Override
|
||||
public List<TenantWorkspace> getJoinWorkspaces(String accountId){
|
||||
String getJoinWorkspaceIdSql = "select workspace_id from t_sys_tenant_workspace_join where "
|
||||
+ " account_id = "+accountId
|
||||
+" and deleted = 0 ";
|
||||
|
||||
QueryWrapper<TenantWorkspace> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().inSql(TenantWorkspace::getId,getJoinWorkspaceIdSql);
|
||||
queryWrapper.lambda().orderByAsc(TenantWorkspace::getOrders);
|
||||
queryWrapper.lambda().orderByAsc(TenantWorkspace::getCreateTime);
|
||||
return list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TenantWorkspace update(TenantWorkspaceUpdateInput input){
|
||||
TenantWorkspace workspace = getById(input.getId());
|
||||
if(null == workspace){
|
||||
throw new BizException(ErrorCodeEnum.RecordNotExist);
|
||||
}
|
||||
BeanUtils.copyProperties(input,workspace);
|
||||
this.updateById(workspace);
|
||||
return workspace;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = RuntimeException.class)
|
||||
@Override
|
||||
public TenantWorkspace create(TenantWorkspaceCreateInput input, TenantAccount account){
|
||||
|
||||
TenantWorkspace workspace = new TenantWorkspace();
|
||||
workspace.setTenantId(account.getTenantId());
|
||||
workspace.setName(input.getName());
|
||||
workspace.setAvatar(input.getAvatar());
|
||||
workspace.setSysFlag(false);
|
||||
this.save(workspace);
|
||||
|
||||
TenantWorkspaceJoin join = new TenantWorkspaceJoin();
|
||||
join.setWorkspaceId(workspace.getId());
|
||||
join.setAccountId(account.getId());
|
||||
join.setRole(WorkspaceRoleEnum.OWNER);
|
||||
tenantWorkspaceJoinService.save(join);
|
||||
|
||||
return workspace;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package oailab.com.apiservice.mybatis.service.impl.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import oailab.com.apiservice.mybatis.entity.workspace.EndUsers;
|
||||
import oailab.com.apiservice.mybatis.mapper.workspace.EndUsersMapper;
|
||||
import oailab.com.apiservice.mybatis.service.workspace.EndUsersService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* EndUsersServiceImpl
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 8/12/24
|
||||
**/
|
||||
@Service
|
||||
public class EndUsersServiceImpl extends ServiceImpl<EndUsersMapper, EndUsers> implements EndUsersService {
|
||||
|
||||
@Override
|
||||
public long countBySessionId(String sessionId) {
|
||||
LambdaQueryWrapper<EndUsers> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(EndUsers::getSessionId, sessionId);
|
||||
return count(queryWrapper);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,78 @@
|
||||
package oailab.com.apiservice.mybatis.service.impl.workspace;
|
||||
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import oailab.com.apiservice.enums.workspace.SitesTypeEnum;
|
||||
import oailab.com.apiservice.mybatis.entity.workspace.Sites;
|
||||
import oailab.com.apiservice.mybatis.mapper.workspace.SitesMapper;
|
||||
import oailab.com.apiservice.mybatis.service.workspace.SitesService;
|
||||
import oailab.com.apiservice.request.input.workspace.UpdateSiteInput;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* SitesServiceImpl
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 8/12/24
|
||||
**/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class SitesServiceImpl extends ServiceImpl<SitesMapper, Sites> implements SitesService {
|
||||
|
||||
@Override
|
||||
public Sites getByCode(String code) {
|
||||
LambdaQueryWrapper<Sites> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(Sites::getCode, code);
|
||||
queryWrapper.eq(Sites::getDeleted, false);
|
||||
return getOne(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateCode() {
|
||||
String code = RandomUtil.randomString(20);
|
||||
while (null != getByCode(code)) {
|
||||
code = RandomUtil.randomString(20);
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Sites getByAppId(String appId, SitesTypeEnum type) {
|
||||
return getOne(new LambdaQueryWrapper<Sites>()
|
||||
.eq(Sites::getAppId, appId)
|
||||
.eq(Sites::getType, type)
|
||||
.eq(Sites::getDeleted, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Sites getByAppId(String appId) {
|
||||
return getByAppId(appId, SitesTypeEnum.CHAT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Sites update(UpdateSiteInput input) {
|
||||
LambdaQueryWrapper<Sites> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(Sites::getAppId, input.getAppId());
|
||||
queryWrapper.eq(Sites::getType, input.getType());
|
||||
Sites sites = getOne(queryWrapper);
|
||||
if (null == sites) {
|
||||
sites = new Sites();
|
||||
sites.setAppId(input.getAppId());
|
||||
sites.setCode(generateCode());
|
||||
sites.setType(input.getType());
|
||||
}
|
||||
sites.setStatus(input.getStatus().getDesc());
|
||||
|
||||
if (StrUtil.isEmpty(sites.getId())) {
|
||||
this.save(sites);
|
||||
} else {
|
||||
this.updateById(sites);
|
||||
}
|
||||
return sites;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package oailab.com.apiservice.mybatis.service.impl.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import oailab.com.apiservice.mybatis.entity.workspace.TagBindings;
|
||||
import oailab.com.apiservice.mybatis.mapper.workspace.TagBindingsMapper;
|
||||
import oailab.com.apiservice.mybatis.service.workspace.TagBindingsService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
* TagBindingsServiceImpl
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 8/6/24
|
||||
**/
|
||||
@Service
|
||||
public class TagBindingsServiceImpl extends ServiceImpl<TagBindingsMapper, TagBindings> implements TagBindingsService {
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package oailab.com.apiservice.mybatis.service.impl.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import oailab.com.apiservice.mybatis.entity.workspace.Tags;
|
||||
import oailab.com.apiservice.mybatis.mapper.workspace.TagsMapper;
|
||||
import oailab.com.apiservice.mybatis.service.workspace.TagsService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* TagsServiceImpl
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 8/6/24
|
||||
**/
|
||||
@Service
|
||||
public class TagsServiceImpl extends ServiceImpl<TagsMapper, Tags> implements TagsService {
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
package oailab.com.apiservice.mybatis.service.impl.workspace;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import oailab.com.apiservice.mybatis.entity.sys.TenantWorkspace;
|
||||
import oailab.com.apiservice.mybatis.entity.workspace.TenantDefaultModels;
|
||||
import oailab.com.apiservice.mybatis.mapper.workspace.TenantDefaultModelsMapper;
|
||||
import oailab.com.apiservice.mybatis.service.workspace.TenantDefaultModelsService;
|
||||
import oailab.com.apiservice.request.input.workspace.TenantDefaultModelsInput;
|
||||
import oailab.com.apiservice.request.input.workspace.TenantDefaultModelsSettingInput;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* TenantDefaultModelsServiceImpl
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 8/6/24
|
||||
**/
|
||||
@Service
|
||||
public class TenantDefaultModelsServiceImpl extends ServiceImpl<TenantDefaultModelsMapper, TenantDefaultModels> implements TenantDefaultModelsService {
|
||||
|
||||
/**
|
||||
* 获取工作间指定类型的模型配置
|
||||
* @param workspaceId 工作间ID
|
||||
* @param modelType 类型
|
||||
*/
|
||||
@Override
|
||||
public TenantDefaultModels get(String workspaceId, String modelType){
|
||||
LambdaQueryWrapper<TenantDefaultModels> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(TenantDefaultModels::getWorkspaceId,workspaceId);
|
||||
queryWrapper.eq(TenantDefaultModels::getModelType,modelType);
|
||||
queryWrapper.eq(TenantDefaultModels::getDeleted,false);
|
||||
return getOne(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认模型配置
|
||||
* @param workspace 工作间
|
||||
* @param input 设置
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = RuntimeException.class)
|
||||
public void update(TenantWorkspace workspace, TenantDefaultModelsSettingInput input){
|
||||
for(TenantDefaultModelsInput setting:input.getSettings()){
|
||||
TenantDefaultModels model = get(workspace.getId(),setting.getModelType());
|
||||
if(model == null){
|
||||
model = new TenantDefaultModels();
|
||||
model.setTenantId(workspace.getTenantId());
|
||||
model.setWorkspaceId(workspace.getId());
|
||||
model.setModelType(setting.getModelType());
|
||||
}
|
||||
model.setProviderName(setting.getProviderName());
|
||||
model.setModelName(setting.getModelName());
|
||||
this.saveOrUpdate(model);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认模型配置是否配置完全
|
||||
* @param workspaceId 工作间
|
||||
* @param types 类型,多个逗号分割
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean checkConfig(String workspaceId,String types){
|
||||
if(StrUtil.isEmpty(types)){
|
||||
return false;
|
||||
}
|
||||
for(String type:types.split(StrUtil.COMMA)){
|
||||
TenantDefaultModels setting = get(workspaceId,type);
|
||||
if(null == setting){
|
||||
return false;
|
||||
}
|
||||
if(StrUtil.isEmpty(setting.getModelName()) || StrUtil.isEmpty(setting.getProviderName())){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package oailab.com.apiservice.mybatis.service.impl.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import oailab.com.apiservice.mybatis.entity.workspace.TenantPreferredModelProviders;
|
||||
import oailab.com.apiservice.mybatis.mapper.workspace.TenantPreferredModelProvidersMapper;
|
||||
import oailab.com.apiservice.mybatis.service.workspace.TenantPreferredModelProvidersService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* TenantPreferredModelProvidersServiceImpl
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 8/23/24
|
||||
**/
|
||||
@Service
|
||||
public class TenantPreferredModelProvidersServiceImpl extends ServiceImpl<TenantPreferredModelProvidersMapper, TenantPreferredModelProviders> implements TenantPreferredModelProvidersService {
|
||||
|
||||
@Override
|
||||
public List<TenantPreferredModelProviders> list(String workspaceId) {
|
||||
LambdaQueryWrapper<TenantPreferredModelProviders> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(TenantPreferredModelProviders::getWorkspaceId, workspaceId);
|
||||
queryWrapper.eq(TenantPreferredModelProviders::getDeleted, false);
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package oailab.com.apiservice.mybatis.service.impl.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import oailab.com.apiservice.mybatis.entity.sys.TenantAccount;
|
||||
import oailab.com.apiservice.mybatis.entity.workspace.UploadFiles;
|
||||
import oailab.com.apiservice.mybatis.mapper.workspace.UploadFilesMapper;
|
||||
import oailab.com.apiservice.mybatis.service.workspace.UploadFilesService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @ClassName UploadFilesServiceServiceImpl
|
||||
* @Description
|
||||
* @Author dennis
|
||||
* @blog
|
||||
* @date 8/3/24 AM10:59
|
||||
* @Version 1.0
|
||||
**/
|
||||
@Service
|
||||
public class UploadFilesServiceServiceImpl extends ServiceImpl<UploadFilesMapper, UploadFiles> implements UploadFilesService {
|
||||
|
||||
@Override
|
||||
public void delete(TenantAccount account, String id) {
|
||||
|
||||
// TODO Permission validation
|
||||
|
||||
LambdaUpdateWrapper<UploadFiles> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(UploadFiles::getId, id);
|
||||
updateWrapper.set(UploadFiles::getDeleted, true);
|
||||
this.update(updateWrapper);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package oailab.com.apiservice.mybatis.service.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import oailab.com.apiservice.mybatis.entity.sys.SystemParam;
|
||||
import oailab.com.apiservice.request.input.sys.SystemParamsUpdateInput;
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName SystemParamService
|
||||
* @Description 系统参数
|
||||
* @Author bianmaren
|
||||
* @blog <a href="http://www.bianmaren.com">编码人</a>
|
||||
* @date 2024/6/17 下午5:41
|
||||
* @Version 1.0
|
||||
**/
|
||||
public interface SystemParamService extends IService<SystemParam> {
|
||||
|
||||
Boolean updateSystemParam(SystemParamsUpdateInput input);
|
||||
|
||||
String getSystemParamValue(String name);
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package oailab.com.apiservice.mybatis.service.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import oailab.com.apiservice.mybatis.entity.sys.TenantAccount;
|
||||
import oailab.com.apiservice.request.input.sys.ModifyPwInput;
|
||||
import oailab.com.apiservice.request.input.sys.RecoverPwInput;
|
||||
import oailab.com.apiservice.request.input.sys.RegisterInput;
|
||||
import oailab.com.apiservice.request.input.sys.TenantAccountUpdateInput;
|
||||
import oailab.com.apiservice.request.output.sys.LoginOutput;
|
||||
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 租户账户
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/27/24 PM11:19
|
||||
**/
|
||||
public interface TenantAccountService extends IService<TenantAccount> {
|
||||
TenantAccount getByAccount(String account);
|
||||
|
||||
Map<String, Object> getJwtPayload(TenantAccount account);
|
||||
|
||||
TenantAccount update(TenantAccountUpdateInput input, String accountId);
|
||||
|
||||
void updatePassword(String accountId, ModifyPwInput input);
|
||||
|
||||
String resetPassword(String accountId, RecoverPwInput input);
|
||||
|
||||
String register(RegisterInput input);
|
||||
|
||||
/**
|
||||
* 更新账户角色
|
||||
* @param accountId 账户ID
|
||||
* @param roleCode 角色编码
|
||||
*/
|
||||
void updateAccountRole(String accountId, String roleCode);
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package oailab.com.apiservice.mybatis.service.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import oailab.com.apiservice.mybatis.entity.sys.Tenant;
|
||||
|
||||
/**
|
||||
* @ClassName TenantService
|
||||
* @Description 租户
|
||||
* @Author bianmaren
|
||||
* @blog <a href="http://www.bianmaren.com">编码人</a>
|
||||
* @date 2024/6/17 下午5:41
|
||||
* @Version 1.0
|
||||
**/
|
||||
public interface TenantService extends IService<Tenant> {
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package oailab.com.apiservice.mybatis.service.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import oailab.com.apiservice.mybatis.entity.sys.TenantWorkspaceJoin;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* TenantWorkspaceJoinService
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
* @version 1.0
|
||||
**/
|
||||
public interface TenantWorkspaceJoinService extends IService<TenantWorkspaceJoin> {
|
||||
boolean isJoin(String accountId, String workspaceId);
|
||||
List<TenantWorkspaceJoin> getJoins(String workspaceId);
|
||||
TenantWorkspaceJoin getJoin(String workspaceId,String accountId);
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package oailab.com.apiservice.mybatis.service.sys;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import oailab.com.apiservice.mybatis.entity.sys.TenantAccount;
|
||||
import oailab.com.apiservice.mybatis.entity.sys.TenantWorkspace;
|
||||
import oailab.com.apiservice.request.input.workspace.TenantWorkspaceCreateInput;
|
||||
import oailab.com.apiservice.request.input.workspace.TenantWorkspaceUpdateInput;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Workspace service
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 6/17/24 PM11:19
|
||||
* @version 1.0
|
||||
**/
|
||||
public interface TenantWorkspaceService extends IService<TenantWorkspace> {
|
||||
TenantWorkspace getDefaultWorkspace(String accountId);
|
||||
TenantWorkspace update(TenantWorkspaceUpdateInput input);
|
||||
List<TenantWorkspace> getJoinWorkspaces(String accountId);
|
||||
TenantWorkspace create(TenantWorkspaceCreateInput input, TenantAccount account);
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package oailab.com.apiservice.mybatis.service.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import oailab.com.apiservice.mybatis.entity.workspace.EndUsers;
|
||||
|
||||
/**
|
||||
* EndUsersService
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 8/12/24
|
||||
**/
|
||||
public interface EndUsersService extends IService<EndUsers> {
|
||||
long countBySessionId(String sessionId);
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package oailab.com.apiservice.mybatis.service.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import oailab.com.apiservice.enums.workspace.SitesTypeEnum;
|
||||
import oailab.com.apiservice.mybatis.entity.workspace.Sites;
|
||||
import oailab.com.apiservice.request.input.workspace.UpdateSiteInput;
|
||||
|
||||
|
||||
/**
|
||||
* SitesService
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 8/12/24
|
||||
**/
|
||||
public interface SitesService extends IService<Sites> {
|
||||
|
||||
Sites getByCode(String code);
|
||||
|
||||
String generateCode();
|
||||
|
||||
Sites getByAppId(String appId);
|
||||
|
||||
Sites getByAppId(String appId, SitesTypeEnum type);
|
||||
|
||||
Sites update(UpdateSiteInput input);
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package oailab.com.apiservice.mybatis.service.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import oailab.com.apiservice.mybatis.entity.workspace.TagBindings;
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName TagBindingsService
|
||||
* @Description
|
||||
* @Author bianmaren
|
||||
* @blog <a href="http://www.bianmaren.com">编码人</a>
|
||||
* @date 7/3/24 PM11:41
|
||||
* @Version 1.0
|
||||
**/
|
||||
public interface TagBindingsService extends IService<TagBindings> {
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package oailab.com.apiservice.mybatis.service.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import oailab.com.apiservice.mybatis.entity.workspace.Tags;
|
||||
|
||||
/**
|
||||
* @ClassName TagsService
|
||||
* @Description
|
||||
* @Author bianmaren
|
||||
* @blog <a href="http://www.bianmaren.com">编码人</a>
|
||||
* @date 7/3/24 PM11:42
|
||||
* @Version 1.0
|
||||
**/
|
||||
public interface TagsService extends IService<Tags> {
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package oailab.com.apiservice.mybatis.service.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import oailab.com.apiservice.mybatis.entity.sys.TenantWorkspace;
|
||||
import oailab.com.apiservice.mybatis.entity.workspace.TenantDefaultModels;
|
||||
import oailab.com.apiservice.request.input.workspace.TenantDefaultModelsSettingInput;
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName TenantDefaultModelsService
|
||||
* @Description
|
||||
* @Author bianmaren
|
||||
* @blog <a href="http://www.bianmaren.com">编码人</a>
|
||||
* @date 7/11/24 AM2:39
|
||||
* @Version 1.0
|
||||
**/
|
||||
public interface TenantDefaultModelsService extends IService<TenantDefaultModels> {
|
||||
void update(TenantWorkspace workspace, TenantDefaultModelsSettingInput input);
|
||||
TenantDefaultModels get(String workspaceId,String modelType);
|
||||
boolean checkConfig(String workspaceId,String types);
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package oailab.com.apiservice.mybatis.service.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import oailab.com.apiservice.mybatis.entity.workspace.TenantPreferredModelProviders;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* TenantPreferredModelProvidersService
|
||||
*
|
||||
* @author Benny Deng
|
||||
* @version 1.0
|
||||
* @see <a href="http://www.bianmaren.com">Benny Deng</a>
|
||||
* @since 8/23/24
|
||||
**/
|
||||
public interface TenantPreferredModelProvidersService extends IService<TenantPreferredModelProviders> {
|
||||
List<TenantPreferredModelProviders> list(String workspaceId);
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package oailab.com.apiservice.mybatis.service.workspace;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import oailab.com.apiservice.mybatis.entity.sys.TenantAccount;
|
||||
import oailab.com.apiservice.mybatis.entity.workspace.UploadFiles;
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName UploadFilesService
|
||||
* @Description
|
||||
* @Author dennis
|
||||
* @blog
|
||||
* @date 8/3/24 AM10:57
|
||||
* @Version 1.0
|
||||
**/
|
||||
public interface UploadFilesService extends IService<UploadFiles> {
|
||||
void delete(TenantAccount account, String id);
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user