代码格式化

This commit is contained in:
none
2023-04-07 10:03:45 +08:00
parent fc8ff14a24
commit f437b3ad4d
252 changed files with 7467 additions and 5770 deletions

View File

@@ -1,14 +1,19 @@
/**
* This file is part of the PlayEdu.
* (c) 杭州白书科技有限公司
*/
package xyz.playedu.api.config;
import static com.google.code.kaptcha.Constants.*;
import com.google.code.kaptcha.impl.DefaultKaptcha;
import com.google.code.kaptcha.util.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Properties;
import static com.google.code.kaptcha.Constants.*;
@Configuration
public class KaptchaConfig {

View File

@@ -1,15 +1,23 @@
/**
* This file is part of the PlayEdu.
* (c) 杭州白书科技有限公司
*/
package xyz.playedu.api.config;
import io.minio.MinioAsyncClient;
import io.minio.MinioClient;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import xyz.playedu.api.vendor.PlayEduMinioClient;
/**
* @Author 杭州白书科技有限公司
*
* @create 2023/2/28 16:38
*/
@Data
@@ -41,7 +49,11 @@ public class MinioConfig {
@Bean
public PlayEduMinioClient getPlayEduMinioClient() {
MinioAsyncClient client = PlayEduMinioClient.builder().endpoint(this.endPoint).credentials(this.accessKey, this.secretKey).build();
MinioAsyncClient client =
PlayEduMinioClient.builder()
.endpoint(this.endPoint)
.credentials(this.accessKey, this.secretKey)
.build();
return new PlayEduMinioClient(client);
}
}

View File

@@ -1,8 +1,13 @@
/**
* This file is part of the PlayEdu.
* (c) 杭州白书科技有限公司
*/
package xyz.playedu.api.config;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -15,5 +20,4 @@ public class MybatisPlusConfig {
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
return interceptor;
}
}

View File

@@ -1,6 +1,11 @@
/**
* This file is part of the PlayEdu.
* (c) 杭州白书科技有限公司
*/
package xyz.playedu.api.config;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@@ -10,5 +15,4 @@ public class PlayEduConfig {
@Value("${spring.profiles.active}")
private String env;
}

View File

@@ -1,3 +1,7 @@
/**
* This file is part of the PlayEdu.
* (c) 杭州白书科技有限公司
*/
package xyz.playedu.api.config;
import org.springframework.context.annotation.Bean;
@@ -11,7 +15,8 @@ import org.springframework.data.redis.serializer.StringRedisSerializer;
public class RedisConfig {
@Bean(name = "redisTemplate")
public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
public RedisTemplate<String, Object> redisTemplate(
RedisConnectionFactory redisConnectionFactory) {
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
redisTemplate.setConnectionFactory(redisConnectionFactory);
@@ -20,11 +25,11 @@ public class RedisConfig {
redisTemplate.setKeySerializer(stringRedisSerializer);
redisTemplate.setHashKeySerializer(stringRedisSerializer);
GenericJackson2JsonRedisSerializer jsonRedisSerializer = new GenericJackson2JsonRedisSerializer();
GenericJackson2JsonRedisSerializer jsonRedisSerializer =
new GenericJackson2JsonRedisSerializer();
redisTemplate.setValueSerializer(jsonRedisSerializer);
redisTemplate.setHashValueSerializer(jsonRedisSerializer);
return redisTemplate;
}
}

View File

@@ -1,3 +1,7 @@
/**
* This file is part of the PlayEdu.
* (c) 杭州白书科技有限公司
*/
package xyz.playedu.api.config;
import org.springframework.beans.factory.config.BeanDefinition;
@@ -6,6 +10,7 @@ import org.springframework.context.annotation.AnnotationBeanNameGenerator;
/**
* @Author 杭州白书科技有限公司
*
* @create 2023/3/2 21:53
*/
public class UniqueNameGenerator extends AnnotationBeanNameGenerator {

View File

@@ -1,12 +1,19 @@
/**
* This file is part of the PlayEdu.
* (c) 杭州白书科技有限公司
*/
package xyz.playedu.api.config;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import xyz.playedu.api.middleware.AdminMiddleware;
import xyz.playedu.api.middleware.FrontMiddleware;
@@ -14,11 +21,9 @@ import xyz.playedu.api.middleware.FrontMiddleware;
@Slf4j
public class WebMvcConfig implements WebMvcConfigurer {
@Resource
private AdminMiddleware adminMiddleware;
@Resource private AdminMiddleware adminMiddleware;
@Autowired
private FrontMiddleware frontMiddleware;
@Autowired private FrontMiddleware frontMiddleware;
@Override
public void addInterceptors(InterceptorRegistry registry) {