dev #1

Merged
bunny merged 20 commits from dev into master 2024-05-10 09:25:15 +08:00
85 changed files with 3391 additions and 1007 deletions

View File

@ -1,4 +1,4 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@ -19,10 +19,36 @@
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.1</version>
</dependency>
<!-- 数据库代码生成器 - 新版 -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-generator</artifactId>
<version>3.5.6</version>
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-engine-core</artifactId>
<version>2.3</version>
</dependency>
<!-- 数据库代码生成器 - 旧版 -->
<!-- <dependency> -->
<!-- <groupId>com.baomidou</groupId> -->
<!-- <artifactId>mybatis-plus-generator</artifactId> -->
<!-- <version>3.4.1</version> -->
<!-- </dependency> -->
<!-- <dependency> -->
<!-- <groupId>org.apache.velocity</groupId> -->
<!-- <artifactId>velocity-engine-core</artifactId> -->
<!-- <version>2.0</version> -->
<!-- </dependency> -->
</dependencies>
</project>

View File

@ -1,4 +1,4 @@
package cn.bunny.common.service.constant;
package cn.bunny.common.constant;
import lombok.Data;
@ -6,7 +6,7 @@ import lombok.Data;
* 信息提示常量类
*/
@Data
public class MessageConstant {
public class CommonMessageConstant {
public static final String PASSWORD_ERROR = "密码错误";
public static final String OLD_PASSWORD_ERROR = "旧密码不匹配";
public static final String OLD_PASSWORD_SAME_NEW_PASSWORD = "旧密码与新密码相同";

View File

@ -1,4 +1,4 @@
package cn.bunny.common.service.constant;
package cn.bunny.common.constant;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package cn.bunny.common.service.constant;
package cn.bunny.common.constant;
import lombok.Data;

View File

@ -0,0 +1,14 @@
package cn.bunny.common.constant;
import lombok.Data;
/**
* 邮箱消息
*/
@Data
public class MailMessageConstant {
public static final String EMPTY_SEND_OBJECT = "空发送对象";
public static final String ADDRESS_NOT_NULL = "收件人不能为空";
public static final String TITLE_NOT_NULL = "标题不能为空";
public static final String SEND_MESSAGE_NOT_NULL = "发送消息不能为空";
}

View File

@ -0,0 +1,19 @@
package cn.bunny.common.constant;
import lombok.Data;
@Data
public class MinioMessageConstant {
public static final String BUCKET_EXISTS_EXCEPTION = "查询文化部对象失败";
public static final String DELETE_BUCKET_EXCEPTION = "删除文件对象失败";
public static final String GET_BUCKET_EXCEPTION = "获取文件信息失败";
public static final String QUERY_BUCKET_EXCEPTION = "查询文件信息失败";
public static final String CREATE_BUCKET_EXCEPTION = "创建文件对象失败";
public static final String UPDATE_BUCKET_EXCEPTION = "更新文件对象失败";
public static final String COMPOSE_OBJECT_EXCEPTION = "对象错误";
public static final String COPY_BUCKET_EXCEPTION = "复制文件内容失败";
public static final String DISABLE_BUCKET_EXCEPTION = "禁用文件失败";
public static final String ENABLE_BUCKET_EXCEPTION = "启用文件失败";
public static final String DOWNLOAD_BUCKET_EXCEPTION = "下载文件失败";
public static final String UPLOAD_BUCKET_EXCEPTION = "上传文件失败";
}

View File

@ -1,4 +1,4 @@
package cn.bunny.common.service.constant;
package cn.bunny.common.constant;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package cn.bunny.common.service.constant;
package cn.bunny.common.constant;
import lombok.Data;

View File

@ -0,0 +1,14 @@
package cn.bunny.common.constant;
import lombok.Data;
/**
* 数据库中自动填充字段
*/
@Data
public class SQLAutoFillConstant {
public static final String SET_CREATE_TIME = "setCreateTime";
public static final String SET_UPDATE_TIME = "setUpdateTime";
public static final String SET_CREATE_USER = "setCreateUser";
public static final String SET_UPDATE_USER = "setUpdateUser";
}

View File

@ -0,0 +1,12 @@
package cn.bunny.common.constant;
import lombok.Data;
import java.util.Arrays;
import java.util.List;
@Data
public class SecurityConstant {
public static String[] annotations = {"/", "/test/**", "/diagram-viewer/**", "/editor-app/**", "/*.html", "/admin/system/index/login", "/favicon.ico", "/swagger-resources/**", "/webjars/**", "/v3/**", "/swagger-ui.html/**", "/doc.html"};
public static List<String> annotationsList = Arrays.asList(annotations);
}

View File

@ -1,4 +1,4 @@
package cn.bunny.common.service.constant;
package cn.bunny.common.constant;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package cn.bunny.common.service.constant;
package cn.bunny.common.constant;
import lombok.Data;

View File

@ -0,0 +1,84 @@
package cn.bunny.common.generator;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.OutputFile;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import org.apache.ibatis.annotations.Mapper;
import java.util.Collections;
public class NewCodeGet {
// 数据连接
public static final String sqlHost = "jdbc:mysql://106.15.251.123:3305/guigu-oa?serverTimezone=GMT%2B8&useSSL=false&characterEncoding=utf-8&allowPublicKeyRetrieval=true";
// 作者名称
public static final String author = "Bunny";
// 公共路径
public static final String outputDir = "G:\\web项目\\Bunny-Cli\\Java\\java-template\\service";
// 实体类名称
public static final String entity = "Bunny";
public static void main(String[] args) {
Generation("sys_menu");
}
/**
* 根据表名生成相应结构代码
*
* @param tableName 表名
*/
public static void Generation(String... tableName) {
// TODO 修改数据库路径账户密码
FastAutoGenerator.create(sqlHost, "root", "02120212")
.globalConfig(builder -> {
// 添加作者名称
builder.author(author)
// 启用swagger
.enableSwagger()
// 指定输出目录
.outputDir(outputDir + "/src/main/java");
})
.packageConfig(builder -> {
builder.entity(entity)// 实体类包名
// TODO 父包名如果为空将下面子包名必须写全部 否则就只需写子包名
.parent("cn.bunny.service")
.controller("controller")// 控制层包名
.mapper("mapper")// mapper层包名
.service("service")// service层包名
.serviceImpl("service.impl")// service实现类包名
// 自定义mapper.xml文件输出目录
.pathInfo(Collections.singletonMap(OutputFile.xml, outputDir + "/src/main/resources/mapper"));
})
.strategyConfig(builder -> {
// 设置要生成的表名
builder.addInclude(tableName)
//.addTablePrefix("sys_")// TODO 设置表前缀过滤
.entityBuilder()
.enableLombok()
.enableChainModel()
.naming(NamingStrategy.underline_to_camel)// 数据表映射实体命名策略默认下划线转驼峰underline_to_camel
.columnNaming(NamingStrategy.underline_to_camel)// 表字段映射实体属性命名规则默认null不指定按照naming执行
.idType(IdType.AUTO)// TODO 添加全局主键类型
.formatFileName("%s")// 格式化实体名称%s取消首字母I,
.mapperBuilder()
.mapperAnnotation(Mapper.class)// 开启mapper注解
.enableBaseResultMap()// 启用xml文件中的BaseResultMap 生成
.enableBaseColumnList()// 启用xml文件中的BaseColumnList
.formatMapperFileName("%sMapper")// 格式化Dao类名称
.formatXmlFileName("%sMapper")// 格式化xml文件名称
.serviceBuilder()
.formatServiceFileName("%sService")// 格式化 service 接口文件名称
.formatServiceImplFileName("%sServiceImpl")// 格式化 service 接口文件名称
.controllerBuilder()
.enableRestStyle();
})
// .injectionConfig(consumer -> {
// Map<String, String> customFile = new HashMap<>();
// // 配置DTO需要的话但是需要有能配置Dto的模板引擎比如freemarker但是这里我们用的VelocityEngine因此不多作介绍
// customFile.put(outputDir, "/src/main/resources/templates/entityDTO.java.ftl");
// consumer.customFile(customFile);
// })
.execute();
}
}

View File

@ -0,0 +1,57 @@
package cn.bunny.common.generator;
public class OldCodeGet {
public static void main(String[] args) {
// // 1创建代码生成器
// AutoGenerator mpg = new AutoGenerator();
//
// // 2全局配置
// // 全局配置
// GlobalConfig gc = new GlobalConfig();
// // TODO 需要修改路径名称
// gc.setOutputDir("F:\\web项目\\Bunny-Cli\\Java\\java-template\\service" + "/src/main/java");
// gc.setServiceName("%sService"); // 去掉Service接口的首字母I
// gc.setAuthor("bunny");
// gc.setOpen(false);
// mpg.setGlobalConfig(gc);
//
// // 3数据源配置
// DataSourceConfig dsc = new DataSourceConfig();
// // TODO 需要修改数据库
// dsc.setUrl("jdbc:mysql://106.15.251.123:3305/guigu-oa?serverTimezone=GMT%2B8&useSSL=false&characterEncoding=utf-8&allowPublicKeyRetrieval=true");
// dsc.setDriverName("com.mysql.cj.jdbc.Driver");
// dsc.setUsername("root");
// dsc.setPassword("02120212");
// dsc.setDbType(DbType.MYSQL);
// mpg.setDataSource(dsc);
//
// // 4包配置
// PackageConfig pc = new PackageConfig();
// pc.setParent("cn.bunny");
// // TODO 需要修改模块名
// pc.setModuleName("service");
// pc.setController("controller");
// pc.setService("service");
// pc.setMapper("mapper");
// mpg.setPackageInfo(pc);
//
// // 5策略配置
// StrategyConfig strategy = getStrategyConfig();
// mpg.setStrategy(strategy);
//
// // 6执行
// mpg.execute();
// }
//
// private static StrategyConfig getStrategyConfig() {
// StrategyConfig strategy = new StrategyConfig();
// // TODO 要生成的表
// strategy.setInclude("sys_menu", "sys_role_menu");
// strategy.setNaming(NamingStrategy.underline_to_camel);// 数据库表映射到实体的命名策略
// strategy.setColumnNaming(NamingStrategy.underline_to_camel);// 数据库表字段映射到实体的命名策略
// strategy.setEntityLombokModel(true); // lombok 模型 @Accessors(chain = true) setter链式操作
// strategy.setRestControllerStyle(true); // restful api风格控制器
// strategy.setControllerMappingHyphenStyle(true); // url中驼峰转连字符
// return strategy;
}
}

View File

@ -0,0 +1,25 @@
package cn.bunny.common.properties;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Component
@ConfigurationProperties(prefix = "bunny.snowflake")
@Data
public class SnowflakeProperties {
// 数据中心id
private Long datacenterId;
// 数据中心id位数
private Long datacenterBits;
// 机器id
private Long workerId;
// 机器id位数
private Long workerBits;
// 序列id所占位数
private Long sequenceBits;
// 时间戳起始点毫秒
private Long twepoch;
// 单次批量生成id的最大数量
private Integer maxBatchCount;
}

View File

@ -1,4 +1,4 @@
package cn.bunny.common.service.result;
package cn.bunny.common.result;
import cn.bunny.enums.ResultCodeEnum;
import lombok.AllArgsConstructor;
@ -24,9 +24,7 @@ public class Result<T> {
*/
protected static <T> Result<T> build(T data) {
Result<T> result = new Result<>();
if (data != null) {
result.setData(data);
}
result.setData(data);
return result;
}
@ -56,6 +54,7 @@ public class Result<T> {
Result<T> result = build(body);
result.setCode(code);
result.setMessage(message);
result.setData(null);
return result;
}

View File

@ -18,10 +18,14 @@
</modules>
<dependencies>
<!-- minio -->
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
<groupId>cn.bunny</groupId>
<artifactId>model</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -19,7 +19,7 @@
<dependencies>
<dependency>
<groupId>cn.bunny</groupId>
<artifactId>model</artifactId>
<artifactId>common-utils</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<!-- redis -->

View File

@ -31,4 +31,10 @@ public class Knife4jConfig {
public GroupedOpenApi groupedOpenApi() {
return GroupedOpenApi.builder().group("管理员接口请求").pathsToMatch("/admin/**").build();
}
// 测试相关分类接口
@Bean
public GroupedOpenApi testGroupedOpenApi() {
return GroupedOpenApi.builder().group("测试相关分类接口").pathsToMatch("/test/**").build();
}
}

View File

@ -0,0 +1,39 @@
package cn.bunny.common.service.config;
import cn.bunny.common.service.context.BaseContext;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;
import java.util.Date;
/**
* 配置MP在修改和新增时的操作
*/
@Component
public class MyBatisPlusFieldConfig implements MetaObjectHandler {
/**
* 使用mp做添加操作时候这个方法执行
*/
@Override
public void insertFill(MetaObject metaObject) {
// 设置属性值
this.setFieldValByName("createTime", new Date(), metaObject);
this.setFieldValByName("updateTime", new Date(), metaObject);
this.setFieldValByName("deleteStatus", 1, metaObject);
if (BaseContext.getUsername() != null) {
this.setFieldValByName("createBy", BaseContext.getUsername(), metaObject);
this.setFieldValByName("updateBy", BaseContext.getUsername(), metaObject);
}
}
/**
* 使用mp做修改操作时候这个方法执行
*/
@Override
public void updateFill(MetaObject metaObject) {
this.setFieldValByName("updateTime", new Date(), metaObject);
this.setFieldValByName("updateBy", BaseContext.getUsername(), metaObject);
}
}

View File

@ -14,7 +14,6 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
* Mybatis-Plus配置类
*/
@EnableTransactionManagement
// @MapperScan("cn.bunny.service.mapper")
@Configuration
@Slf4j
public class MybatisPlusConfig {

View File

@ -1,8 +1,8 @@
package cn.bunny.common.service.config;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@ -10,9 +10,25 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Slf4j
public class WebMvcConfiguration implements WebMvcConfigurer {
@Override
public void addResourceHandlers(@NotNull ResourceHandlerRegistry registry) {
public void addResourceHandlers(ResourceHandlerRegistry registry) {
log.info("WebMvcConfiguration===>设置");
registry.addResourceHandler("/favicon.ico").addResourceLocations("classpath:/");
registry.addResourceHandler("/doc.html").addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
}
/**
* 跨域配置
*
* @param registry 跨域注册表
*/
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
// 是否发送Cookies
.allowCredentials(true)
// 放行哪些原始域
.allowedOriginPatterns("*").allowedMethods("GET", "POST", "PUT", "DELETE").allowedHeaders("*").exposedHeaders("*");
}
}

View File

@ -2,6 +2,7 @@ package cn.bunny.common.service.context;
public class BaseContext {
private static final ThreadLocal<Long> userId = new ThreadLocal<>();
private static final ThreadLocal<String> username = new ThreadLocal<String>();
private static final ThreadLocal<Long> wareId = new ThreadLocal<>();
private static final ThreadLocal<Long> adminId = new ThreadLocal<>();
@ -18,6 +19,14 @@ public class BaseContext {
userId.remove();
}
public static String getUsername() {
return username.get();
}
public static void setUsername(String _username) {
username.set(_username);
}
// adminId 相关
public static Long getAdminId() {
return adminId.get();

View File

@ -1,7 +1,7 @@
package cn.bunny.common.service.exception;
import cn.bunny.common.service.constant.MessageConstant;
import cn.bunny.common.service.result.Result;
import cn.bunny.common.constant.CommonMessageConstant;
import cn.bunny.common.result.Result;
import cn.bunny.enums.ResultCodeEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
@ -72,10 +72,10 @@ public class GlobalExceptionHandler {
// 截取用户名
String username = message.split(" ")[2];
// 错误信息
String errorMessage = username + MessageConstant.ALREADY_EXISTS;
String errorMessage = username + CommonMessageConstant.ALREADY_EXISTS;
return Result.error(errorMessage);
} else {
return Result.error(MessageConstant.UNKNOWN_ERROR);
return Result.error(CommonMessageConstant.UNKNOWN_ERROR);
}
}
}

View File

@ -0,0 +1,21 @@
package cn.bunny.common.service.utils;
import cn.bunny.common.service.exception.BunnyException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.StringUtils;
@Slf4j
public class EmptyUtil {
/**
* 是否为空
*
* @param value 判断值
* @param message 错误消息
*/
public static void isEmpty(Object value, String message) {
if (value == null || !StringUtils.hasText(value.toString())) {
log.error("为空对象错误:{}{}", value, message);
throw new BunnyException(message);
}
}
}

View File

@ -0,0 +1,206 @@
package cn.bunny.common.service.utils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.conn.ClientConnectionManager;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class HttpUtil {
public static HttpResponse doGet(String host, String path, String method, Map<String, String> headers, Map<String, String> querys) throws Exception {
HttpClient httpClient = wrapClient(host);
HttpGet request = new HttpGet(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
return httpClient.execute(request);
}
public static HttpResponse doPost(String host, String path, String method, Map<String, String> headers, Map<String, String> querys, Map<String, String> bodys) throws Exception {
HttpClient httpClient = wrapClient(host);
HttpPost request = new HttpPost(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
if (bodys != null) {
List<NameValuePair> nameValuePairList = new ArrayList<NameValuePair>();
for (String key : bodys.keySet()) {
nameValuePairList.add(new BasicNameValuePair(key, bodys.get(key)));
}
UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(nameValuePairList, "utf-8");
formEntity.setContentType("application/x-www-form-urlencoded; charset=UTF-8");
request.setEntity(formEntity);
}
return httpClient.execute(request);
}
public static HttpResponse doPost(String host, String path, String method, Map<String, String> headers, Map<String, String> querys, String body) throws Exception {
HttpClient httpClient = wrapClient(host);
HttpPost request = new HttpPost(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
if (StringUtils.isNotBlank(body)) {
request.setEntity(new StringEntity(body, "utf-8"));
}
return httpClient.execute(request);
}
public static HttpResponse doPost(String host, String path, String method, Map<String, String> headers, Map<String, String> querys, byte[] body) throws Exception {
HttpClient httpClient = wrapClient(host);
HttpPost request = new HttpPost(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
if (body != null) {
request.setEntity(new ByteArrayEntity(body));
}
return httpClient.execute(request);
}
public static HttpResponse doPut(String host, String path, String method, Map<String, String> headers, Map<String, String> querys, String body) throws Exception {
HttpClient httpClient = wrapClient(host);
HttpPut request = new HttpPut(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
if (StringUtils.isNotBlank(body)) {
request.setEntity(new StringEntity(body, "utf-8"));
}
return httpClient.execute(request);
}
public static HttpResponse doPut(String host, String path, String method, Map<String, String> headers, Map<String, String> querys, byte[] body) throws Exception {
HttpClient httpClient = wrapClient(host);
HttpPut request = new HttpPut(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
if (body != null) {
request.setEntity(new ByteArrayEntity(body));
}
return httpClient.execute(request);
}
public static HttpResponse doDelete(String host, String path, String method, Map<String, String> headers, Map<String, String> querys) throws Exception {
HttpClient httpClient = wrapClient(host);
HttpDelete request = new HttpDelete(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
return httpClient.execute(request);
}
private static String buildUrl(String host, String path, Map<String, String> querys) throws UnsupportedEncodingException {
StringBuilder sbUrl = new StringBuilder();
sbUrl.append(host);
if (!StringUtils.isBlank(path)) {
sbUrl.append(path);
}
if (null != querys) {
StringBuilder sbQuery = new StringBuilder();
for (Map.Entry<String, String> query : querys.entrySet()) {
if (!sbQuery.isEmpty()) {
sbQuery.append("&");
}
if (StringUtils.isBlank(query.getKey()) && !StringUtils.isBlank(query.getValue())) {
sbQuery.append(query.getValue());
}
if (!StringUtils.isBlank(query.getKey())) {
sbQuery.append(query.getKey());
if (!StringUtils.isBlank(query.getValue())) {
sbQuery.append("=");
sbQuery.append(URLEncoder.encode(query.getValue(), StandardCharsets.UTF_8));
}
}
}
if (!sbQuery.isEmpty()) {
sbUrl.append("?").append(sbQuery);
}
}
return sbUrl.toString();
}
private static HttpClient wrapClient(String host) {
HttpClient httpClient = new DefaultHttpClient();
if (host.startsWith("https://")) {
sslClient(httpClient);
}
return httpClient;
}
private static void sslClient(HttpClient httpClient) {
try {
SSLContext ctx = SSLContext.getInstance("TLS");
X509TrustManager tm = new X509TrustManager() {
public X509Certificate[] getAcceptedIssuers() {
return null;
}
public void checkClientTrusted(X509Certificate[] xcs, String str) {
}
public void checkServerTrusted(X509Certificate[] xcs, String str) {
}
};
ctx.init(null, new TrustManager[]{tm}, null);
SSLSocketFactory ssf = new SSLSocketFactory(ctx);
ssf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
ClientConnectionManager ccm = httpClient.getConnectionManager();
SchemeRegistry registry = ccm.getSchemeRegistry();
registry.register(new Scheme("https", 443, ssf));
} catch (Exception ex) {
throw new RuntimeException();
}
}
}

View File

@ -0,0 +1,50 @@
package cn.bunny.common.service.utils;
import io.jsonwebtoken.*;
import org.springframework.util.StringUtils;
import java.util.Date;
public class JwtHelper {
private static final long tokenExpiration = 365L * 24 * 60 * 60 * 1000;
private static final String tokenSignKey = "Bunny-Java-Template";
public static String createToken(Long userId, String userName) {
return Jwts.builder()
.setSubject("Bunny-USER")
.setExpiration(new Date(System.currentTimeMillis() + tokenExpiration))
.claim("userId", userId)
.claim("userName", userName)
.signWith(SignatureAlgorithm.HS256, tokenSignKey)
.compressWith(CompressionCodecs.GZIP)
.compact();
}
public static Long getUserId(String token) {
if (!StringUtils.hasText(token)) return null;
Jws<Claims> claimsJws = Jwts.parser().setSigningKey(tokenSignKey).parseClaimsJws(token);
Claims claims = claimsJws.getBody();
Integer userId = (Integer) claims.get("userId");
return userId.longValue();
}
public static String getUserName(String token) {
if (!StringUtils.hasText(token)) return "";
Jws<Claims> claimsJws = Jwts.parser().setSigningKey(tokenSignKey).parseClaimsJws(token);
Claims claims = claimsJws.getBody();
return (String) claims.get("userName");
}
public static void removeToken(String token) {
// jwttoken无需删除客户端扔掉即可
}
public static void main(String[] args) {
String token = JwtHelper.createToken(7L, "admin");
System.out.println(token);
System.out.println(JwtHelper.getUserId(token));
System.out.println(JwtHelper.getUserName(token));
}
}

View File

@ -0,0 +1,23 @@
package cn.bunny.common.service.utils;
import cn.bunny.common.result.Result;
import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import java.io.IOException;
public class ResponseUtil {
public static void out(HttpServletResponse response, Result r) {
ObjectMapper mapper = new ObjectMapper();
response.setStatus(HttpStatus.OK.value());
response.setContentType(MediaType.APPLICATION_JSON_UTF8_VALUE);
try {
mapper.writeValue(response.getWriter(), r);
} catch (IOException e) {
e.printStackTrace();
}
}
}

View File

@ -0,0 +1,149 @@
package cn.bunny.common.service.utils;
import cn.bunny.common.properties.SnowflakeProperties;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
@Component
public class SnowflakeIdGenerator {
// 数据中心id
private final long datacenterId;
// 数据中心id位数
private final long datacenterBits;
// 机器id
private final long workerId;
// 机器id位数
private final long workerBits;
// 序列id所占位数
private final long sequenceBits;
// 时间戳起始点毫秒
private final long twepoch;
// 数据中心最大id
private final long maxDatacenterId;
// 机器最大id
private final long maxWorkerId;
// 最大序列号
private final long maxSequence;
// 机器id左移位数
private final long workerIdShift;
// 数据中心id左移位数
private final long datacenterIdShift;
// 毫秒数左移位数
private final long timestampLeftShift;
// 单次批量生成id的最大数量
private final int maxBatchCount;
// 序列号
private long sequence = 0L;
// 上一次时间戳
private long lastTimestamp = -1L;
public SnowflakeIdGenerator(SnowflakeProperties properties) {
// 数据中心id
this.datacenterId = properties.getDatacenterId();
// 数据中心id位数
this.datacenterBits = properties.getDatacenterBits();
// 机器id
this.workerId = properties.getWorkerId();
// 机器id位数
this.workerBits = properties.getWorkerBits();
// 序列id所占位数
this.sequenceBits = properties.getSequenceBits();
// 时间戳起始点毫秒
this.twepoch = properties.getTwepoch();
// 数据中心最大id
this.maxDatacenterId = -1L ^ (-1L << properties.getDatacenterBits());
// 机器最大id
this.maxWorkerId = -1L ^ (-1L << properties.getWorkerBits());
// 最大序列号
this.maxSequence = -1L ^ (-1L << properties.getSequenceBits());
this.workerIdShift = properties.getSequenceBits();
// 数据中心id左移位数
this.datacenterIdShift = properties.getSequenceBits() + properties.getWorkerBits();
// 毫秒数左移位数
this.timestampLeftShift = properties.getSequenceBits() + properties.getWorkerBits() + properties.getSequenceBits();
// 单次批量生成id的最大数量
this.maxBatchCount = properties.getMaxBatchCount();
// 校验datacenterId和workerId是否超出最大值
if (datacenterId > maxDatacenterId || datacenterId < 0) {
throw new IllegalArgumentException(String.format("数据中心Id不能大于%d或小于0", maxDatacenterId));
}
if (workerId > maxWorkerId || workerId < 0) {
throw new IllegalArgumentException(String.format("机器Id不能大于%d或小于0", maxWorkerId));
}
}
/**
* id生成方法(单个)
*/
public synchronized long nextId() {
// 获取当前时间的毫秒数
long timestamp = currentTime();
// 判断时钟是否回拨
if (timestamp < lastTimestamp) {
throw new RuntimeException(String.format("时钟回拨,回拨毫秒数:%d", lastTimestamp - timestamp));
}
// 设置序列号
if (lastTimestamp == timestamp) {
// 设置序列号递增如果当前毫秒内序列号已经达到最大值则直到下一毫秒在重新从0开始计算序列号
sequence = (sequence + 1) & maxSequence;
if (sequence == 0) {
timestamp = tilNextMillis(lastTimestamp);
}
} else {
sequence = 0L;
}
lastTimestamp = timestamp;
// 计算id
return ((timestamp - twepoch) << timestampLeftShift) |
(datacenterId << datacenterIdShift) |
(workerId << workerIdShift) |
sequence;
}
/**
* id生成方法(批量)
*/
public synchronized List<Long> nextIds(int count) {
if (count > maxBatchCount || count < 0) {
throw new IllegalArgumentException(String.format("批量生成id的数量不能大于%d或小于0", maxBatchCount));
}
List<Long> ids = new ArrayList<>(count);
for (int i = 0; i < count; i++) {
ids.add(nextId());
}
return ids;
}
/**
* 循环等待直至获取到新的毫秒时间戳
* 确保生成的时间戳总是向前移动的即使在相同的毫秒内请求多个ID时也能保持唯一性
*/
private long tilNextMillis(long lastTimestamp) {
long timestamp = currentTime();
// 循环等待直至获取到新的毫秒时间戳
while (timestamp <= lastTimestamp) {
timestamp = currentTime();
}
return timestamp;
}
/**
* 获取当前时间的毫秒数
*/
private long currentTime() {
return System.currentTimeMillis();
}
}

View File

@ -1,4 +1,4 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@ -18,6 +18,10 @@
</properties>
<dependencies>
<dependency>
<groupId>cn.bunny</groupId>
<artifactId>service-utils</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,85 @@
package cn.bunny.security.config;
import cn.bunny.common.constant.SecurityConstant;
import cn.bunny.security.custom.CustomPasswordEncoder;
import cn.bunny.security.filter.TokenAuthenticationFilter;
import cn.bunny.security.filter.TokenLoginFilter;
import cn.bunny.security.handelr.SecurityAccessDeniedHandler;
import cn.bunny.security.handelr.SecurityAuthenticationEntryPoint;
import cn.bunny.security.service.CustomAuthorizationManagerService;
import cn.bunny.security.service.CustomUserDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration;
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
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.core.session.SessionRegistry;
import org.springframework.security.core.session.SessionRegistryImpl;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.security.web.util.matcher.RegexRequestMatcher;
@Configuration
@EnableWebSecurity
@EnableMethodSecurity
public class WebSecurityConfig {
@Autowired
AuthenticationConfiguration authenticationConfiguration;
@Autowired
private RedisTemplate<String, Object> redisTemplate;
@Autowired
private CustomUserDetailsService customUserDetailsService;
@Autowired
private CustomPasswordEncoder customPasswordEncoder;
@Autowired
private CustomAuthorizationManagerService customAuthorizationManager;
@Bean
public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Exception {
httpSecurity
// 前端段分离不需要---禁用明文验证
.httpBasic(AbstractHttpConfigurer::disable)
// 前端段分离不需要---禁用默认登录页
.formLogin(AbstractHttpConfigurer::disable)
// 前端段分离不需要---禁用退出页
.logout(AbstractHttpConfigurer::disable)
// 前端段分离不需要---csrf攻击
.csrf(AbstractHttpConfigurer::disable)
// 跨域访问权限如果需要可以关闭后自己配置跨域访问
.cors(AbstractHttpConfigurer::disable)
// 前后端分离不需要---因为是无状态的
.sessionManagement(AbstractHttpConfigurer::disable)
// 前后端分离不需要---记住我e -> e.rememberMeParameter("rememberBunny").rememberMeCookieName("rememberBunny").key("BunnyKey")
.rememberMe(AbstractHttpConfigurer::disable)
.authorizeHttpRequests(authorize -> {
// 如果访问路径有下面的不需要访问权限
authorize.requestMatchers(SecurityConstant.annotations).permitAll();
// 有样式文件不需要访问权限
authorize.requestMatchers(RegexRequestMatcher.regexMatcher("^\\S*[css|js]$")).permitAll();
// 上面都不是需要鉴权访问
authorize.anyRequest().access(customAuthorizationManager);
})
.exceptionHandling(exception -> {
// 请求未授权接口
exception.authenticationEntryPoint(new SecurityAuthenticationEntryPoint());
// 没有权限访问
exception.accessDeniedHandler(new SecurityAccessDeniedHandler());
})
// 自定义过滤器
.addFilterBefore(new TokenAuthenticationFilter(redisTemplate), UsernamePasswordAuthenticationFilter.class)
.addFilterAt(new TokenLoginFilter(authenticationConfiguration, redisTemplate), UsernamePasswordAuthenticationFilter.class)
// 自定义密码加密器和用户登录
.passwordManagement(customPasswordEncoder).userDetailsService(customUserDetailsService);
return httpSecurity.build();
}
@Bean
public SessionRegistry sessionRegistry() {
return new SessionRegistryImpl();
}
}

View File

@ -0,0 +1,28 @@
package cn.bunny.security.custom;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.PasswordManagementConfigurer;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.util.DigestUtils;
/**
* 自定义密码加密比对
*/
@Configuration
public class CustomPasswordEncoder implements PasswordEncoder, Customizer<PasswordManagementConfigurer<HttpSecurity>> {
@Override
public String encode(CharSequence rawPassword) {
return DigestUtils.md5DigestAsHex(rawPassword.toString().getBytes());
}
@Override
public boolean matches(CharSequence rawPassword, String encodedPassword) {
return encodedPassword.matches(DigestUtils.md5DigestAsHex(rawPassword.toString().getBytes()));
}
@Override
public void customize(PasswordManagementConfigurer<HttpSecurity> httpSecurityPasswordManagementConfigurer) {
}
}

View File

@ -0,0 +1,23 @@
package cn.bunny.security.custom;
import cn.bunny.entity.system.SysUser;
import lombok.Getter;
import lombok.Setter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;
import java.util.Collection;
/**
* 重写自带的User
*/
@Getter
@Setter
public class CustomUser extends User {
private SysUser sysUser;
public CustomUser(SysUser sysUser, Collection<? extends GrantedAuthority> authorities) {
super(sysUser.getUsername(), sysUser.getPassword(), authorities);
this.sysUser = sysUser;
}
}

View File

@ -0,0 +1,74 @@
package cn.bunny.security.filter;
import cn.bunny.common.service.context.BaseContext;
import cn.bunny.common.service.utils.JwtHelper;
import com.alibaba.fastjson2.JSON;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.util.StringUtils;
import org.springframework.web.filter.OncePerRequestFilter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class TokenAuthenticationFilter extends OncePerRequestFilter {
private final RedisTemplate<String, Object> redisTemplate;
public TokenAuthenticationFilter(RedisTemplate<String, Object> redisTemplate) {
this.redisTemplate = redisTemplate;
}
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws ServletException, IOException {
String token = request.getHeader("token");
// login请求就没token直接放行因为后边有其他的过滤器
if (token == null) {
doFilter(request, response, chain);
return;
}
// 如果是登录接口直接放行
UsernamePasswordAuthenticationToken authentication = getAuthentication(request);
SecurityContextHolder.getContext().setAuthentication(authentication);
chain.doFilter(request, response);
}
private UsernamePasswordAuthenticationToken getAuthentication(HttpServletRequest request) {
// 请求头是否有token
String token = request.getHeader("token");
if (StringUtils.hasText(token)) {
String username = JwtHelper.getUserName(token);
if (StringUtils.hasText(username)) {
// 当前用户信息放到ThreadLocal里面
BaseContext.setUserId(JwtHelper.getUserId(token));
BaseContext.setUsername(username);
// 通过username从redis获取权限数据
String authString = (String) redisTemplate.opsForValue().get(username);
// 把redis获取字符串权限数据转换要求集合类型 List<SimpleGrantedAuthority>
if (StringUtils.hasText(authString)) {
List<Map> maplist = JSON.parseArray(authString, Map.class);
System.out.println(maplist);
List<SimpleGrantedAuthority> authList = new ArrayList<>();
for (Map map : maplist) {
String authority = (String) map.get("authority");
authList.add(new SimpleGrantedAuthority(authority));
}
return new UsernamePasswordAuthenticationToken(username, null, authList);
} else {
return new UsernamePasswordAuthenticationToken(username, null, new ArrayList<>());
}
}
}
return null;
}
}

View File

@ -0,0 +1,80 @@
package cn.bunny.security.filter;
import cn.bunny.common.result.Result;
import cn.bunny.common.service.utils.JwtHelper;
import cn.bunny.common.service.utils.ResponseUtil;
import cn.bunny.entity.system.Login;
import cn.bunny.enums.ResultCodeEnum;
import cn.bunny.security.custom.CustomUser;
import cn.bunny.security.handelr.SecurityAuthenticationFailureHandler;
import cn.bunny.security.handelr.SecurityAuthenticationSuccessHandler;
import cn.bunny.vo.system.LoginVo;
import com.alibaba.fastjson2.JSON;
import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.servlet.FilterChain;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
import java.io.IOException;
/**
* 由于SpringSecurity的登录只能是表单形式 并且用户名密码需要时usernamepassword,可以通过继承 UsernamePasswordAuthenticationFilter 获取登录请求的参数
* 再去设置到 UsernamePasswordAuthenticationToken 来改变请求传参方式参数名等 或者也可以在登录的时候加入其他参数等等
* 也可以在这里添加验证码短信等的验证
*/
public class TokenLoginFilter extends UsernamePasswordAuthenticationFilter {
private final RedisTemplate<String, Object> redisTemplate;
// 构造方法
public TokenLoginFilter(AuthenticationConfiguration authenticationConfiguration, RedisTemplate<String, Object> redisTemplate) throws Exception {
this.setAuthenticationSuccessHandler(new SecurityAuthenticationSuccessHandler());
this.setAuthenticationFailureHandler(new SecurityAuthenticationFailureHandler());
this.setPostOnly(false);
// 指定登录接口及提交方式可以指定任意路径
this.setRequiresAuthenticationRequestMatcher(new AntPathRequestMatcher("/admin/system/index/login", "POST"));
this.setAuthenticationManager(authenticationConfiguration.getAuthenticationManager());
this.redisTemplate = redisTemplate;
}
// 登录认证
// 获取输入的用户名和密码调用方法认证
public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException {
try {
// 获取用户信息
LoginVo loginVo = new ObjectMapper().readValue(request.getInputStream(), LoginVo.class);
// 封装对象
Authentication authenticationToken = new UsernamePasswordAuthenticationToken(loginVo.getUsername(), loginVo.getPassword());
// 调用方法
return this.getAuthenticationManager().authenticate(authenticationToken);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
// 认证成功调用方法
protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain chain, Authentication auth) {
// 获取当前用户
CustomUser customUser = (CustomUser) auth.getPrincipal();
// 生成token
String token = JwtHelper.createToken(customUser.getSysUser().getId(), customUser.getSysUser().getUsername());
// 获取当前用户权限数据放到Redis里面 keyusername value权限数据
redisTemplate.opsForValue().set(customUser.getUsername(), JSON.toJSONString(customUser.getAuthorities()));
// 返回
Login login = Login.builder().token(token).build();
ResponseUtil.out(response, Result.success(login));
}
// 认证失败调用方法
protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) {
ResponseUtil.out(response, Result.error(null, ResultCodeEnum.LOGIN_MOBLE_ERROR));
}
}

View File

@ -0,0 +1,23 @@
package cn.bunny.security.handelr;
import cn.bunny.common.result.Result;
import cn.bunny.enums.ResultCodeEnum;
import com.alibaba.fastjson2.JSON;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.SneakyThrows;
import org.springframework.security.access.AccessDeniedException;
public class SecurityAccessDeniedHandler implements org.springframework.security.web.access.AccessDeniedHandler {
@SneakyThrows
@Override
public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException) {
Result<Object> result = Result.error(ResultCodeEnum.FAIL_NO_ACCESS_DENIED);
Object json = JSON.toJSON(result);
// 返回响应
response.setContentType("application/json;charset=UTF-8");
response.getWriter().println(json);
}
}

View File

@ -0,0 +1,39 @@
package cn.bunny.security.handelr;
import cn.bunny.common.result.Result;
import cn.bunny.enums.ResultCodeEnum;
import com.alibaba.fastjson2.JSON;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.AuthenticationEntryPoint;
import java.io.IOException;
/**
* 请求未认证接口
*/
@Slf4j
public class SecurityAuthenticationEntryPoint implements AuthenticationEntryPoint {
@Override
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException {
String token = response.getHeader("token");
String message = authException.getMessage();
// 创建结果对象
Result<Object> result;
if (token == null) {
result = Result.error(new Object(), ResultCodeEnum.LOGIN_AUTH);
log.info("请求未登录接口:{}用户id{}", message, null);
} else {
result = Result.error(new Object(), ResultCodeEnum.LOGGED_IN_FROM_ANOTHER_DEVICE);
log.info("请求未授权接口:{}用户id{}", message, token);
}
// 返回响应
response.setContentType("application/json;charset=UTF-8");
response.getWriter().println(JSON.toJSON(result));
}
}

View File

@ -0,0 +1,26 @@
package cn.bunny.security.handelr;
import cn.bunny.common.result.Result;
import com.alibaba.fastjson2.JSON;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.core.AuthenticationException;
import java.io.IOException;
public class SecurityAuthenticationFailureHandler implements org.springframework.security.web.authentication.AuthenticationFailureHandler {
@Override
public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException {
// 错误消息
String localizedMessage = exception.getLocalizedMessage();
Result<String> result = Result.error(localizedMessage);
// 转成JSON
Object json = JSON.toJSON(result);
// 返回响应
response.setContentType("application/json;charset=UTF-8");
response.getWriter().println(json);
}
}

View File

@ -0,0 +1,29 @@
package cn.bunny.security.handelr;
import cn.bunny.common.result.Result;
import com.alibaba.fastjson2.JSON;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
import java.io.IOException;
public class SecurityAuthenticationSuccessHandler implements AuthenticationSuccessHandler {
@Override
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {
// 获取用户身份信息
Object principal = authentication.getPrincipal();
// 获取用户凭证信息
// Object credentials = authentication.getCredentials();
// 获取用户权限信息
// Collection<? extends GrantedAuthority> authorities = authentication.getAuthorities();
Result<Object> result = Result.success(principal);
// 返回
response.setContentType("application/json;charset=UTF-8");
response.getWriter().println(JSON.toJSON(result));
}
}

View File

@ -0,0 +1,7 @@
package cn.bunny.security.service;
import org.springframework.security.authorization.AuthorizationManager;
import org.springframework.security.web.access.intercept.RequestAuthorizationContext;
public interface CustomAuthorizationManagerService extends AuthorizationManager<RequestAuthorizationContext> {
}

View File

@ -0,0 +1,12 @@
package cn.bunny.security.service;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
public interface CustomUserDetailsService extends org.springframework.security.core.userdetails.UserDetailsService {
/**
* 根据用户名获取用户对象获取不到直接抛异常
*/
@Override
UserDetails loadUserByUsername(String username) throws UsernameNotFoundException;
}

View File

@ -1,950 +0,0 @@
00:00:20:860 INFO 19084 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 19084 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
00:00:20:865 INFO 19084 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
00:00:21:211 INFO 19084 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
00:00:21:212 INFO 19084 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
00:00:21:226 INFO 19084 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7 ms. Found 0 Redis repository interfaces.
00:00:21:585 INFO 19084 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8800 (http)
00:00:21:591 INFO 19084 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
00:00:21:592 INFO 19084 --- [bunny-service] [main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.16]
00:00:21:633 INFO 19084 --- [bunny-service] [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
00:00:21:633 INFO 19084 --- [bunny-service] [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 745 ms
00:00:21:679 WARN 19084 --- [bunny-service] [main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'indexController': Unsatisfied dependency expressed through field 'sysUserService': Error creating bean with name 'sysUserServiceImpl': Unsatisfied dependency expressed through field 'baseMapper': Error creating bean with name 'sysUserMapper' defined in file [G:\web项目\Bunny-Cli\Java\java-template\service\target\classes\cn\bunny\service\mapper\SysUserMapper.class]: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
00:00:21:681 INFO 19084 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
00:00:21:688 INFO 19084 --- [bunny-service] [main] .s.b.a.l.ConditionEvaluationReportLogger :
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
00:00:21:696 ERROR 19084 --- [bunny-service] [main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'indexController': Unsatisfied dependency expressed through field 'sysUserService': Error creating bean with name 'sysUserServiceImpl': Unsatisfied dependency expressed through field 'baseMapper': Error creating bean with name 'sysUserMapper' defined in file [G:\web项目\Bunny-Cli\Java\java-template\service\target\classes\cn\bunny\service\mapper\SysUserMapper.class]: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:772) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:752) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:145) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:493) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:973) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:946) ~[spring-context-6.1.1.jar:6.1.1]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:616) ~[spring-context-6.1.1.jar:6.1.1]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.2.0.jar:3.2.0]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:753) ~[spring-boot-3.2.0.jar:3.2.0]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:455) ~[spring-boot-3.2.0.jar:3.2.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:323) ~[spring-boot-3.2.0.jar:3.2.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1342) ~[spring-boot-3.2.0.jar:3.2.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1331) ~[spring-boot-3.2.0.jar:3.2.0]
at cn.bunny.service.ServiceApplication.main(ServiceApplication.java:13) ~[classes/:na]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysUserServiceImpl': Unsatisfied dependency expressed through field 'baseMapper': Error creating bean with name 'sysUserMapper' defined in file [G:\web项目\Bunny-Cli\Java\java-template\service\target\classes\cn\bunny\service\mapper\SysUserMapper.class]: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:772) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:752) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:145) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:493) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1441) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1348) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:769) ~[spring-beans-6.1.1.jar:6.1.1]
... 20 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sysUserMapper' defined in file [G:\web项目\Bunny-Cli\Java\java-template\service\target\classes\cn\bunny\service\mapper\SysUserMapper.class]: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1775) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1441) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1348) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:769) ~[spring-beans-6.1.1.jar:6.1.1]
... 34 common frames omitted
Caused by: java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
at org.springframework.util.Assert.notNull(Assert.java:172) ~[spring-core-6.1.1.jar:6.1.1]
at org.mybatis.spring.support.SqlSessionDaoSupport.checkDaoConfig(SqlSessionDaoSupport.java:122) ~[mybatis-spring-2.0.5.jar:2.0.5]
at org.mybatis.spring.mapper.MapperFactoryBean.checkDaoConfig(MapperFactoryBean.java:73) ~[mybatis-spring-2.0.5.jar:2.0.5]
at org.springframework.dao.support.DaoSupport.afterPropertiesSet(DaoSupport.java:44) ~[spring-tx-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1822) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1771) ~[spring-beans-6.1.1.jar:6.1.1]
... 44 common frames omitted
00:00:36:127 INFO 19572 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 19572 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
00:00:36:129 INFO 19572 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
00:00:36:457 INFO 19572 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
00:00:36:458 INFO 19572 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
00:00:36:473 INFO 19572 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7 ms. Found 0 Redis repository interfaces.
00:00:36:823 INFO 19572 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8800 (http)
00:00:36:828 INFO 19572 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
00:00:36:828 INFO 19572 --- [bunny-service] [main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.16]
00:00:36:857 INFO 19572 --- [bunny-service] [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
00:00:36:857 INFO 19572 --- [bunny-service] [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 706 ms
00:00:36:893 WARN 19572 --- [bunny-service] [main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'indexController': Unsatisfied dependency expressed through field 'sysUserService': Error creating bean with name 'sysUserServiceImpl': Unsatisfied dependency expressed through field 'baseMapper': Error creating bean with name 'sysUserMapper' defined in file [G:\web项目\Bunny-Cli\Java\java-template\service\target\classes\cn\bunny\service\mapper\SysUserMapper.class]: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
00:00:36:893 INFO 19572 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
00:00:36:907 INFO 19572 --- [bunny-service] [main] .s.b.a.l.ConditionEvaluationReportLogger :
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
00:00:36:918 ERROR 19572 --- [bunny-service] [main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'indexController': Unsatisfied dependency expressed through field 'sysUserService': Error creating bean with name 'sysUserServiceImpl': Unsatisfied dependency expressed through field 'baseMapper': Error creating bean with name 'sysUserMapper' defined in file [G:\web项目\Bunny-Cli\Java\java-template\service\target\classes\cn\bunny\service\mapper\SysUserMapper.class]: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:772) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:752) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:145) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:493) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:973) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:946) ~[spring-context-6.1.1.jar:6.1.1]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:616) ~[spring-context-6.1.1.jar:6.1.1]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.2.0.jar:3.2.0]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:753) ~[spring-boot-3.2.0.jar:3.2.0]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:455) ~[spring-boot-3.2.0.jar:3.2.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:323) ~[spring-boot-3.2.0.jar:3.2.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1342) ~[spring-boot-3.2.0.jar:3.2.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1331) ~[spring-boot-3.2.0.jar:3.2.0]
at cn.bunny.service.ServiceApplication.main(ServiceApplication.java:13) ~[classes/:na]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysUserServiceImpl': Unsatisfied dependency expressed through field 'baseMapper': Error creating bean with name 'sysUserMapper' defined in file [G:\web项目\Bunny-Cli\Java\java-template\service\target\classes\cn\bunny\service\mapper\SysUserMapper.class]: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:772) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:752) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:145) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:493) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1441) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1348) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:769) ~[spring-beans-6.1.1.jar:6.1.1]
... 20 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sysUserMapper' defined in file [G:\web项目\Bunny-Cli\Java\java-template\service\target\classes\cn\bunny\service\mapper\SysUserMapper.class]: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1775) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1441) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1348) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:769) ~[spring-beans-6.1.1.jar:6.1.1]
... 34 common frames omitted
Caused by: java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
at org.springframework.util.Assert.notNull(Assert.java:172) ~[spring-core-6.1.1.jar:6.1.1]
at org.mybatis.spring.support.SqlSessionDaoSupport.checkDaoConfig(SqlSessionDaoSupport.java:122) ~[mybatis-spring-2.0.5.jar:2.0.5]
at org.mybatis.spring.mapper.MapperFactoryBean.checkDaoConfig(MapperFactoryBean.java:73) ~[mybatis-spring-2.0.5.jar:2.0.5]
at org.springframework.dao.support.DaoSupport.afterPropertiesSet(DaoSupport.java:44) ~[spring-tx-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1822) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1771) ~[spring-beans-6.1.1.jar:6.1.1]
... 44 common frames omitted
00:01:49:361 INFO 20456 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 20456 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
00:01:49:362 INFO 20456 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
00:01:49:704 INFO 20456 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
00:01:49:706 INFO 20456 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
00:01:49:720 INFO 20456 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7 ms. Found 0 Redis repository interfaces.
00:01:50:124 INFO 20456 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8800 (http)
00:01:50:130 INFO 20456 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
00:01:50:130 INFO 20456 --- [bunny-service] [main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.16]
00:01:50:162 INFO 20456 --- [bunny-service] [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
00:01:50:162 INFO 20456 --- [bunny-service] [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 777 ms
00:01:50:203 WARN 20456 --- [bunny-service] [main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'indexController': Unsatisfied dependency expressed through field 'sysUserService': Error creating bean with name 'sysUserServiceImpl': Unsatisfied dependency expressed through field 'baseMapper': Error creating bean with name 'sysUserMapper' defined in file [G:\web项目\Bunny-Cli\Java\java-template\service\target\classes\cn\bunny\service\mapper\SysUserMapper.class]: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
00:01:50:204 INFO 20456 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
00:01:50:216 INFO 20456 --- [bunny-service] [main] .s.b.a.l.ConditionEvaluationReportLogger :
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
00:01:50:230 ERROR 20456 --- [bunny-service] [main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'indexController': Unsatisfied dependency expressed through field 'sysUserService': Error creating bean with name 'sysUserServiceImpl': Unsatisfied dependency expressed through field 'baseMapper': Error creating bean with name 'sysUserMapper' defined in file [G:\web项目\Bunny-Cli\Java\java-template\service\target\classes\cn\bunny\service\mapper\SysUserMapper.class]: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:772) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:752) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:145) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:493) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:973) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:946) ~[spring-context-6.1.1.jar:6.1.1]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:616) ~[spring-context-6.1.1.jar:6.1.1]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.2.0.jar:3.2.0]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:753) ~[spring-boot-3.2.0.jar:3.2.0]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:455) ~[spring-boot-3.2.0.jar:3.2.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:323) ~[spring-boot-3.2.0.jar:3.2.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1342) ~[spring-boot-3.2.0.jar:3.2.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1331) ~[spring-boot-3.2.0.jar:3.2.0]
at cn.bunny.service.ServiceApplication.main(ServiceApplication.java:13) ~[classes/:na]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysUserServiceImpl': Unsatisfied dependency expressed through field 'baseMapper': Error creating bean with name 'sysUserMapper' defined in file [G:\web项目\Bunny-Cli\Java\java-template\service\target\classes\cn\bunny\service\mapper\SysUserMapper.class]: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:772) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:752) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:145) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:493) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1441) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1348) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:769) ~[spring-beans-6.1.1.jar:6.1.1]
... 20 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sysUserMapper' defined in file [G:\web项目\Bunny-Cli\Java\java-template\service\target\classes\cn\bunny\service\mapper\SysUserMapper.class]: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1775) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1441) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1348) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:769) ~[spring-beans-6.1.1.jar:6.1.1]
... 34 common frames omitted
Caused by: java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
at org.springframework.util.Assert.notNull(Assert.java:172) ~[spring-core-6.1.1.jar:6.1.1]
at org.mybatis.spring.support.SqlSessionDaoSupport.checkDaoConfig(SqlSessionDaoSupport.java:122) ~[mybatis-spring-2.0.5.jar:2.0.5]
at org.mybatis.spring.mapper.MapperFactoryBean.checkDaoConfig(MapperFactoryBean.java:73) ~[mybatis-spring-2.0.5.jar:2.0.5]
at org.springframework.dao.support.DaoSupport.afterPropertiesSet(DaoSupport.java:44) ~[spring-tx-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1822) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1771) ~[spring-beans-6.1.1.jar:6.1.1]
... 44 common frames omitted
00:02:35:129 INFO 8688 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 8688 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
00:02:35:130 INFO 8688 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
00:02:35:458 INFO 8688 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
00:02:35:459 INFO 8688 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
00:02:35:475 INFO 8688 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7 ms. Found 0 Redis repository interfaces.
00:02:35:824 INFO 8688 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8800 (http)
00:02:35:828 INFO 8688 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
00:02:35:828 INFO 8688 --- [bunny-service] [main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.16]
00:02:35:859 INFO 8688 --- [bunny-service] [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
00:02:35:859 INFO 8688 --- [bunny-service] [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 705 ms
00:02:35:894 WARN 8688 --- [bunny-service] [main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'indexController': Unsatisfied dependency expressed through field 'sysUserService': Error creating bean with name 'sysUserServiceImpl': Unsatisfied dependency expressed through field 'baseMapper': Error creating bean with name 'sysUserMapper' defined in file [G:\web项目\Bunny-Cli\Java\java-template\service\target\classes\cn\bunny\service\mapper\SysUserMapper.class]: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
00:02:35:897 INFO 8688 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
00:02:35:908 INFO 8688 --- [bunny-service] [main] .s.b.a.l.ConditionEvaluationReportLogger :
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
00:02:35:918 ERROR 8688 --- [bunny-service] [main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'indexController': Unsatisfied dependency expressed through field 'sysUserService': Error creating bean with name 'sysUserServiceImpl': Unsatisfied dependency expressed through field 'baseMapper': Error creating bean with name 'sysUserMapper' defined in file [G:\web项目\Bunny-Cli\Java\java-template\service\target\classes\cn\bunny\service\mapper\SysUserMapper.class]: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:772) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:752) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:145) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:493) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:973) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:946) ~[spring-context-6.1.1.jar:6.1.1]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:616) ~[spring-context-6.1.1.jar:6.1.1]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.2.0.jar:3.2.0]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:753) ~[spring-boot-3.2.0.jar:3.2.0]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:455) ~[spring-boot-3.2.0.jar:3.2.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:323) ~[spring-boot-3.2.0.jar:3.2.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1342) ~[spring-boot-3.2.0.jar:3.2.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1331) ~[spring-boot-3.2.0.jar:3.2.0]
at cn.bunny.service.ServiceApplication.main(ServiceApplication.java:13) ~[classes/:na]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sysUserServiceImpl': Unsatisfied dependency expressed through field 'baseMapper': Error creating bean with name 'sysUserMapper' defined in file [G:\web项目\Bunny-Cli\Java\java-template\service\target\classes\cn\bunny\service\mapper\SysUserMapper.class]: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:772) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:752) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:145) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:493) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1441) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1348) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:769) ~[spring-beans-6.1.1.jar:6.1.1]
... 20 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sysUserMapper' defined in file [G:\web项目\Bunny-Cli\Java\java-template\service\target\classes\cn\bunny\service\mapper\SysUserMapper.class]: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1775) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:523) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1441) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1348) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:769) ~[spring-beans-6.1.1.jar:6.1.1]
... 34 common frames omitted
Caused by: java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
at org.springframework.util.Assert.notNull(Assert.java:172) ~[spring-core-6.1.1.jar:6.1.1]
at org.mybatis.spring.support.SqlSessionDaoSupport.checkDaoConfig(SqlSessionDaoSupport.java:122) ~[mybatis-spring-2.0.5.jar:2.0.5]
at org.mybatis.spring.mapper.MapperFactoryBean.checkDaoConfig(MapperFactoryBean.java:73) ~[mybatis-spring-2.0.5.jar:2.0.5]
at org.springframework.dao.support.DaoSupport.afterPropertiesSet(DaoSupport.java:44) ~[spring-tx-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1822) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1771) ~[spring-beans-6.1.1.jar:6.1.1]
... 44 common frames omitted
10:28:24:507 INFO 25976 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 25976 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
10:28:24:508 INFO 25976 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
10:28:24:900 INFO 25976 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
10:28:24:902 INFO 25976 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
10:28:24:920 INFO 25976 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7 ms. Found 0 Redis repository interfaces.
10:28:24:985 WARN 25976 --- [bunny-service] [main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: java.lang.IllegalArgumentException: Invalid value type for attribute 'factoryBeanObjectType': java.lang.String
10:28:24:990 INFO 25976 --- [bunny-service] [main] .s.b.a.l.ConditionEvaluationReportLogger :
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
10:28:25:001 ERROR 25976 --- [bunny-service] [main] o.s.boot.SpringApplication : Application run failed
java.lang.IllegalArgumentException: Invalid value type for attribute 'factoryBeanObjectType': java.lang.String
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getTypeForFactoryBeanFromAttributes(FactoryBeanRegistrySupport.java:86) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:838) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:620) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:573) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:532) ~[spring-beans-6.1.1.jar:6.1.1]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:138) ~[spring-context-6.1.1.jar:6.1.1]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:775) ~[spring-context-6.1.1.jar:6.1.1]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:597) ~[spring-context-6.1.1.jar:6.1.1]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.2.0.jar:3.2.0]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:753) ~[spring-boot-3.2.0.jar:3.2.0]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:455) ~[spring-boot-3.2.0.jar:3.2.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:323) ~[spring-boot-3.2.0.jar:3.2.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1342) ~[spring-boot-3.2.0.jar:3.2.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1331) ~[spring-boot-3.2.0.jar:3.2.0]
at cn.bunny.service.ServiceApplication.main(ServiceApplication.java:13) ~[classes/:na]
10:30:14:630 INFO 23272 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 23272 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
10:30:14:631 INFO 23272 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
10:30:15:035 INFO 23272 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
10:30:15:037 INFO 23272 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
10:30:15:057 INFO 23272 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 9 ms. Found 0 Redis repository interfaces.
10:30:15:129 WARN 23272 --- [bunny-service] [main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: java.lang.IllegalArgumentException: Invalid value type for attribute 'factoryBeanObjectType': java.lang.String
10:30:15:134 INFO 23272 --- [bunny-service] [main] .s.b.a.l.ConditionEvaluationReportLogger :
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
10:30:15:146 ERROR 23272 --- [bunny-service] [main] o.s.boot.SpringApplication : Application run failed
java.lang.IllegalArgumentException: Invalid value type for attribute 'factoryBeanObjectType': java.lang.String
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getTypeForFactoryBeanFromAttributes(FactoryBeanRegistrySupport.java:86) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:837) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:652) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:575) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:534) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:138) ~[spring-context-6.1.6.jar:6.1.6]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:788) ~[spring-context-6.1.6.jar:6.1.6]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:606) ~[spring-context-6.1.6.jar:6.1.6]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:334) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-3.2.5.jar:3.2.5]
at cn.bunny.service.ServiceApplication.main(ServiceApplication.java:13) ~[classes/:na]
10:31:00:865 INFO 18296 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 18296 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
10:31:00:865 INFO 18296 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
10:31:01:191 INFO 18296 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
10:31:01:192 INFO 18296 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
10:31:01:207 INFO 18296 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7 ms. Found 0 Redis repository interfaces.
10:31:01:269 WARN 18296 --- [bunny-service] [main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: java.lang.IllegalArgumentException: Invalid value type for attribute 'factoryBeanObjectType': java.lang.String
10:31:01:273 INFO 18296 --- [bunny-service] [main] .s.b.a.l.ConditionEvaluationReportLogger :
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
10:31:01:282 ERROR 18296 --- [bunny-service] [main] o.s.boot.SpringApplication : Application run failed
java.lang.IllegalArgumentException: Invalid value type for attribute 'factoryBeanObjectType': java.lang.String
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getTypeForFactoryBeanFromAttributes(FactoryBeanRegistrySupport.java:86) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:837) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:652) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:575) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:534) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:138) ~[spring-context-6.1.6.jar:6.1.6]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:788) ~[spring-context-6.1.6.jar:6.1.6]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:606) ~[spring-context-6.1.6.jar:6.1.6]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:334) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-3.2.5.jar:3.2.5]
at cn.bunny.service.ServiceApplication.main(ServiceApplication.java:13) ~[classes/:na]
10:33:54:613 INFO 20704 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 20704 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
10:33:54:615 INFO 20704 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
10:33:54:976 INFO 20704 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
10:33:54:977 INFO 20704 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
10:33:54:992 INFO 20704 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7 ms. Found 0 Redis repository interfaces.
10:33:55:433 INFO 20704 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8800 (http)
10:33:55:441 INFO 20704 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
10:33:55:441 INFO 20704 --- [bunny-service] [main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.20]
10:33:55:485 INFO 20704 --- [bunny-service] [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
10:33:55:485 INFO 20704 --- [bunny-service] [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 847 ms
10:34:01:041 INFO 20704 --- [bunny-service] [main] c.b.c.service.config.MybatisPlusConfig : MybatisPlusInterceptor===>注入Mybatis-Plus配置...
10:34:01:399 INFO 20704 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>使用StringRedisSerializer序列化为字符串
10:34:01:452 INFO 20704 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>解决cache(@Cacheable)把数据缓存到redis中的value是乱码问题
10:34:01:455 INFO 20704 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>指定的日期模式
10:34:03:213 INFO 20704 --- [bunny-service] [main] c.b.c.s.properties.MinioProperties : 注册MinioClient...
10:34:03:617 WARN 20704 --- [bunny-service] [main] .s.s.UserDetailsServiceAutoConfiguration :
Using generated security password: 68d1aef6-1989-4d21-b0ac-14061cdc8845
This generated password is for development use only. Your security configuration must be updated before running your application in production.
10:34:03:689 INFO 20704 --- [bunny-service] [main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@70273633, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@1f641fb7, org.springframework.security.web.context.SecurityContextHolderFilter@131c5bd, org.springframework.security.web.header.HeaderWriterFilter@4a7e469d, org.springframework.web.filter.CorsFilter@69dc7b24, org.springframework.security.web.csrf.CsrfFilter@1b3a95d9, org.springframework.security.web.authentication.logout.LogoutFilter@642d34f1, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@69d61a6f, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@7272914b, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@297454f7, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@4db4431b, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@2627335c, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@5470753a, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@602b7944, org.springframework.security.web.access.ExceptionTranslationFilter@129e45eb, org.springframework.security.web.access.intercept.AuthorizationFilter@408d12fc]
10:34:03:728 INFO 20704 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port 8800 (http) with context path ''
10:34:03:733 INFO 20704 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Started ServiceApplication in 9.361 seconds (process running for 14.509)
16:49:14:454 INFO 20792 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 20792 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
16:49:14:455 INFO 20792 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
16:49:14:790 INFO 20792 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
16:49:14:791 INFO 20792 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
16:49:14:806 INFO 20792 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7 ms. Found 0 Redis repository interfaces.
16:49:14:864 WARN 20792 --- [bunny-service] [main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: java.lang.IllegalArgumentException: Invalid value type for attribute 'factoryBeanObjectType': java.lang.String
16:49:14:869 INFO 20792 --- [bunny-service] [main] .s.b.a.l.ConditionEvaluationReportLogger :
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
16:49:14:878 ERROR 20792 --- [bunny-service] [main] o.s.boot.SpringApplication : Application run failed
java.lang.IllegalArgumentException: Invalid value type for attribute 'factoryBeanObjectType': java.lang.String
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getTypeForFactoryBeanFromAttributes(FactoryBeanRegistrySupport.java:86) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:837) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:652) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:575) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:534) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:138) ~[spring-context-6.1.6.jar:6.1.6]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:788) ~[spring-context-6.1.6.jar:6.1.6]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:606) ~[spring-context-6.1.6.jar:6.1.6]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:334) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-3.2.5.jar:3.2.5]
at cn.bunny.service.ServiceApplication.main(ServiceApplication.java:13) ~[classes/:na]
16:51:53:068 INFO 22660 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 22660 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
16:51:53:070 INFO 22660 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
16:51:53:410 INFO 22660 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
16:51:53:411 INFO 22660 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
16:51:53:425 INFO 22660 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 6 ms. Found 0 Redis repository interfaces.
16:51:53:510 WARN 22660 --- [bunny-service] [main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: java.lang.IllegalArgumentException: Invalid value type for attribute 'factoryBeanObjectType': java.lang.String
16:51:53:516 INFO 22660 --- [bunny-service] [main] .s.b.a.l.ConditionEvaluationReportLogger :
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
16:51:53:526 ERROR 22660 --- [bunny-service] [main] o.s.boot.SpringApplication : Application run failed
java.lang.IllegalArgumentException: Invalid value type for attribute 'factoryBeanObjectType': java.lang.String
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getTypeForFactoryBeanFromAttributes(FactoryBeanRegistrySupport.java:86) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:837) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:652) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:575) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:534) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:138) ~[spring-context-6.1.6.jar:6.1.6]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:788) ~[spring-context-6.1.6.jar:6.1.6]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:606) ~[spring-context-6.1.6.jar:6.1.6]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:334) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-3.2.5.jar:3.2.5]
at cn.bunny.service.ServiceApplication.main(ServiceApplication.java:13) ~[classes/:na]
16:52:41:386 INFO 11552 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 11552 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
16:52:41:387 INFO 11552 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
16:52:41:740 INFO 11552 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
16:52:41:741 INFO 11552 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
16:52:41:756 INFO 11552 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 6 ms. Found 0 Redis repository interfaces.
16:52:41:817 WARN 11552 --- [bunny-service] [main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: java.lang.IllegalArgumentException: Invalid value type for attribute 'factoryBeanObjectType': java.lang.String
16:52:41:822 INFO 11552 --- [bunny-service] [main] .s.b.a.l.ConditionEvaluationReportLogger :
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
16:52:41:833 ERROR 11552 --- [bunny-service] [main] o.s.boot.SpringApplication : Application run failed
java.lang.IllegalArgumentException: Invalid value type for attribute 'factoryBeanObjectType': java.lang.String
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getTypeForFactoryBeanFromAttributes(FactoryBeanRegistrySupport.java:86) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:837) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:652) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:575) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:534) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:138) ~[spring-context-6.1.6.jar:6.1.6]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:788) ~[spring-context-6.1.6.jar:6.1.6]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:606) ~[spring-context-6.1.6.jar:6.1.6]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:334) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-3.2.5.jar:3.2.5]
at cn.bunny.service.ServiceApplication.main(ServiceApplication.java:13) ~[classes/:na]
16:52:51:515 INFO 21396 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 21396 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
16:52:51:516 INFO 21396 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
16:52:51:849 INFO 21396 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
16:52:51:851 INFO 21396 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
16:52:51:864 INFO 21396 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 6 ms. Found 0 Redis repository interfaces.
16:52:51:923 WARN 21396 --- [bunny-service] [main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: java.lang.IllegalArgumentException: Invalid value type for attribute 'factoryBeanObjectType': java.lang.String
16:52:51:928 INFO 21396 --- [bunny-service] [main] .s.b.a.l.ConditionEvaluationReportLogger :
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
16:52:51:939 ERROR 21396 --- [bunny-service] [main] o.s.boot.SpringApplication : Application run failed
java.lang.IllegalArgumentException: Invalid value type for attribute 'factoryBeanObjectType': java.lang.String
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getTypeForFactoryBeanFromAttributes(FactoryBeanRegistrySupport.java:86) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:837) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:652) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:575) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:534) ~[spring-beans-6.1.6.jar:6.1.6]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:138) ~[spring-context-6.1.6.jar:6.1.6]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:788) ~[spring-context-6.1.6.jar:6.1.6]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:606) ~[spring-context-6.1.6.jar:6.1.6]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:334) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-3.2.5.jar:3.2.5]
at cn.bunny.service.ServiceApplication.main(ServiceApplication.java:13) ~[classes/:na]
16:54:31:130 INFO 18584 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 18584 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
16:54:31:131 INFO 18584 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
16:54:31:464 INFO 18584 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
16:54:31:465 INFO 18584 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
16:54:31:479 INFO 18584 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 6 ms. Found 0 Redis repository interfaces.
16:54:31:810 INFO 18584 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8800 (http)
16:54:31:816 INFO 18584 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
16:54:31:816 INFO 18584 --- [bunny-service] [main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.20]
16:54:31:852 INFO 18584 --- [bunny-service] [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
16:54:31:852 INFO 18584 --- [bunny-service] [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 699 ms
16:54:31:902 INFO 18584 --- [bunny-service] [main] c.b.c.service.config.MybatisPlusConfig : MybatisPlusInterceptor===>注入Mybatis-Plus配置...
16:54:32:160 INFO 18584 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>使用StringRedisSerializer序列化为字符串
16:54:32:197 INFO 18584 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>解决cache(@Cacheable)把数据缓存到redis中的value是乱码问题
16:54:32:200 INFO 18584 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>指定的日期模式
16:54:32:205 INFO 18584 --- [bunny-service] [main] c.b.c.s.properties.MinioProperties : 注册MinioClient...
16:54:32:520 WARN 18584 --- [bunny-service] [main] .s.s.UserDetailsServiceAutoConfiguration :
Using generated security password: 39f64e4f-f4d5-4aff-8d24-329a6c758040
This generated password is for development use only. Your security configuration must be updated before running your application in production.
16:54:32:575 INFO 18584 --- [bunny-service] [main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@39159b14, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@57ab4b33, org.springframework.security.web.context.SecurityContextHolderFilter@3ebc6d8b, org.springframework.security.web.header.HeaderWriterFilter@1fe7fa16, org.springframework.web.filter.CorsFilter@43b2e7db, org.springframework.security.web.csrf.CsrfFilter@1774c4e2, org.springframework.security.web.authentication.logout.LogoutFilter@6f25ed2b, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@31940d6b, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@54ef9698, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@46d51d5e, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@2ae88712, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@7e7391e8, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@1fa44f66, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@530df3ab, org.springframework.security.web.access.ExceptionTranslationFilter@169d1f92, org.springframework.security.web.access.intercept.AuthorizationFilter@59043741]
16:54:32:608 INFO 18584 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port 8800 (http) with context path ''
16:54:32:614 INFO 18584 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Started ServiceApplication in 1.72 seconds (process running for 2.04)
17:21:57:165 INFO 9596 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 9596 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
17:21:57:166 INFO 9596 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
17:21:57:559 INFO 9596 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
17:21:57:560 INFO 9596 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
17:21:57:575 INFO 9596 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7 ms. Found 0 Redis repository interfaces.
17:21:57:953 INFO 9596 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8800 (http)
17:21:57:964 INFO 9596 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
17:21:57:964 INFO 9596 --- [bunny-service] [main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.20]
17:21:57:998 INFO 9596 --- [bunny-service] [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
17:21:57:998 INFO 9596 --- [bunny-service] [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 807 ms
17:21:58:057 INFO 9596 --- [bunny-service] [main] c.b.c.service.config.MybatisPlusConfig : MybatisPlusInterceptor===>注入Mybatis-Plus配置...
17:21:58:325 INFO 9596 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>使用StringRedisSerializer序列化为字符串
17:21:58:366 INFO 9596 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>解决cache(@Cacheable)把数据缓存到redis中的value是乱码问题
17:21:58:369 INFO 9596 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>指定的日期模式
17:21:58:373 INFO 9596 --- [bunny-service] [main] c.b.c.s.properties.MinioProperties : 注册MinioClient...
17:21:58:685 WARN 9596 --- [bunny-service] [main] .s.s.UserDetailsServiceAutoConfiguration :
Using generated security password: 5d34f2d0-fb7f-420e-989c-3515dbae24ab
This generated password is for development use only. Your security configuration must be updated before running your application in production.
17:21:58:734 INFO 9596 --- [bunny-service] [main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@744db9fb, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@59043741, org.springframework.security.web.context.SecurityContextHolderFilter@411933, org.springframework.security.web.header.HeaderWriterFilter@19540247, org.springframework.web.filter.CorsFilter@31940d6b, org.springframework.security.web.csrf.CsrfFilter@642614b7, org.springframework.security.web.authentication.logout.LogoutFilter@197180a5, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@6f25ed2b, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@b5d7233, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@64cdc310, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@1b06dc57, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@6b43b101, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@37cc6017, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@7d563c13, org.springframework.security.web.access.ExceptionTranslationFilter@7d8d671b, org.springframework.security.web.access.intercept.AuthorizationFilter@75fa9254]
17:21:58:765 INFO 9596 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port 8800 (http) with context path ''
17:21:58:769 INFO 9596 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Started ServiceApplication in 1.89 seconds (process running for 2.273)
17:32:12:615 INFO 24656 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 24656 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
17:32:12:616 INFO 24656 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
17:32:13:011 INFO 24656 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
17:32:13:013 INFO 24656 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
17:32:13:029 INFO 24656 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 8 ms. Found 0 Redis repository interfaces.
17:32:13:468 INFO 24656 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8800 (http)
17:32:13:474 INFO 24656 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
17:32:13:475 INFO 24656 --- [bunny-service] [main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.20]
17:32:13:518 INFO 24656 --- [bunny-service] [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
17:32:13:518 INFO 24656 --- [bunny-service] [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 877 ms
17:32:13:575 INFO 24656 --- [bunny-service] [main] c.b.c.service.config.MybatisPlusConfig : MybatisPlusInterceptor===>注入Mybatis-Plus配置...
17:32:13:828 INFO 24656 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>使用StringRedisSerializer序列化为字符串
17:32:13:889 INFO 24656 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>解决cache(@Cacheable)把数据缓存到redis中的value是乱码问题
17:32:13:891 INFO 24656 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>指定的日期模式
17:32:13:895 INFO 24656 --- [bunny-service] [main] c.b.c.s.properties.MinioProperties : 注册MinioClient...
17:32:14:223 WARN 24656 --- [bunny-service] [main] .s.s.UserDetailsServiceAutoConfiguration :
Using generated security password: 7aaba67e-67a2-4eac-83f8-1f86402e5cf5
This generated password is for development use only. Your security configuration must be updated before running your application in production.
17:32:14:279 INFO 24656 --- [bunny-service] [main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@7c39193f, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@230d013b, org.springframework.security.web.context.SecurityContextHolderFilter@3e8fe7db, org.springframework.security.web.header.HeaderWriterFilter@7535307c, org.springframework.web.filter.CorsFilter@6e225c34, org.springframework.security.web.csrf.CsrfFilter@197180a5, org.springframework.security.web.authentication.logout.LogoutFilter@5e72c82a, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@4942e6af, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@31940d6b, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@5d84b088, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@1fc8047f, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@64908ab9, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@1b06dc57, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@69c0bae6, org.springframework.security.web.access.ExceptionTranslationFilter@147097ad, org.springframework.security.web.access.intercept.AuthorizationFilter@55315a00]
17:32:14:313 INFO 24656 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port 8800 (http) with context path ''
17:32:14:318 INFO 24656 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Started ServiceApplication in 1.952 seconds (process running for 2.28)
17:32:15:973 INFO 24656 --- [bunny-service] [http-nio-8800-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
17:32:15:973 INFO 24656 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
17:32:15:974 INFO 24656 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms
17:32:36:568 ERROR 24656 --- [bunny-service] [http-nio-8800-exec-7] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
17:32:36:579 ERROR 24656 --- [bunny-service] [http-nio-8800-exec-9] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource swagger-resources.
17:32:44:779 ERROR 24656 --- [bunny-service] [http-nio-8800-exec-5] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource swagger-resources.
17:32:44:788 ERROR 24656 --- [bunny-service] [http-nio-8800-exec-10] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
17:32:47:095 ERROR 24656 --- [bunny-service] [http-nio-8800-exec-7] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource swagger-resources.
17:32:47:107 ERROR 24656 --- [bunny-service] [http-nio-8800-exec-8] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
17:32:47:459 ERROR 24656 --- [bunny-service] [http-nio-8800-exec-4] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource swagger-resources.
17:32:47:469 ERROR 24656 --- [bunny-service] [http-nio-8800-exec-2] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
17:32:47:603 ERROR 24656 --- [bunny-service] [http-nio-8800-exec-5] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource swagger-resources.
17:32:47:617 ERROR 24656 --- [bunny-service] [http-nio-8800-exec-3] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
17:32:47:738 ERROR 24656 --- [bunny-service] [http-nio-8800-exec-4] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource swagger-resources.
17:32:47:756 ERROR 24656 --- [bunny-service] [http-nio-8800-exec-1] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
17:44:37:556 INFO 20960 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 20960 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
17:44:37:557 INFO 20960 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
17:44:38:008 INFO 20960 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
17:44:38:010 INFO 20960 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
17:44:38:025 INFO 20960 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 8 ms. Found 0 Redis repository interfaces.
17:44:38:394 INFO 20960 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8800 (http)
17:44:38:401 INFO 20960 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
17:44:38:402 INFO 20960 --- [bunny-service] [main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.20]
17:44:38:442 INFO 20960 --- [bunny-service] [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
17:44:38:442 INFO 20960 --- [bunny-service] [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 862 ms
17:44:38:495 INFO 20960 --- [bunny-service] [main] c.b.c.service.config.MybatisPlusConfig : MybatisPlusInterceptor===>注入Mybatis-Plus配置...
17:44:38:744 INFO 20960 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>使用StringRedisSerializer序列化为字符串
17:44:38:806 INFO 20960 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>解决cache(@Cacheable)把数据缓存到redis中的value是乱码问题
17:44:38:808 INFO 20960 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>指定的日期模式
17:44:38:813 INFO 20960 --- [bunny-service] [main] c.b.c.s.properties.MinioProperties : 注册MinioClient...
17:44:39:225 WARN 20960 --- [bunny-service] [main] .s.s.UserDetailsServiceAutoConfiguration :
Using generated security password: fd704a61-c389-4575-a6d9-9e0dd2f63c2a
This generated password is for development use only. Your security configuration must be updated before running your application in production.
17:44:39:277 INFO 20960 --- [bunny-service] [main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@45964b9e, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@166a5659, org.springframework.security.web.context.SecurityContextHolderFilter@7c07023, org.springframework.security.web.header.HeaderWriterFilter@18918d70, org.springframework.web.filter.CorsFilter@1afabf06, org.springframework.security.web.csrf.CsrfFilter@1e09c0b, org.springframework.security.web.authentication.logout.LogoutFilter@b75f3f4, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@78a34c47, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@1701beb3, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@33060020, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@1db9c2cf, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@774189d0, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@22c4354d, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@443b6765, org.springframework.security.web.access.ExceptionTranslationFilter@12478b4e, org.springframework.security.web.access.intercept.AuthorizationFilter@27691ee8]
17:44:39:314 INFO 20960 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port 8800 (http) with context path ''
17:44:39:318 INFO 20960 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Started ServiceApplication in 2.029 seconds (process running for 2.364)
17:44:47:042 INFO 20960 --- [bunny-service] [http-nio-8800-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
17:44:47:043 INFO 20960 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
17:44:47:043 INFO 20960 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 0 ms
17:45:03:218 ERROR 20960 --- [bunny-service] [http-nio-8800-exec-5] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
17:45:03:365 INFO 20960 --- [bunny-service] [http-nio-8800-exec-2] o.springdoc.api.AbstractOpenApiResource : Init duration for springdoc-openapi is: 105 ms
17:45:10:321 ERROR 20960 --- [bunny-service] [http-nio-8800-exec-4] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
17:46:09:826 ERROR 20960 --- [bunny-service] [http-nio-8800-exec-9] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
17:46:10:869 ERROR 20960 --- [bunny-service] [http-nio-8800-exec-1] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
17:46:11:336 ERROR 20960 --- [bunny-service] [http-nio-8800-exec-6] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
17:46:11:785 ERROR 20960 --- [bunny-service] [http-nio-8800-exec-7] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
17:48:47:033 ERROR 20960 --- [bunny-service] [http-nio-8800-exec-9] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
17:50:40:498 INFO 5504 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 5504 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
17:50:40:499 INFO 5504 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
17:50:40:932 INFO 5504 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
17:50:40:933 INFO 5504 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
17:50:40:948 INFO 5504 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7 ms. Found 0 Redis repository interfaces.
17:50:41:318 INFO 5504 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8800 (http)
17:50:41:324 INFO 5504 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
17:50:41:324 INFO 5504 --- [bunny-service] [main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.20]
17:50:41:366 INFO 5504 --- [bunny-service] [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
17:50:41:367 INFO 5504 --- [bunny-service] [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 844 ms
17:50:41:422 INFO 5504 --- [bunny-service] [main] c.b.c.service.config.MybatisPlusConfig : MybatisPlusInterceptor===>注入Mybatis-Plus配置...
17:50:41:679 INFO 5504 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>使用StringRedisSerializer序列化为字符串
17:50:41:742 INFO 5504 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>解决cache(@Cacheable)把数据缓存到redis中的value是乱码问题
17:50:41:745 INFO 5504 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>指定的日期模式
17:50:41:750 INFO 5504 --- [bunny-service] [main] c.b.c.s.properties.MinioProperties : 注册MinioClient...
17:50:42:244 INFO 5504 --- [bunny-service] [main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@4f0cdd0f, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@22ea6051, org.springframework.security.web.context.SecurityContextHolderFilter@329efc61, org.springframework.security.web.header.HeaderWriterFilter@4c599679, org.springframework.web.filter.CorsFilter@539bb233, org.springframework.security.web.csrf.CsrfFilter@40d04cf8, org.springframework.security.web.authentication.logout.LogoutFilter@3d213a2b, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@45964b9e, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@4e481512, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@21b2579d, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@70f3bf00, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@4e7151b3, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@5ef7ae2f, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@87f1201, org.springframework.security.web.access.ExceptionTranslationFilter@1701beb3, org.springframework.security.web.access.intercept.AuthorizationFilter@421d7900]
17:50:42:278 INFO 5504 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port 8800 (http) with context path ''
17:50:42:282 INFO 5504 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Started ServiceApplication in 2.049 seconds (process running for 2.405)
17:50:53:290 INFO 5504 --- [bunny-service] [http-nio-8800-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
17:50:53:290 INFO 5504 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
17:50:53:291 INFO 5504 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms
17:50:58:353 ERROR 5504 --- [bunny-service] [http-nio-8800-exec-9] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
17:50:58:502 INFO 5504 --- [bunny-service] [http-nio-8800-exec-10] o.springdoc.api.AbstractOpenApiResource : Init duration for springdoc-openapi is: 110 ms
17:52:22:225 ERROR 5504 --- [bunny-service] [http-nio-8800-exec-6] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
17:54:36:506 INFO 22924 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 22924 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
17:54:36:506 INFO 22924 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
17:54:36:939 INFO 22924 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
17:54:36:941 INFO 22924 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
17:54:36:958 INFO 22924 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7 ms. Found 0 Redis repository interfaces.
17:54:37:336 INFO 22924 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8800 (http)
17:54:37:343 INFO 22924 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
17:54:37:343 INFO 22924 --- [bunny-service] [main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.20]
17:54:37:387 INFO 22924 --- [bunny-service] [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
17:54:37:387 INFO 22924 --- [bunny-service] [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 858 ms
17:54:37:445 INFO 22924 --- [bunny-service] [main] c.b.c.service.config.MybatisPlusConfig : MybatisPlusInterceptor===>注入Mybatis-Plus配置...
17:54:37:727 INFO 22924 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>使用StringRedisSerializer序列化为字符串
17:54:37:791 INFO 22924 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>解决cache(@Cacheable)把数据缓存到redis中的value是乱码问题
17:54:37:794 INFO 22924 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>指定的日期模式
17:54:37:798 INFO 22924 --- [bunny-service] [main] c.b.c.s.properties.MinioProperties : 注册MinioClient...
17:54:38:262 INFO 22924 --- [bunny-service] [main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@33060020, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@443b6765, org.springframework.security.web.context.SecurityContextHolderFilter@22c4354d, org.springframework.security.web.header.HeaderWriterFilter@7c07023, org.springframework.web.filter.CorsFilter@a72925, org.springframework.security.web.csrf.CsrfFilter@151d216e, org.springframework.security.web.authentication.logout.LogoutFilter@1477d4e6, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@2c51c756, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@15fd3088, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@4feaa4b8, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@45964b9e, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@41f5389f, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@3a012678, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@4c6eaa65, org.springframework.security.web.access.ExceptionTranslationFilter@5d373794, org.springframework.security.web.access.intercept.AuthorizationFilter@43201f84]
17:54:38:300 INFO 22924 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port 8800 (http) with context path ''
17:54:38:305 INFO 22924 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Started ServiceApplication in 2.076 seconds (process running for 2.404)
17:54:40:093 INFO 22924 --- [bunny-service] [http-nio-8800-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
17:54:40:093 INFO 22924 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
17:54:40:094 INFO 22924 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms
17:54:46:782 ERROR 22924 --- [bunny-service] [http-nio-8800-exec-9] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
17:54:46:928 INFO 22924 --- [bunny-service] [http-nio-8800-exec-2] o.springdoc.api.AbstractOpenApiResource : Init duration for springdoc-openapi is: 108 ms
17:56:19:989 INFO 21468 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 21468 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
17:56:19:990 INFO 21468 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
17:56:20:403 INFO 21468 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
17:56:20:405 INFO 21468 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
17:56:20:419 INFO 21468 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7 ms. Found 0 Redis repository interfaces.
17:56:20:772 INFO 21468 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8800 (http)
17:56:20:779 INFO 21468 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
17:56:20:779 INFO 21468 --- [bunny-service] [main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.20]
17:56:20:820 INFO 21468 --- [bunny-service] [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
17:56:20:820 INFO 21468 --- [bunny-service] [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 808 ms
17:56:20:872 INFO 21468 --- [bunny-service] [main] c.b.c.service.config.MybatisPlusConfig : MybatisPlusInterceptor===>注入Mybatis-Plus配置...
17:56:21:124 INFO 21468 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>使用StringRedisSerializer序列化为字符串
17:56:21:189 INFO 21468 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>解决cache(@Cacheable)把数据缓存到redis中的value是乱码问题
17:56:21:192 INFO 21468 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>指定的日期模式
17:56:21:197 INFO 21468 --- [bunny-service] [main] c.b.c.s.properties.MinioProperties : 注册MinioClient...
17:56:21:652 INFO 21468 --- [bunny-service] [main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@22ea6051, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@539bb233, org.springframework.security.web.context.SecurityContextHolderFilter@32f45e15, org.springframework.security.web.header.HeaderWriterFilter@15fd3088, org.springframework.web.filter.CorsFilter@21b2579d, org.springframework.security.web.csrf.CsrfFilter@75507e68, org.springframework.security.web.authentication.logout.LogoutFilter@27691ee8, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@166a5659, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@1ba98508, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@87f1201, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@49770ef9, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@5ef7ae2f, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@1bcf2c64, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@796613b7, org.springframework.security.web.access.ExceptionTranslationFilter@7f584d0c, org.springframework.security.web.access.intercept.AuthorizationFilter@45964b9e]
17:56:21:689 INFO 21468 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port 8800 (http) with context path ''
17:56:21:694 INFO 21468 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Started ServiceApplication in 1.954 seconds (process running for 2.298)
17:56:23:516 INFO 21468 --- [bunny-service] [http-nio-8800-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
17:56:23:516 INFO 21468 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
17:56:23:517 INFO 21468 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms
17:56:26:380 ERROR 21468 --- [bunny-service] [http-nio-8800-exec-7] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
17:56:26:520 INFO 21468 --- [bunny-service] [http-nio-8800-exec-10] o.springdoc.api.AbstractOpenApiResource : Init duration for springdoc-openapi is: 102 ms
17:59:09:914 INFO 25036 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 25036 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
17:59:09:914 INFO 25036 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
17:59:10:320 INFO 25036 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
17:59:10:321 INFO 25036 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
17:59:10:337 INFO 25036 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7 ms. Found 0 Redis repository interfaces.
17:59:10:716 INFO 25036 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8800 (http)
17:59:10:723 INFO 25036 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
17:59:10:724 INFO 25036 --- [bunny-service] [main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.20]
17:59:10:767 INFO 25036 --- [bunny-service] [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
17:59:10:767 INFO 25036 --- [bunny-service] [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 829 ms
17:59:10:820 INFO 25036 --- [bunny-service] [main] c.b.c.service.config.MybatisPlusConfig : MybatisPlusInterceptor===>注入Mybatis-Plus配置...
17:59:11:071 INFO 25036 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>使用StringRedisSerializer序列化为字符串
17:59:11:134 INFO 25036 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>解决cache(@Cacheable)把数据缓存到redis中的value是乱码问题
17:59:11:136 INFO 25036 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>指定的日期模式
17:59:11:142 INFO 25036 --- [bunny-service] [main] c.b.c.s.properties.MinioProperties : 注册MinioClient...
17:59:11:601 INFO 25036 --- [bunny-service] [main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@6a261998, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@70f3bf00, org.springframework.security.web.context.SecurityContextHolderFilter@7f584d0c, org.springframework.security.web.header.HeaderWriterFilter@3a012678, org.springframework.web.filter.CorsFilter@49770ef9, org.springframework.security.web.csrf.CsrfFilter@73905dff, org.springframework.security.web.authentication.logout.LogoutFilter@4a34de5e, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@58fbfefb, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@1bcf2c64, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@15bcecf9, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@4feaa4b8, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@15fd3088, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@f13e0a2, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@4f0cdd0f, org.springframework.security.web.access.ExceptionTranslationFilter@2681185e, org.springframework.security.web.access.intercept.AuthorizationFilter@219a2203]
17:59:11:634 INFO 25036 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port 8800 (http) with context path ''
17:59:11:638 INFO 25036 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Started ServiceApplication in 1.975 seconds (process running for 2.304)
17:59:13:119 INFO 25036 --- [bunny-service] [http-nio-8800-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
17:59:13:119 INFO 25036 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
17:59:13:120 INFO 25036 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms
17:59:16:150 ERROR 25036 --- [bunny-service] [http-nio-8800-exec-7] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
17:59:16:286 INFO 25036 --- [bunny-service] [http-nio-8800-exec-8] o.springdoc.api.AbstractOpenApiResource : Init duration for springdoc-openapi is: 102 ms
17:59:22:322 ERROR 25036 --- [bunny-service] [http-nio-8800-exec-2] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
17:59:23:328 ERROR 25036 --- [bunny-service] [http-nio-8800-exec-4] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
17:59:24:095 ERROR 25036 --- [bunny-service] [http-nio-8800-exec-3] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
17:59:29:057 ERROR 25036 --- [bunny-service] [http-nio-8800-exec-6] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
17:59:29:910 ERROR 25036 --- [bunny-service] [http-nio-8800-exec-1] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
18:02:15:643 INFO 24168 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 24168 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
18:02:15:644 INFO 24168 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
18:02:16:049 INFO 24168 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
18:02:16:049 INFO 24168 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
18:02:16:065 INFO 24168 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7 ms. Found 0 Redis repository interfaces.
18:02:16:415 INFO 24168 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8800 (http)
18:02:16:421 INFO 24168 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
18:02:16:421 INFO 24168 --- [bunny-service] [main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.20]
18:02:16:461 INFO 24168 --- [bunny-service] [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
18:02:16:461 INFO 24168 --- [bunny-service] [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 794 ms
18:02:16:513 INFO 24168 --- [bunny-service] [main] c.b.c.service.config.MybatisPlusConfig : MybatisPlusInterceptor===>注入Mybatis-Plus配置...
18:02:16:765 INFO 24168 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>使用StringRedisSerializer序列化为字符串
18:02:16:829 INFO 24168 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>解决cache(@Cacheable)把数据缓存到redis中的value是乱码问题
18:02:16:833 INFO 24168 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>指定的日期模式
18:02:16:837 INFO 24168 --- [bunny-service] [main] c.b.c.s.properties.MinioProperties : 注册MinioClient...
18:02:17:291 INFO 24168 --- [bunny-service] [main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@78324e97, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@73417494, org.springframework.security.web.context.SecurityContextHolderFilter@b75f3f4, org.springframework.security.web.header.HeaderWriterFilter@4b552b13, org.springframework.web.filter.CorsFilter@29b0c169, org.springframework.security.web.csrf.CsrfFilter@2681185e, org.springframework.security.web.authentication.logout.LogoutFilter@32e7df65, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@4f0cdd0f, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@9fd3b61, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@4d1b4fa1, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@1b120d48, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@5570dc21, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@1477d4e6, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@27b7e663, org.springframework.security.web.access.ExceptionTranslationFilter@4e481512, org.springframework.security.web.access.intercept.AuthorizationFilter@15bcecf9]
18:02:17:324 INFO 24168 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port 8800 (http) with context path ''
18:02:17:329 INFO 24168 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Started ServiceApplication in 1.935 seconds (process running for 2.299)
18:02:22:134 INFO 24168 --- [bunny-service] [http-nio-8800-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
18:02:22:134 INFO 24168 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
18:02:22:135 INFO 24168 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms
18:09:35:700 INFO 10524 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 10524 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
18:09:35:701 INFO 10524 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
18:09:36:133 INFO 10524 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
18:09:36:135 INFO 10524 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
18:09:36:151 INFO 10524 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 8 ms. Found 0 Redis repository interfaces.
18:09:36:514 INFO 10524 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8800 (http)
18:09:36:521 INFO 10524 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
18:09:36:521 INFO 10524 --- [bunny-service] [main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.20]
18:09:36:564 INFO 10524 --- [bunny-service] [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
18:09:36:564 INFO 10524 --- [bunny-service] [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 839 ms
18:09:36:622 INFO 10524 --- [bunny-service] [main] c.b.c.service.config.MybatisPlusConfig : MybatisPlusInterceptor===>注入Mybatis-Plus配置...
18:09:36:872 INFO 10524 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>使用StringRedisSerializer序列化为字符串
18:09:36:935 INFO 10524 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>解决cache(@Cacheable)把数据缓存到redis中的value是乱码问题
18:09:36:937 INFO 10524 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>指定的日期模式
18:09:36:941 INFO 10524 --- [bunny-service] [main] c.b.c.s.properties.MinioProperties : 注册MinioClient...
18:09:37:390 INFO 10524 --- [bunny-service] [main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@1afabf06, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@33060020, org.springframework.security.web.context.SecurityContextHolderFilter@774189d0, org.springframework.security.web.header.HeaderWriterFilter@7304ca87, org.springframework.web.filter.CorsFilter@443b6765, org.springframework.security.web.csrf.CsrfFilter@48f2d51d, org.springframework.security.web.authentication.logout.LogoutFilter@5570dc21, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@43201f84, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@4c599679, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@a72925, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@421d7900, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@2681185e, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@41f5389f, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@4feaa4b8, org.springframework.security.web.access.ExceptionTranslationFilter@18918d70, org.springframework.security.web.access.intercept.AuthorizationFilter@77648321]
18:09:37:421 INFO 10524 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port 8800 (http) with context path ''
18:09:37:426 INFO 10524 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Started ServiceApplication in 1.98 seconds (process running for 2.308)
18:09:39:687 INFO 10524 --- [bunny-service] [http-nio-8800-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
18:09:39:687 INFO 10524 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
18:09:39:689 INFO 10524 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 0 ms
18:09:45:133 ERROR 10524 --- [bunny-service] [http-nio-8800-exec-2] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
18:09:45:269 INFO 10524 --- [bunny-service] [http-nio-8800-exec-6] o.springdoc.api.AbstractOpenApiResource : Init duration for springdoc-openapi is: 101 ms
18:10:01:541 ERROR 10524 --- [bunny-service] [http-nio-8800-exec-5] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
18:10:06:572 ERROR 10524 --- [bunny-service] [http-nio-8800-exec-4] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
18:23:29:234 INFO 26368 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 26368 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
18:23:29:235 INFO 26368 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
18:23:29:667 INFO 26368 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
18:23:29:668 INFO 26368 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
18:23:29:683 INFO 26368 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7 ms. Found 0 Redis repository interfaces.
18:23:30:050 INFO 26368 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8800 (http)
18:23:30:064 INFO 26368 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
18:23:30:064 INFO 26368 --- [bunny-service] [main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.20]
18:23:30:103 INFO 26368 --- [bunny-service] [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
18:23:30:103 INFO 26368 --- [bunny-service] [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 844 ms
18:23:30:163 INFO 26368 --- [bunny-service] [main] c.b.c.service.config.MybatisPlusConfig : MybatisPlusInterceptor===>注入Mybatis-Plus配置...
18:23:30:458 INFO 26368 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>使用StringRedisSerializer序列化为字符串
18:23:30:532 INFO 26368 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>解决cache(@Cacheable)把数据缓存到redis中的value是乱码问题
18:23:30:534 INFO 26368 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>指定的日期模式
18:23:30:540 INFO 26368 --- [bunny-service] [main] c.b.c.s.properties.MinioProperties : 注册MinioClient...
18:23:31:032 INFO 26368 --- [bunny-service] [main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@2059c3ff, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@2f8ab988, org.springframework.security.web.context.SecurityContextHolderFilter@68af8288, org.springframework.security.web.header.HeaderWriterFilter@7772ec28, org.springframework.web.filter.CorsFilter@46c475ba, org.springframework.security.web.csrf.CsrfFilter@6b170692, org.springframework.security.web.authentication.logout.LogoutFilter@613a608e, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@386f88b3, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@e08d871, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@e47637c, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@7d4e424e, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@34ab398b, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@71634e64, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@606f0f70, org.springframework.security.web.access.ExceptionTranslationFilter@2ad6aeb8, org.springframework.security.web.access.intercept.AuthorizationFilter@51097500]
18:23:31:081 INFO 26368 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port 8800 (http) with context path ''
18:23:31:086 INFO 26368 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Started ServiceApplication in 2.125 seconds (process running for 2.48)
18:23:40:585 INFO 26368 --- [bunny-service] [http-nio-8800-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
18:23:40:585 INFO 26368 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
18:23:40:586 INFO 26368 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms
18:23:46:957 ERROR 26368 --- [bunny-service] [http-nio-8800-exec-1] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
18:23:47:104 INFO 26368 --- [bunny-service] [http-nio-8800-exec-4] o.springdoc.api.AbstractOpenApiResource : Init duration for springdoc-openapi is: 106 ms
18:26:39:343 INFO 19136 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 19136 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
18:26:39:345 INFO 19136 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
18:26:39:796 INFO 19136 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
18:26:39:797 INFO 19136 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
18:26:39:813 INFO 19136 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7 ms. Found 0 Redis repository interfaces.
18:26:40:232 INFO 19136 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8800 (http)
18:26:40:242 INFO 19136 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
18:26:40:242 INFO 19136 --- [bunny-service] [main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.20]
18:26:40:298 INFO 19136 --- [bunny-service] [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
18:26:40:298 INFO 19136 --- [bunny-service] [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 930 ms
18:26:40:381 INFO 19136 --- [bunny-service] [main] c.b.c.service.config.MybatisPlusConfig : MybatisPlusInterceptor===>注入Mybatis-Plus配置...
18:26:40:699 INFO 19136 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>使用StringRedisSerializer序列化为字符串
18:26:40:772 INFO 19136 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>解决cache(@Cacheable)把数据缓存到redis中的value是乱码问题
18:26:40:776 INFO 19136 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>指定的日期模式
18:26:40:782 INFO 19136 --- [bunny-service] [main] c.b.c.s.properties.MinioProperties : 注册MinioClient...
18:26:41:256 INFO 19136 --- [bunny-service] [main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@65cc3902, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@c79915a, org.springframework.security.web.context.SecurityContextHolderFilter@4f0cdd0f, org.springframework.security.web.header.HeaderWriterFilter@70f3bf00, org.springframework.web.filter.CorsFilter@6173863f, org.springframework.security.web.csrf.CsrfFilter@4ef277ef, org.springframework.security.web.authentication.logout.LogoutFilter@fa689db, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@2941631f, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@34c07ecc, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@a08e41b, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@8dc3019, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@539bb233, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@21b2579d, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@e08d871, org.springframework.security.web.access.ExceptionTranslationFilter@53f1fcc2, org.springframework.security.web.access.intercept.AuthorizationFilter@25e24908]
18:26:41:295 INFO 19136 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port 8800 (http) with context path ''
18:26:41:303 INFO 19136 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Started ServiceApplication in 2.223 seconds (process running for 2.56)
18:26:41:340 INFO 19136 --- [bunny-service] [http-nio-8800-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
18:26:41:340 INFO 19136 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
18:26:41:342 INFO 19136 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms
18:26:54:251 ERROR 19136 --- [bunny-service] [http-nio-8800-exec-9] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
18:26:54:393 INFO 19136 --- [bunny-service] [http-nio-8800-exec-3] o.springdoc.api.AbstractOpenApiResource : Init duration for springdoc-openapi is: 103 ms
18:27:00:094 ERROR 19136 --- [bunny-service] [http-nio-8800-exec-4] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
18:27:09:682 ERROR 19136 --- [bunny-service] [http-nio-8800-exec-2] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
18:31:34:044 INFO 19716 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 19716 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
18:31:34:045 INFO 19716 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
18:31:34:462 INFO 19716 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
18:31:34:463 INFO 19716 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
18:31:34:479 INFO 19716 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 8 ms. Found 0 Redis repository interfaces.
18:31:34:838 INFO 19716 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8800 (http)
18:31:34:844 INFO 19716 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
18:31:34:845 INFO 19716 --- [bunny-service] [main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.20]
18:31:34:885 INFO 19716 --- [bunny-service] [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
18:31:34:886 INFO 19716 --- [bunny-service] [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 815 ms
18:31:34:939 INFO 19716 --- [bunny-service] [main] c.b.c.service.config.MybatisPlusConfig : MybatisPlusInterceptor===>注入Mybatis-Plus配置...
18:31:35:191 INFO 19716 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>使用StringRedisSerializer序列化为字符串
18:31:35:256 INFO 19716 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>解决cache(@Cacheable)把数据缓存到redis中的value是乱码问题
18:31:35:259 INFO 19716 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>指定的日期模式
18:31:35:264 INFO 19716 --- [bunny-service] [main] c.b.c.s.properties.MinioProperties : 注册MinioClient...
18:31:35:598 INFO 19716 --- [bunny-service] [main] c.b.common.service.config.Knife4jConfig : Knife4jConfig===>配置knife4j
18:31:35:603 INFO 19716 --- [bunny-service] [main] c.b.common.service.config.Knife4jConfig : Knife4jConfig===>配置knife4j
18:31:35:724 INFO 19716 --- [bunny-service] [main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@be9cc86, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@68af8288, org.springframework.security.web.context.SecurityContextHolderFilter@53f1fcc2, org.springframework.security.web.header.HeaderWriterFilter@a72925, org.springframework.web.filter.CorsFilter@8dc3019, org.springframework.security.web.csrf.CsrfFilter@27691ee8, org.springframework.security.web.authentication.logout.LogoutFilter@7f53b345, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@15aaf7b1, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@21b2579d, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@34ab398b, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@4e35a219, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@70f3bf00, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@49770ef9, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@71634e64, org.springframework.security.web.access.ExceptionTranslationFilter@33060020, org.springframework.security.web.access.intercept.AuthorizationFilter@430db481]
18:31:35:766 INFO 19716 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port 8800 (http) with context path ''
18:31:35:772 INFO 19716 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Started ServiceApplication in 1.994 seconds (process running for 2.331)
18:33:55:015 INFO 19716 --- [bunny-service] [http-nio-8800-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
18:33:55:016 INFO 19716 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
18:33:55:016 INFO 19716 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 0 ms
18:34:00:382 ERROR 19716 --- [bunny-service] [http-nio-8800-exec-5] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource .
18:34:00:462 ERROR 19716 --- [bunny-service] [http-nio-8800-exec-7] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
18:34:53:391 INFO 26600 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 26600 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
18:34:53:392 INFO 26600 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
18:34:53:819 INFO 26600 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
18:34:53:820 INFO 26600 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
18:34:53:835 INFO 26600 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7 ms. Found 0 Redis repository interfaces.
18:34:54:212 INFO 26600 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8800 (http)
18:34:54:219 INFO 26600 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
18:34:54:219 INFO 26600 --- [bunny-service] [main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.20]
18:34:54:261 INFO 26600 --- [bunny-service] [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
18:34:54:261 INFO 26600 --- [bunny-service] [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 844 ms
18:34:54:319 INFO 26600 --- [bunny-service] [main] c.b.c.service.config.MybatisPlusConfig : MybatisPlusInterceptor===>注入Mybatis-Plus配置...
18:34:54:588 INFO 26600 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>使用StringRedisSerializer序列化为字符串
18:34:54:657 INFO 26600 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>解决cache(@Cacheable)把数据缓存到redis中的value是乱码问题
18:34:54:658 INFO 26600 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>指定的日期模式
18:34:54:664 INFO 26600 --- [bunny-service] [main] c.b.c.s.properties.MinioProperties : 注册MinioClient...
18:34:55:004 INFO 26600 --- [bunny-service] [main] c.b.common.service.config.Knife4jConfig : Knife4jConfig===>配置knife4j
18:34:55:008 INFO 26600 --- [bunny-service] [main] c.b.common.service.config.Knife4jConfig : Knife4jConfig===>配置knife4j
18:34:55:133 INFO 26600 --- [bunny-service] [main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@2ad6aeb8, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@4e35a219, org.springframework.security.web.context.SecurityContextHolderFilter@443b6765, org.springframework.security.web.header.HeaderWriterFilter@166a5659, org.springframework.web.filter.CorsFilter@7772ec28, org.springframework.security.web.csrf.CsrfFilter@48da5106, org.springframework.security.web.authentication.logout.LogoutFilter@27b7e663, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@656672fb, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@15bcecf9, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@14d513ca, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@6130a6f5, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@4feaa4b8, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@4c6eaa65, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@be9cc86, org.springframework.security.web.access.ExceptionTranslationFilter@421d7900, org.springframework.security.web.access.intercept.AuthorizationFilter@3696d12d]
18:34:55:171 INFO 26600 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port 8800 (http) with context path ''
18:34:55:182 INFO 26600 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Started ServiceApplication in 2.065 seconds (process running for 2.427)
18:34:57:525 INFO 26600 --- [bunny-service] [http-nio-8800-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
18:34:57:525 INFO 26600 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
18:34:57:526 INFO 26600 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms
18:35:00:603 ERROR 26600 --- [bunny-service] [http-nio-8800-exec-6] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource .
18:35:00:677 ERROR 26600 --- [bunny-service] [http-nio-8800-exec-7] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
18:35:17:768 INFO 20028 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 20028 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
18:35:17:769 INFO 20028 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
18:35:18:198 INFO 20028 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
18:35:18:200 INFO 20028 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
18:35:18:216 INFO 20028 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7 ms. Found 0 Redis repository interfaces.
18:35:18:570 INFO 20028 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8800 (http)
18:35:18:578 INFO 20028 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
18:35:18:578 INFO 20028 --- [bunny-service] [main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.20]
18:35:18:625 INFO 20028 --- [bunny-service] [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
18:35:18:626 INFO 20028 --- [bunny-service] [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 834 ms
18:35:18:685 INFO 20028 --- [bunny-service] [main] c.b.c.service.config.MybatisPlusConfig : MybatisPlusInterceptor===>注入Mybatis-Plus配置...
18:35:18:933 INFO 20028 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>使用StringRedisSerializer序列化为字符串
18:35:19:001 INFO 20028 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>解决cache(@Cacheable)把数据缓存到redis中的value是乱码问题
18:35:19:003 INFO 20028 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>指定的日期模式
18:35:19:007 INFO 20028 --- [bunny-service] [main] c.b.c.s.properties.MinioProperties : 注册MinioClient...
18:35:19:349 INFO 20028 --- [bunny-service] [main] c.b.common.service.config.Knife4jConfig : Knife4jConfig===>配置knife4j
18:35:19:354 INFO 20028 --- [bunny-service] [main] c.b.common.service.config.Knife4jConfig : Knife4jConfig===>配置knife4j
18:35:19:472 INFO 20028 --- [bunny-service] [main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@67372d20, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@25e24908, org.springframework.security.web.context.SecurityContextHolderFilter@32e7df65, org.springframework.security.web.header.HeaderWriterFilter@219a2203, org.springframework.web.filter.CorsFilter@2941631f, org.springframework.security.web.csrf.CsrfFilter@30b97fcf, org.springframework.security.web.authentication.logout.LogoutFilter@236f3885, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@fa689db, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@4feaa4b8, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@6130a6f5, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@15aaf7b1, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@45964b9e, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@166a5659, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@3fb0d9de, org.springframework.security.web.access.ExceptionTranslationFilter@5ec3689b, org.springframework.security.web.access.intercept.AuthorizationFilter@ad585fb]
18:35:19:507 INFO 20028 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port 8800 (http) with context path ''
18:35:19:518 INFO 20028 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Started ServiceApplication in 2.009 seconds (process running for 2.355)
18:35:22:114 INFO 20028 --- [bunny-service] [http-nio-8800-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
18:35:22:114 INFO 20028 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
18:35:22:115 INFO 20028 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms
18:35:24:330 ERROR 20028 --- [bunny-service] [http-nio-8800-exec-6] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource .
18:35:24:405 ERROR 20028 --- [bunny-service] [http-nio-8800-exec-7] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource favicon.ico.
18:35:46:953 INFO 25872 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 25872 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
18:35:46:954 INFO 25872 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
18:35:47:374 INFO 25872 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
18:35:47:376 INFO 25872 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
18:35:47:392 INFO 25872 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7 ms. Found 0 Redis repository interfaces.
18:35:47:749 INFO 25872 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8800 (http)
18:35:47:756 INFO 25872 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
18:35:47:756 INFO 25872 --- [bunny-service] [main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.20]
18:35:47:795 INFO 25872 --- [bunny-service] [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
18:35:47:795 INFO 25872 --- [bunny-service] [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 818 ms
18:35:47:848 INFO 25872 --- [bunny-service] [main] c.b.c.service.config.MybatisPlusConfig : MybatisPlusInterceptor===>注入Mybatis-Plus配置...
18:35:48:099 INFO 25872 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>使用StringRedisSerializer序列化为字符串
18:35:48:165 INFO 25872 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>解决cache(@Cacheable)把数据缓存到redis中的value是乱码问题
18:35:48:167 INFO 25872 --- [bunny-service] [main] c.b.c.service.config.RedisConfiguration : RedisConfiguration===>指定的日期模式
18:35:48:172 INFO 25872 --- [bunny-service] [main] c.b.c.s.properties.MinioProperties : 注册MinioClient...
18:35:48:433 INFO 25872 --- [bunny-service] [main] c.b.c.s.config.WebMvcConfiguration : WebMvcConfiguration===>设置
18:35:48:508 INFO 25872 --- [bunny-service] [main] c.b.common.service.config.Knife4jConfig : Knife4jConfig===>配置knife4j
18:35:48:512 INFO 25872 --- [bunny-service] [main] c.b.common.service.config.Knife4jConfig : Knife4jConfig===>配置knife4j
18:35:48:627 INFO 25872 --- [bunny-service] [main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@be9cc86, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@68af8288, org.springframework.security.web.context.SecurityContextHolderFilter@53f1fcc2, org.springframework.security.web.header.HeaderWriterFilter@a72925, org.springframework.web.filter.CorsFilter@8dc3019, org.springframework.security.web.csrf.CsrfFilter@27691ee8, org.springframework.security.web.authentication.logout.LogoutFilter@7f53b345, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@15aaf7b1, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@21b2579d, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@34ab398b, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@4e35a219, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@70f3bf00, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@49770ef9, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@71634e64, org.springframework.security.web.access.ExceptionTranslationFilter@33060020, org.springframework.security.web.access.intercept.AuthorizationFilter@430db481]
18:35:48:667 INFO 25872 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port 8800 (http) with context path ''
18:35:48:672 INFO 25872 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Started ServiceApplication in 1.979 seconds (process running for 2.327)
18:35:52:910 INFO 25872 --- [bunny-service] [http-nio-8800-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
18:35:52:910 INFO 25872 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
18:35:52:911 INFO 25872 --- [bunny-service] [http-nio-8800-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms
18:35:54:928 ERROR 25872 --- [bunny-service] [http-nio-8800-exec-6] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource .
18:35:55:002 ERROR 25872 --- [bunny-service] [http-nio-8800-exec-4] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource /favicon.ico.
18:35:59:399 ERROR 25872 --- [bunny-service] [http-nio-8800-exec-1] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource /favicon.ico.
18:35:59:540 INFO 25872 --- [bunny-service] [http-nio-8800-exec-2] o.springdoc.api.AbstractOpenApiResource : Init duration for springdoc-openapi is: 102 ms
18:36:08:266 ERROR 25872 --- [bunny-service] [http-nio-8800-exec-7] c.b.c.s.e.GlobalExceptionHandler : GlobalExceptionHandler===>系统异常信息No static resource /favicon.ico.

View File

@ -15,7 +15,7 @@ import java.util.Map;
@Data
public class BaseEntity implements Serializable {
@TableId(type = IdType.AUTO)
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "唯一标识")
private Long id;

View File

@ -0,0 +1,29 @@
package cn.bunny.entity.email;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.web.multipart.MultipartFile;
/**
* 邮件发送对象
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class EmailSend {
// 给谁发送
private String sendTo;
// 发送主题
private String subject;
// 是否为富文本
private Boolean isRichText;
// 发送内容
private String message;
// 抄送人
private String ccParam;
// 发送的文件
private MultipartFile[] file;
}

View File

@ -0,0 +1,20 @@
package cn.bunny.entity.email;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 邮箱发送初始化参数
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class EmailSendInit {
private Integer port;
private String host;
private String username;
private String password;
}

View File

@ -0,0 +1,8 @@
package cn.bunny.enums;
/**
* 数据库操作类型
*/
public enum OperationType {
UPDATE, INSERT
}

View File

@ -8,32 +8,29 @@ import lombok.Getter;
@Getter
public enum ResultCodeEnum {
SUCCESS(200, "操作成功"),
SUCCESS_LOGOUT(200, "退出成功"),
FAIL(201, "失败"),
SERVICE_ERROR(2012, "服务异常"),
DATA_ERROR(204, "数据异常"),
LOGIN_MOBLE_ERROR(204, "登录错误"),
ILLEGAL_REQUEST(205, "非法请求"),
REPEAT_SUBMIT(206, "重复提交"),
LOGIN_AUTH(208, "未登陆"),
PERMISSION(209, "没有权限"),
ORDER_PRICE_ERROR(210, "订单商品价格变化"),
ORDER_STOCK_FALL(204, "订单库存锁定失败"),
CREATE_ORDER_FAIL(210, "创建订单失败"),
COUPON_GET(220, "优惠券已经领取"),
COUPON_LIMIT_GET(221, "优惠券已发放完毕"),
URL_ENCODE_ERROR(216, "URL编码失败"),
ILLEGAL_CALLBACK_REQUEST_ERROR(217, "非法回调请求"),
FETCH_ACCESSTOKEN_FAILD(218, "获取accessToken失败"),
FETCH_USERINFO_ERROR(219, "获取用户信息失败"),
SKU_LIMIT_ERROR(230, "购买个数不能大于限购个数"),
REGION_OPEN(240, "该区域已开通"),
REGION_NO_OPEN(240, "该区域未开通"),
;
FAIL_REQUEST_NOT_AUTH(403, "用户未认证"),
FAIL_NO_ACCESS_DENIED(403, "无权访问"),
LOGGED_IN_FROM_ANOTHER_DEVICE(403, "没有权限访问"),
THE_SAME_USER_HAS_LOGGED_IN(403, "相同用户已登录"),
SESSION_EXPIRATION(403, "会话过期");
private final Integer code;

View File

@ -0,0 +1,31 @@
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.bunny</groupId>
<artifactId>module</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>module-mail</artifactId>
<packaging>jar</packaging>
<name>module-mail</name>
<url>https://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>cn.bunny</groupId>
<artifactId>service-utils</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,23 @@
Configuration example
mail:
host: smtp.qq.com # 邮箱地址
port: 465 # 邮箱端口号
username: xxx@qq.com # 设置发送邮箱
password: xx # 如果是纯数字要加引号
default-encoding: UTF-8 # 设置编码格式
protocol: smtps
properties:
mail:
debug: true # 是否开启debug模式发送邮件
smtp:
auth: true
connectionTimeout: 5000 # 设置连接延迟
timeout: 5000 # 延迟时间
writeTimeout: 5000 # 写入邮箱延迟
allow8BitMime: true
sendPartial: true
ssl:
enabled: true # 是否开启SSL连接
socketFactory:
class: javax.net.ssl.SSLSocketFactory # 必要设置!!!

View File

@ -0,0 +1,23 @@
package cn.bunny.module.mail.utils;
import cn.bunny.common.constant.MailMessageConstant;
import cn.bunny.common.service.utils.EmptyUtil;
import cn.bunny.entity.email.EmailSend;
public class MailSendCheckUtil {
/**
* 检测发送对象是否为空的对象
*
* @param emailSend 邮件发送对象
*/
public static void check(EmailSend emailSend) {
// 空发送对象
EmptyUtil.isEmpty(emailSend, MailMessageConstant.EMPTY_SEND_OBJECT);
// 收件人不能为空
EmptyUtil.isEmpty(emailSend.getSendTo(), MailMessageConstant.ADDRESS_NOT_NULL);
// 标题不能为空
EmptyUtil.isEmpty(emailSend.getSubject(), MailMessageConstant.TITLE_NOT_NULL);
// 发送消息不能为空
EmptyUtil.isEmpty(emailSend.getMessage(), MailMessageConstant.SEND_MESSAGE_NOT_NULL);
}
}

View File

@ -0,0 +1,167 @@
package cn.bunny.module.mail.utils;
import cn.bunny.entity.email.EmailSend;
import cn.bunny.entity.email.EmailSendInit;
import jakarta.mail.MessagingException;
import jakarta.mail.internet.MimeMessage;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.web.multipart.MultipartFile;
import java.util.Objects;
public class MailSenderUtil {
private final String username;
private final JavaMailSenderImpl javaMailSender;
/**
* 初始化构造函数进行当前类赋值
*/
public MailSenderUtil(EmailSendInit emailSendInit) {
JavaMailSenderImpl javaMailSender = new JavaMailSenderImpl();
javaMailSender.setHost(emailSendInit.getHost());
javaMailSender.setPort(emailSendInit.getPort());
javaMailSender.setUsername(emailSendInit.getUsername());
javaMailSender.setPassword(emailSendInit.getPassword());
javaMailSender.setProtocol("smtps");
javaMailSender.setDefaultEncoding("UTF-8");
this.username = emailSendInit.getUsername();
this.javaMailSender = javaMailSender;
}
/**
* 综合邮箱发送
*
* @param emailSend 邮件消息
*/
public void sendEmail(EmailSend emailSend) throws MessagingException {
MailSendCheckUtil.check(emailSend);
// 创建 MimeMessage 对象用于发送邮件富文本或者附件
MimeMessage message = javaMailSender.createMimeMessage();
// 创建 MimeMessageHelper
MimeMessageHelper helper = new MimeMessageHelper(message, true);
// 设置发送人
helper.setFrom(username);
// 设置邮件接受者
helper.setTo(emailSend.getSendTo());
// 设置邮件主题
helper.setSubject(emailSend.getSubject());
// 设置发送消息 为富文本
helper.setText(emailSend.getMessage(), emailSend.getIsRichText());
// 设置抄送人
helper.setCc(emailSend.getCcParam().split(","));
// 邮件添加附件
MultipartFile[] files = emailSend.getFile();
for (MultipartFile file : files) {
helper.addAttachment(Objects.requireNonNull(file.getOriginalFilename()), file);
}
// 发送邮件
javaMailSender.send(message);
}
/**
* 发送邮件-简单
*
* @param emailSend 邮件消息
*/
public void sendSimpleEmail(EmailSend emailSend) {
MailSendCheckUtil.check(emailSend);
// 创建邮件消息体 SimpleMailMessage 发送简单邮件
SimpleMailMessage mailMessage = new SimpleMailMessage();
// 设置邮件发送人
mailMessage.setFrom(username);
// 设置邮件接受者
mailMessage.setTo(emailSend.getSendTo());
// 设置邮件主题
mailMessage.setSubject(emailSend.getSubject());
// 设置邮件消息
mailMessage.setText(emailSend.getMessage());
javaMailSender.send(mailMessage);
}
/**
* 发送带附件邮件
*
* @param emailSend 邮件消息
*/
public void sendAttachmentEmail(EmailSend emailSend, MultipartFile file, boolean isRich) throws MessagingException {
MailSendCheckUtil.check(emailSend);
// 创建 MimeMessage 对象用户发送附件或者是富文本内容
MimeMessage mailMessage = javaMailSender.createMimeMessage();
// 创建 MimeMessageHelper
MimeMessageHelper helper = new MimeMessageHelper(mailMessage, true);
// 奢姿邮件发送人
helper.setFrom(username);
// 设置邮件接受者
helper.setTo(emailSend.getSendTo());
// 设置邮件消息
helper.setText(emailSend.getMessage(), isRich);
// 设置邮件主题
helper.setSubject(emailSend.getSubject());
// 邮件添加附件
helper.addAttachment(Objects.requireNonNull(file.getOriginalFilename()), file);
// 发送邮件
javaMailSender.send(mailMessage);
}
/**
* 发送富文本邮件
*
* @param emailSend 邮件消息
*/
public void sendRichText(EmailSend emailSend, boolean isRich) throws MessagingException {
MailSendCheckUtil.check(emailSend);
// 创建 MimeMessage 对象用户发送附件或者是富文本内容
MimeMessage mailMessage = javaMailSender.createMimeMessage();
// 创建 MimeMessageHelper
MimeMessageHelper helper = new MimeMessageHelper(mailMessage, true);
// 设置邮件发送者
helper.setFrom(username);
// 设置邮件接受者
helper.setTo(emailSend.getSendTo());
// 设置邮件主题
helper.setSubject(emailSend.getSubject());
// 设置邮件富文本后面跟true 表示HTML格式发送
helper.setText(emailSend.getMessage(), isRich);
// 发送邮件
javaMailSender.send(mailMessage);
}
/**
* 发送带抄送的邮件
*
* @param emailSend 邮件消息
*/
public void sendCC(EmailSend emailSend, boolean isRich) throws MessagingException {
MailSendCheckUtil.check(emailSend);
// 创建 MimeMessage 对象用于发送邮件富文本或者附件
MimeMessage message = javaMailSender.createMimeMessage();
// 创建 MimeMessageHelper
MimeMessageHelper helper = new MimeMessageHelper(message, true);
// 设置发送人
helper.setFrom(username);
// 设置邮件接受者
helper.setTo(emailSend.getSendTo());
// 设置邮件主题
helper.setSubject(emailSend.getSubject());
// 设置发送消息 为富文本
helper.setText(emailSend.getMessage(), isRich);
// 设置抄送人
helper.setCc(emailSend.getCcParam().split(","));
// 发送邮件
javaMailSender.send(message);
}
}

View File

@ -0,0 +1,32 @@
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.bunny</groupId>
<artifactId>module</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>module-minio</artifactId>
<packaging>jar</packaging>
<name>module-minio</name>
<url>https://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>cn.bunny</groupId>
<artifactId>service-utils</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<!-- minio -->
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,4 +1,4 @@
package cn.bunny.common.service.properties;
package cn.bunny.module.minio.properties;
import io.minio.MinioClient;
import lombok.Data;

View File

@ -0,0 +1,982 @@
package cn.bunny.module.minio.utils;
import cn.bunny.common.constant.MinioMessageConstant;
import cn.bunny.common.service.exception.BunnyException;
import io.minio.*;
import io.minio.messages.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
/**
* Minio操作工具类 简化操作步骤
* ByBunny0212
*/
@Component
@Slf4j
public class MinioUtil {
@Autowired
private MinioClient minioClient;
/**
* 判断桶是否存在
*
* @param bucketName 桶名称
* @return 布尔值是否存在
*/
public boolean bucketExists(String bucketName) {
boolean found = false;
try {
found = minioClient.bucketExists(BucketExistsArgs.builder().bucket(bucketName).build());
return found;
} catch (Exception exception) {
log.error("判断桶是否存在 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
}
throw new BunnyException(MinioMessageConstant.BUCKET_EXISTS_EXCEPTION);
}
/**
* 删除桶的加密配置
*
* @param bucketName 桶名称
*/
public void deleteBucketEncryption(String bucketName) {
try {
minioClient.deleteBucketEncryption(DeleteBucketEncryptionArgs.builder().build());
log.info("删除桶的加密配置 ------ 成功");
} catch (Exception exception) {
log.error("删除桶的加密配置 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
}
throw new BunnyException(MinioMessageConstant.DELETE_BUCKET_EXCEPTION);
}
/**
* 删除桶的生命周期配置
*
* @param bucketName 桶名称
*/
public void deleteBucketLifecycle(String bucketName) {
try {
minioClient.deleteBucketLifecycle(DeleteBucketLifecycleArgs.builder().build());
log.info("删除桶的生命周期配置 ------ 成功");
} catch (Exception exception) {
log.error("删除桶的生命周期配置 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.DELETE_BUCKET_EXCEPTION);
}
}
/**
* 删除桶的通知配置
*
* @param bucketName 桶的名称
*/
public void deleteBucketNotification(String bucketName) {
try {
minioClient.deleteBucketNotification(DeleteBucketNotificationArgs.builder().bucket(bucketName).build());
log.info("删除桶的通知配置 ------ 成功");
} catch (Exception exception) {
log.error("删除桶的加密配置 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.DELETE_BUCKET_EXCEPTION);
}
}
/**
* 删除桶策略配置
*
* @param bucketName 桶的名称
*/
public void deleteBucketPolicy(String bucketName) {
try {
minioClient.deleteBucketPolicy(DeleteBucketPolicyArgs.builder().bucket(bucketName).build());
log.info("删除桶中的对象锁配置 ------ 成功");
} catch (Exception exception) {
log.error("删除桶的加密配置 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.DELETE_BUCKET_EXCEPTION);
}
}
/**
* 删除桶的桶复制配置
*
* @param bucketName 桶的名称
*/
public void deleteBucketReplication(String bucketName) {
try {
minioClient.deleteBucketReplication(DeleteBucketReplicationArgs.builder().bucket(bucketName).build());
log.info("删除桶的桶复制配置 ------ 成功");
} catch (Exception exception) {
log.error("删除桶的桶复制配置 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.DELETE_BUCKET_EXCEPTION);
}
}
/**
* 删除桶的标签
*
* @param bucketName 桶的名称
*/
public void deleteBucketTags(String bucketName) {
try {
minioClient.deleteBucketTags(DeleteBucketTagsArgs.builder().bucket(bucketName).build());
log.info("删除桶的标签 ------ 成功");
} catch (Exception exception) {
log.error("删除桶的桶复制配置 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.DELETE_BUCKET_EXCEPTION);
}
}
/**
* 删除桶中的对象锁配置
*
* @param bucketName 桶的名称
*/
public void deleteObjectLockConfiguration(String bucketName) {
try {
minioClient.deleteObjectLockConfiguration(DeleteObjectLockConfigurationArgs.builder().bucket(bucketName).build());
log.info("删除桶中的对象锁配置 ------ 成功");
} catch (Exception exception) {
log.error("删除桶中的对象锁配置 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.DELETE_BUCKET_EXCEPTION);
}
}
/**
* 获取存储桶的加密配置
*
* @param bucketName 桶的名称
* @return SseConfiguration 获取成功不为null
*/
public SseConfiguration getBucketEncryption(String bucketName) {
SseConfiguration conf = null;
try {
conf = minioClient.getBucketEncryption(GetBucketEncryptionArgs.builder().bucket(bucketName).build());
log.info("获取存储桶的加密配置 ------ 成功");
} catch (Exception exception) {
log.error("获取存储桶的加密配置 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.GET_BUCKET_EXCEPTION);
}
return conf;
}
/**
* 获取存储桶的生命周期配置
*
* @param bucketName 桶的名称
* @return LifecycleConfiguration 获取成功不为null
*/
public LifecycleConfiguration getBucketLifecycle(String bucketName) {
LifecycleConfiguration lifecycle = null;
try {
lifecycle = minioClient.getBucketLifecycle(GetBucketLifecycleArgs.builder().bucket(bucketName).build());
log.info("获取存储桶的生命周期配置 ------ 成功");
} catch (Exception exception) {
log.error("获取存储桶的生命周期配置 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.GET_BUCKET_EXCEPTION);
}
return lifecycle;
}
/**
* 获取存储桶的通知配置
*
* @param bucketName 桶的名称
* @return NotificationConfiguration 获取成功不为null
*/
public NotificationConfiguration getBucketNotification(String bucketName) {
NotificationConfiguration configuration = null;
try {
configuration = minioClient.getBucketNotification(GetBucketNotificationArgs.builder().bucket(bucketName).build());
log.info("获取存储桶的通知配置 ------ 成功");
} catch (Exception exception) {
log.error("获取存储桶的通知配置 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.GET_BUCKET_EXCEPTION);
}
return configuration;
}
/**
* 获取桶的桶策略配置
*
* @param bucketName 桶的名称
* @return String 获取成功不为null
*/
public String getBucketPolicy(String bucketName) {
String config = null;
try {
config = minioClient.getBucketPolicy(GetBucketPolicyArgs.builder().bucket(bucketName).build());
log.info("获取桶的桶策略配置 ------ 成功");
} catch (Exception exception) {
log.error("获取桶的桶策略配置 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.GET_BUCKET_EXCEPTION);
}
return config;
}
/**
* 获取桶复制参数
*
* @param bucketName 桶的名称
* @return ReplicationConfiguration 获取成功不为null
*/
public ReplicationConfiguration getBucketReplication(String bucketName) {
ReplicationConfiguration configuration = null;
try {
configuration = minioClient.getBucketReplication(GetBucketReplicationArgs.builder().bucket(bucketName).build());
log.info("获取桶复制参数 ------ 成功");
} catch (Exception exception) {
log.error("获取桶复制参数 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.GET_BUCKET_EXCEPTION);
}
return configuration;
}
/**
* 获取存储桶的标签
*
* @param bucketName 桶的名称
* @return Tags 获取成功不为null
*/
public Tags getBucketTags(String bucketName) {
Tags tags = null;
try {
tags = minioClient.getBucketTags(GetBucketTagsArgs.builder().bucket(bucketName).build());
log.info("获取存储桶的标签 ------ 成功");
} catch (Exception exception) {
log.error("获取存储桶的标签 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.GET_BUCKET_EXCEPTION);
}
return tags;
}
/**
* 获取存储桶的版本控制配置
*
* @param bucketName 桶的名称
* @return Tags 获取成功不为null
*/
public VersioningConfiguration getBucketVersioning(String bucketName) {
VersioningConfiguration configuration = null;
try {
configuration = minioClient.getBucketVersioning(GetBucketVersioningArgs.builder().bucket(bucketName).build());
log.info("获取存储桶的版本控制配置 ------ 成功");
} catch (Exception exception) {
log.error("获取存储桶的版本控制配置 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.GET_BUCKET_EXCEPTION);
}
return configuration;
}
/**
* 获取存储桶中的对象锁配置
*
* @param bucketName 桶的名称
* @return Tags 获取成功不为null
*/
public ObjectLockConfiguration getObjectLockConfiguration(String bucketName) {
ObjectLockConfiguration configuration = null;
try {
configuration = minioClient.getObjectLockConfiguration(GetObjectLockConfigurationArgs.builder().bucket(bucketName).build());
log.info("获取存储桶中的对象锁配置 ------ 成功");
} catch (Exception exception) {
log.error("获取存储桶中的对象锁配置 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.GET_BUCKET_EXCEPTION);
}
return configuration;
}
/**
* 列出所有桶的桶信息
*
* @return Tags 获取成功不为null
*/
public List<Bucket> listBuckets() {
List<Bucket> buckets = null;
try {
buckets = minioClient.listBuckets();
log.info("列出所有桶的桶信息 ------ 成功");
} catch (Exception exception) {
log.error("列出所有桶的桶信息 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.QUERY_BUCKET_EXCEPTION);
}
return buckets;
}
/**
* 创建桶
*
* @param bucketName 桶的名称
*/
public void makeBucket(String bucketName) {
try {
minioClient.makeBucket(MakeBucketArgs.builder().bucket(bucketName).build());
log.info("创建桶 ------ 成功");
} catch (Exception exception) {
log.error("创建桶 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.CREATE_BUCKET_EXCEPTION);
}
}
/**
* 创建桶
*
* @param bucketName 桶的名称
*/
public void makeBucket(String bucketName, String region) {
try {
minioClient.makeBucket(MakeBucketArgs.builder().bucket(bucketName).region(region).build());
log.info("创建桶 ------ 成功");
} catch (Exception exception) {
log.error("创建桶 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.CREATE_BUCKET_EXCEPTION);
}
}
/**
* 创建桶
*
* @param bucketName 桶的名称
*/
public void makeBucket(String bucketName, String region, boolean objectLock) {
try {
minioClient.makeBucket(MakeBucketArgs.builder().bucket(bucketName).region(region).objectLock(objectLock).build());
log.info("创建桶 ------ 成功");
} catch (Exception exception) {
log.error("创建桶 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.CREATE_BUCKET_EXCEPTION);
}
}
/**
* 删除桶
*
* @param bucketName 桶的名称
*/
public void removeBucket(String bucketName) {
try {
minioClient.removeBucket(RemoveBucketArgs.builder().bucket(bucketName).build());
log.info("删除桶 ------ 成功");
} catch (Exception exception) {
log.error("删除桶 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.DELETE_BUCKET_EXCEPTION);
}
}
/**
* 设置桶的加密配置
*
* @param bucketName 同名称
* @param configuration 配置信息
*/
public void setBucketEncryption(String bucketName, SseConfiguration configuration) {
try {
minioClient.setBucketEncryption(SetBucketEncryptionArgs.builder().bucket(bucketName).config(configuration).build());
log.info("设置桶的加密配置 ------ 成功");
} catch (Exception exception) {
log.error("设置桶的加密配置 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.UPDATE_BUCKET_EXCEPTION);
}
}
/**
* 设置桶策略
*
* @param bucketName 同名称
* @param policyJson 配置信息
*/
public void setBucketPolicy(String bucketName, String policyJson) {
try {
minioClient.setBucketPolicy(SetBucketPolicyArgs.builder().bucket(bucketName).config(policyJson).build());
log.info("查看桶策略 ------ 成功");
} catch (Exception exception) {
log.error("查看桶策略 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.UPDATE_BUCKET_EXCEPTION);
}
}
/**
* 设置桶复制参数
*
* @param bucketName 同名称
* @param config 配置信息
* @return 布尔值是否完成
*/
public void setBucketReplication(String bucketName, ReplicationConfiguration config) {
try {
minioClient.setBucketReplication(SetBucketReplicationArgs.builder().bucket(bucketName).config(config).build());
log.info("设置桶复制参数 ------ 成功");
} catch (Exception exception) {
log.error("设置桶复制参数 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.UPDATE_BUCKET_EXCEPTION);
}
}
/**
* 设置/修改桶标签
*
* @param bucketName 桶名称
* @param map 标签集合
*/
public void setBucketTags(String bucketName, Map<String, String> map) {
try {
minioClient.setBucketTags(SetBucketTagsArgs.builder().bucket(bucketName).tags(map).build());
log.info("设置/修改桶标签 ------ 成功");
} catch (Exception exception) {
log.error("设置/修改桶标签 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.UPDATE_BUCKET_EXCEPTION);
}
}
/**
* 设置桶的版本配置
*
* @param bucketName 同名称
* @param configuration 配置信息
*/
public void setBucketVersioning(String bucketName, VersioningConfiguration configuration) {
try {
minioClient.setBucketVersioning(
SetBucketVersioningArgs.builder().bucket(bucketName).config(configuration).build());
log.info("设置桶的版本配置 ------ 成功");
} catch (Exception exception) {
log.error("设置桶的版本配置 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.UPDATE_BUCKET_EXCEPTION);
}
}
/**
* 对象对象锁定配置
*
* @param bucketName 同名称
* @param configuration 配置信息
*/
public void setObjectLockConfiguration(String bucketName, ObjectLockConfiguration configuration) {
try {
minioClient.setObjectLockConfiguration(SetObjectLockConfigurationArgs.builder().bucket(bucketName).config(configuration).build());
log.info("对象对象锁定配置 ------ 成功");
} catch (Exception exception) {
log.error("对象对象锁定配置 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.UPDATE_BUCKET_EXCEPTION);
}
}
/**
* 组合对象
*
* @param bucketName 同名称
* @param objectName 对象名称
* @param sources 对象列表
*/
public void composeObject(String bucketName, String objectName, List<ComposeSource> sources) {
try {
minioClient.composeObject(ComposeObjectArgs.builder().bucket(bucketName).object(objectName).sources(sources).build());
log.info("组合对象 ------ 成功");
} catch (Exception exception) {
log.error("组合对象 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.COMPOSE_OBJECT_EXCEPTION);
}
}
/**
* 组合对象
*
* @param bucketName 同名称
* @param objectName 对象名称
* @param sources 对象列表
* @param userMetadata 用户元数据
*/
public void composeObject(String bucketName, String objectName, List<ComposeSource> sources, Map<String, String> userMetadata) {
try {
minioClient.composeObject(ComposeObjectArgs.builder()
.bucket(bucketName)
.object(objectName)
.sources(sources)
.userMetadata(userMetadata).build());
log.info("组合对象 ------ 成功");
} catch (Exception exception) {
log.error("组合对象 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.COMPOSE_OBJECT_EXCEPTION);
}
}
/**
* 组合对象
*
* @param bucketName 同名称
* @param objectName 对象名称
* @param sources 对象列表
* @param userMetadata 用户元数据
* @param sideEncryption 通过组合源对象列表
*/
public void composeObject(String bucketName, String objectName, List<ComposeSource> sources, Map<String, String> userMetadata, ServerSideEncryption sideEncryption) {
try {
minioClient.composeObject(ComposeObjectArgs.builder()
.bucket(bucketName)
.object(objectName)
.sources(sources)
.userMetadata(userMetadata)
.sse(sideEncryption).build());
log.info("组合对象 ------ 成功");
} catch (Exception exception) {
log.error("组合对象 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.COMPOSE_OBJECT_EXCEPTION);
}
}
/**
* 复制另一个桶中文件
*
* @param bucketName 桶中名字
* @param objectName 复制名称
* @param sourceBucketName 复制到桶中名称
* @param sourceObjectName 复制完成后名称
*/
public void copyObject(String bucketName, String objectName, String sourceBucketName, String sourceObjectName) {
try {
minioClient.copyObject(CopyObjectArgs.builder()
.bucket(bucketName)
.object(objectName)
.source(CopySource.builder().bucket(sourceBucketName).object(sourceObjectName).build())
.build());
log.info("复制另一个桶中文件 ------ 成功");
} catch (Exception exception) {
log.error("复制另一个桶中文件 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.COPY_BUCKET_EXCEPTION);
}
}
/**
* 复制另一个桶中文件
*
* @param bucketName 桶中名字
* @param objectName 复制名称
* @param sourceBucketName 复制到桶中名称
* @param sourceObjectName 复制完成后名称
* @param sideEncryption 加密key
*/
public void copyObject(String bucketName, String objectName, String sourceBucketName, String sourceObjectName, ServerSideEncryption sideEncryption) {
try {
minioClient.copyObject(CopyObjectArgs.builder()
.bucket(bucketName)
.object(objectName)
.source(CopySource.builder().bucket(sourceBucketName).object(sourceObjectName).build())
.sse(sideEncryption)
.build());
log.info("复制另一个桶中文件 ------ 成功");
} catch (Exception exception) {
log.error("复制另一个桶中文件 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.COPY_BUCKET_EXCEPTION);
}
}
/**
* 复制另一个桶中文件
*
* @param bucketName 桶中名字
* @param objectName 复制名称
* @param sourceBucketName 复制到桶中名称
* @param sourceObjectName 复制完成后名称
* @param etag 标签
* @param headers 头部信息
*/
public void copyObject(String bucketName, String objectName, String sourceBucketName, String sourceObjectName, String etag, Map<String, String> headers) {
try {
minioClient.copyObject(CopyObjectArgs.builder()
.bucket(bucketName)
.object(objectName)
.source(CopySource.builder().bucket(sourceBucketName).object(sourceObjectName).matchETag(etag).build())
.headers(headers)
.build());
log.info("复制另一个桶中文件 ------ 成功");
} catch (Exception exception) {
log.error("复制另一个桶中文件 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.COPY_BUCKET_EXCEPTION);
}
}
/**
* 删除对象的标记
*
* @param bucketName 桶中名字
* @param objectName 复制名称
*/
public void deleteObjectTags(String bucketName, String objectName) {
try {
minioClient.deleteObjectTags(DeleteObjectTagsArgs.builder().bucket(bucketName).object(objectName).build());
log.info("删除对象的标记 ------ 成功");
} catch (Exception exception) {
log.error("删除对象的标记 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.DELETE_BUCKET_EXCEPTION);
}
}
/**
* 禁用对象
*
* @param bucketName 桶中名字
* @param objectName 复制名称
*/
public void disableObjectLegalHold(String bucketName, String objectName) {
try {
minioClient.disableObjectLegalHold(DisableObjectLegalHoldArgs.builder().bucket(bucketName).object(objectName).build());
log.info("禁用对象 ------ 成功");
} catch (Exception exception) {
log.error("禁用对象 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.DISABLE_BUCKET_EXCEPTION);
}
}
/**
* 启用文件对象
*
* @param bucketName 桶中名字
* @param objectName 复制名称
*/
public void enableObjectLegalHold(String bucketName, String objectName) {
try {
minioClient.enableObjectLegalHold(EnableObjectLegalHoldArgs.builder().bucket(bucketName).object(objectName).build());
log.info("禁用对象 ------ 成功");
} catch (Exception exception) {
log.error("禁用对象 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.ENABLE_BUCKET_EXCEPTION);
}
}
/**
* 获取文件
*
* @param bucketName 桶名称
* @param objectName 对象名称
*/
public InputStream getObject(String bucketName, String objectName) {
try {
GetObjectResponse object = minioClient.getObject(GetObjectArgs.builder().bucket(bucketName).object(objectName).build());
log.info("获取文件 ------ 成功");
return object;
} catch (Exception exception) {
log.error("获取文件 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.GET_BUCKET_EXCEPTION);
}
}
/**
* 下载文件
*
* @param bucketName 桶名称
* @param objectName 对象名称
* @param filename 文件名
*/
public void downloadObject(String bucketName, String objectName, String filename) {
try {
minioClient.downloadObject(DownloadObjectArgs.builder().bucket(bucketName).object(objectName).filename(filename).build());
log.info("下载文件 ------ 成功");
} catch (Exception exception) {
log.error("下载文件 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.DOWNLOAD_BUCKET_EXCEPTION);
}
}
/**
* 下载文件
*
* @param bucketName 桶名称
* @param objectName 对象名称
* @param filename 文件名
* @param sideEncryption 秘钥
*/
public void downloadObject(String bucketName, String objectName, String filename, ServerSideEncryptionCustomerKey sideEncryption) {
try {
minioClient.downloadObject(DownloadObjectArgs.builder().bucket(bucketName).object(objectName).filename(filename).ssec(sideEncryption).build());
log.info("下载文件 ------ 成功");
} catch (Exception exception) {
log.error("下载文件 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.DOWNLOAD_BUCKET_EXCEPTION);
}
}
/**
* 获取对象保留
*
* @param bucketName 桶名称
* @param objectName 对象名称
* @param versionId 版本ID
* @return 对象保留
*/
public Retention getObjectRetention(String bucketName, String objectName, String versionId) {
try {
Retention retention = minioClient.getObjectRetention(GetObjectRetentionArgs.builder().bucket(bucketName).object(objectName).versionId(versionId).build());
log.info("获取对象保留 ------ 成功");
return retention;
} catch (Exception exception) {
log.error("获取对象保留 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.DOWNLOAD_BUCKET_EXCEPTION);
}
}
/**
* 获取对象标签
*
* @param bucketName 桶名称
* @param objectName 对象名称
* @return 对象保留
*/
public Tags getObjectTags(String bucketName, String objectName) {
try {
Tags tags = minioClient.getObjectTags(GetObjectTagsArgs.builder().bucket(bucketName).object(objectName).build());
log.info("获取对象标签 ------ 成功");
return tags;
} catch (Exception exception) {
log.error("获取对象标签 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.GET_BUCKET_EXCEPTION);
}
}
/**
* 上传文件
*
* @param bucketName 桶名称
* @param filename 文件名
* @param inputStream 输入流
* @param size 大小
*/
public void putObject(String bucketName, String filename, InputStream inputStream, Long size) {
try {
minioClient.putObject(PutObjectArgs.builder().bucket(bucketName).object(filename).stream(inputStream, size, -1).build());
log.info("上传文件 ------ 成功");
} catch (Exception exception) {
log.error("上传文件 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.UPLOAD_BUCKET_EXCEPTION);
}
}
/**
* 上传文件
*
* @param bucketName 桶名称
* @param filename 文件名
* @param contentType 文件类型
* @param inputStream 输入流
* @param size 大小
*/
public void putObject(String bucketName, String filename, String contentType, InputStream inputStream, Long size) {
try {
minioClient.putObject(PutObjectArgs.builder().bucket(bucketName).object(filename).stream(inputStream, size, -1).contentType(contentType).build());
log.info("上传文件 ------ 成功");
} catch (Exception exception) {
log.error("上传文件 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.UPLOAD_BUCKET_EXCEPTION);
}
}
/**
* 上传文件
*
* @param bucketName 桶名称
* @param object 对象信息
* @param filename 文件名
* @param contentType 文件类型
*/
public void putObject(String bucketName, String object, String filename, String contentType) {
try {
if (contentType != null) {
minioClient.uploadObject(UploadObjectArgs.builder().bucket(bucketName).object(filename).contentType(contentType).build());
} else {
minioClient.uploadObject(UploadObjectArgs.builder().bucket(bucketName).object(filename).build());
}
log.info("上传文件 ------ 成功");
} catch (Exception exception) {
log.error("上传文件 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.UPLOAD_BUCKET_EXCEPTION);
}
}
/**
* 删除文件
*
* @param bucketName 桶名称
* @param objectName 对象名称
*/
public void removeObject(String bucketName, String objectName) {
try {
minioClient.removeObject(RemoveObjectArgs.builder().bucket(bucketName).object(objectName).build());
log.info("删除文件 ------ 成功");
} catch (Exception exception) {
log.error("删除文件 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.DELETE_BUCKET_EXCEPTION);
}
}
/**
* 删除文件
*
* @param bucketName 桶名称
* @param objectName 对象名称
* @param versionId 版本号
*/
public void removeObject(String bucketName, String objectName, String versionId) {
try {
minioClient.removeObject(RemoveObjectArgs.builder().bucket(bucketName).object(objectName).versionId(versionId).build());
log.info("删除文件 ------ 成功");
} catch (Exception exception) {
log.error("删除文件 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.DELETE_BUCKET_EXCEPTION);
}
}
/**
* 删除文件
*
* @param bucketName 桶名称
* @param objectName 对象名称
* @param bypassRetentionMode 保持模式
*/
public void removeObject(String bucketName, String objectName, String versionId, boolean bypassRetentionMode) {
try {
minioClient.removeObject(RemoveObjectArgs.builder().bucket(bucketName).object(objectName).versionId(versionId).bypassGovernanceMode(bypassRetentionMode).build());
log.info("删除文件 ------ 成功");
} catch (Exception exception) {
log.error("删除文件 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.DELETE_BUCKET_EXCEPTION);
}
}
/**
* 上传多文件,通过创建中间TAR文件(可选压缩)来完成的
*
* @param bucketName 桶名称
* @param objects 对象名称
*/
public void uploadSnowballObjects(String bucketName, List<SnowballObject> objects) {
try {
minioClient.uploadSnowballObjects(UploadSnowballObjectsArgs.builder().bucket(bucketName).objects(objects).build());
log.info("上传多文件 ------ 成功");
} catch (Exception exception) {
log.error("上传多文件 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.UPLOAD_BUCKET_EXCEPTION);
}
}
/**
* 设置对象标签
*
* @param bucketName 桶名称
* @param objectName 对象名称
* @param retention 配置信息
* @param bypassGovernanceMode 保持模式
*/
public void setObjectLockRetention(String bucketName, String objectName, Retention retention, boolean bypassGovernanceMode) {
try {
minioClient.setObjectRetention(SetObjectRetentionArgs.builder().bucket(bucketName).object(objectName).config(retention).bypassGovernanceMode(bypassGovernanceMode).build());
log.info("删除文件 ------ 成功");
} catch (Exception exception) {
log.error("删除文件 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.UPDATE_BUCKET_EXCEPTION);
}
}
/**
* 设置对象标签
*
* @param bucketName 桶名称
* @param objectName 对象名称
* @param map 对象集合
*/
public void setObjectTags(String bucketName, String objectName, Map<String, String> map) {
try {
minioClient.setObjectTags(SetObjectTagsArgs.builder().bucket(bucketName).object(objectName).tags(map).build());
log.info("删除文件 ------ 成功");
} catch (Exception exception) {
log.error("删除文件 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.UPDATE_BUCKET_EXCEPTION);
}
}
/**
* 获取对象状态
*
* @param bucketName 桶名称
* @param objectName 对象名称
* @param versionId 版本ID
* @param customerKey 秘钥
* @return 对象信息
*/
public StatObjectResponse statObject(String bucketName, String objectName, String versionId, ServerSideEncryptionCustomerKey customerKey) {
try {
StatObjectResponse statObjectResponse = minioClient.statObject(StatObjectArgs.builder().bucket(bucketName).object(objectName).versionId(versionId).ssec(customerKey).build());
log.info("获取对象状态 ------ 成功");
return statObjectResponse;
} catch (Exception exception) {
log.error("获取对象状态 ------ 失败消息:{}", exception.getLocalizedMessage());
exception.getStackTrace();
throw new BunnyException(MinioMessageConstant.DELETE_BUCKET_EXCEPTION);
}
}
}

View File

@ -0,0 +1,30 @@
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.bunny</groupId>
<artifactId>module</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>module-rabbitMQ</artifactId>
<packaging>jar</packaging>
<name>module-rabbitMQ</name>
<url>https://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit-test</artifactId>
</dependency>
</dependencies>
</project>

32
module/pom.xml Normal file
View File

@ -0,0 +1,32 @@
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.bunny</groupId>
<artifactId>bunny-template</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>module</artifactId>
<packaging>pom</packaging>
<name>module</name>
<url>https://maven.apache.org</url>
<modules>
<module>module-minio</module>
<module>module-mail</module>
<module>module-rabbitMQ</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>cn.bunny</groupId>
<artifactId>model</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>

24
pom.xml
View File

@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.5</version>
<version>3.2.3</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>cn.bunny</groupId>
@ -19,6 +19,7 @@
<module>common</module>
<module>model</module>
<module>service</module>
<module>module</module>
</modules>
<properties>
@ -31,8 +32,10 @@
<fastjson2.version>2.0.47</fastjson2.version>
<minio.version>8.5.9</minio.version>
<lombok.version>1.18.32</lombok.version>
<jwt.version>0.9.1</jwt.version>
<easyexcel.version>3.3.3</easyexcel.version>
<jodatime.version>2.10.1</jodatime.version>
<aspectj>1.9.21</aspectj>
</properties>
<dependencyManagement>
<dependencies>
@ -78,11 +81,30 @@
<artifactId>hutool-all</artifactId>
<version>5.8.25</version>
</dependency>
<!--jjwt-->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>${jwt.version}</version>
</dependency>
<!-- Excel表操作 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>${easyexcel.version}</version>
</dependency>
<!-- aspectj -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${aspectj}</version>
</dependency>
<!-- aspectj -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj}</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>

View File

@ -20,6 +20,21 @@
</properties>
<dependencies>
<dependency>
<groupId>cn.bunny</groupId>
<artifactId>spring-security</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.bunny</groupId>
<artifactId>module-mail</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.bunny</groupId>
<artifactId>module-minio</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<!-- service-utils -->
<dependency>
<groupId>cn.bunny</groupId>
@ -37,6 +52,20 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<!-- websocket -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<!-- asp 切面 -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
</dependency>
</dependencies>
<build>

View File

@ -1,15 +1,22 @@
package cn.bunny.service;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication
@ComponentScan(basePackages = {"cn.bunny"})
@MapperScan("cn.bunny.service.mapper")
@EnableScheduling// 定时任务
@EnableCaching// 开启缓存注解
@SpringBootApplication
@Slf4j
public class ServiceApplication {
public static void main(String[] args) {
log.info("ServiceApplication启动...");
SpringApplication.run(ServiceApplication.class, args);
}
}

View File

@ -0,0 +1,15 @@
package cn.bunny.service.aop.annotation;
import cn.bunny.enums.OperationType;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface AutoFill {
// 数据库操作类型
OperationType value();
}

View File

@ -0,0 +1,27 @@
package cn.bunny.service.aop.aspect;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;
@Aspect
@Component
@Slf4j
public class AutoFillAspect {
@Pointcut("execution(* cn.bunny.service.*.*(..))")
public void autoFillPointcut() {
}
/**
* 之前操作
*
* @param joinPoint 参数
*/
@Before("autoFillPointcut()")
public void autoFill(JoinPoint joinPoint) {
log.info("开始进行自动填充");
}
}

View File

@ -0,0 +1,59 @@
package cn.bunny.service.controller;
import cn.bunny.common.result.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.session.SessionInformation;
import org.springframework.security.core.session.SessionRegistry;
import org.springframework.security.core.userdetails.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Tag(name = "后台登录管理")
@RestController
@RequestMapping("/")
public class BaseController {
@Autowired
private SessionRegistry sessionRegistry;
@GetMapping()
public String index() {
return "欢迎访问";
}
@Operation(summary = "Security上下文对象", description = "Security上下文对象")
@GetMapping("/test/getSecurityHolder")
public Result<Object> getSecurityHolder() {
SecurityContext context = SecurityContextHolder.getContext();
return Result.success(context);
}
@Operation(summary = "当前所有登录的用户", description = "当前所有登录的用户")
@GetMapping("/test/getAllUserLogin")
public Result<Object> getAllUserLogin() {
return Result.success(sessionRegistry.getAllPrincipals());
}
@Operation(summary = "剔除下线", description = "剔除下线")
@GetMapping("/test/killOut")
public Result<Object> killOut(String userId) {
List<Object> allPrincipals = sessionRegistry.getAllPrincipals();
for (Object allPrincipal : allPrincipals) {
// 获取当前所有已经登录session会话未失效的session
List<SessionInformation> allSessions = sessionRegistry.getAllSessions(allPrincipal, false);
User user = (User) allPrincipals;
// 如果用户名匹配将这个用户下线
if (user.getUsername().equals(userId)) {
allSessions.forEach(SessionInformation::expireNow);
}
}
return Result.success();
}
}

View File

@ -1,6 +1,6 @@
package cn.bunny.service.controller;
import cn.bunny.common.service.result.Result;
import cn.bunny.common.result.Result;
import cn.bunny.entity.system.Login;
import cn.bunny.entity.system.SysUserinfo;
import cn.bunny.service.service.SysUserService;
@ -40,7 +40,7 @@ public class IndexController {
}
@Operation(summary = "退出", description = "退出")
@PostMapping("logout")
@GetMapping("logout")
public Result<Map<String, Object>> logout() {
return Result.success();
}

View File

@ -0,0 +1,55 @@
package cn.bunny.service.controller;
import cn.bunny.common.result.Result;
import cn.bunny.entity.email.EmailSend;
import cn.bunny.service.service.EmailService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@Tag(name = "发送邮件")
@RequestMapping("/test/mail")
@Slf4j
public class MailController {
@Autowired
private EmailService emailService;
@Operation(summary = "发送简单邮件", description = "发送简单邮件")
@PostMapping("/send-text")
public Result<String> sendText(@RequestBody EmailSend emailSend) {
log.info("发送简单邮件");
emailService.sendSimpleEmail(emailSend);
return Result.success();
}
@Operation(summary = "发送带附件邮件", description = "发送带附件邮件")
@PostMapping("send-attachment")
public Result<String> sendAttachment(@RequestBody EmailSend emailSend) {
log.info("发送带附件邮件");
boolean isSuccess = emailService.sendAttachmentEmail(emailSend);
return isSuccess ? Result.success() : Result.error();
}
@Operation(summary = "发送富文本邮件", description = "发送富文本邮件")
@PostMapping("send-rich")
public Result<String> sendRich(@RequestBody EmailSend emailSend) {
log.info("发送富文本邮件");
boolean isSuccess = emailService.sendRich(emailSend);
return isSuccess ? Result.success() : Result.error();
}
@Operation(summary = "发送带抄送的邮件", description = "发送带抄送的邮件")
@PostMapping("send-cc")
public Result<String> sendCC(@RequestBody EmailSend emailSend) {
log.info("发送带抄送的邮件");
boolean isSuccess = emailService.sendCC(emailSend);
return isSuccess ? Result.success() : Result.error();
}
}

View File

@ -0,0 +1,18 @@
package cn.bunny.service.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 菜单表 前端控制器
* </p>
*
* @author Bunny
* @since 2024-05-06
*/
@RestController
@RequestMapping("/sysMenu")
public class SysMenuController {
}

View File

@ -0,0 +1,16 @@
package cn.bunny.service.mapper;
import cn.bunny.entity.system.SysMenu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 菜单表 Mapper 接口
* </p>
*
* @author Bunny
* @since 2024-05-06
*/
public interface SysMenuMapper extends BaseMapper<SysMenu> {
}

View File

@ -0,0 +1,7 @@
package cn.bunny.service.mapper;
import cn.bunny.entity.system.SysRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface SysRoleMapper extends BaseMapper<SysRole> {
}

View File

@ -0,0 +1,36 @@
package cn.bunny.service.security;
import cn.bunny.security.service.CustomAuthorizationManagerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.authorization.AuthorizationDecision;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.access.intercept.RequestAuthorizationContext;
import org.springframework.stereotype.Service;
import java.util.function.Supplier;
/**
* 自定义权限判断
* 判断用户有哪些权限
*/
@Service
@Slf4j
public class CustomAuthorizationManagerServiceImpl implements CustomAuthorizationManagerService {
@Override
public void verify(Supplier<Authentication> authentication, RequestAuthorizationContext requestAuthorizationContext) {
CustomAuthorizationManagerService.super.verify(authentication, requestAuthorizationContext);
}
@Override
public AuthorizationDecision check(Supplier<Authentication> authentication, RequestAuthorizationContext object) {
String token = object.getRequest().getHeader("token");
if (token == null) {
throw new AccessDeniedException("");
}
return new AuthorizationDecision(true);
}
}

View File

@ -0,0 +1,41 @@
package cn.bunny.service.security;
import cn.bunny.common.constant.CommonMessageConstant;
import cn.bunny.common.service.exception.BunnyException;
import cn.bunny.entity.system.SysRole;
import cn.bunny.entity.system.SysUser;
import cn.bunny.security.custom.CustomUser;
import cn.bunny.service.mapper.SysRoleMapper;
import cn.bunny.service.mapper.SysUserMapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import java.util.List;
@Configuration
public class CustomUserDetailsService implements cn.bunny.security.service.CustomUserDetailsService {
@Autowired
private SysUserMapper sysUserMapper;
@Autowired
private SysRoleMapper sysRoleMapper;
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
SysUser sysUser = sysUserMapper.selectOne(Wrappers.<SysUser>lambdaQuery().eq(SysUser::getUsername, username));
List<SysRole> sysRoleList = sysRoleMapper.selectList(null);
if (sysUser == null) {
throw new UsernameNotFoundException(CommonMessageConstant.USER_DOES_NOT_EXIST);
}
if (sysUser.getStatus() == 0) {
throw new BunnyException(CommonMessageConstant.ACCOUNT_LOCKED);
}
List<String> roleAuthoritieList = sysRoleList.stream().map(SysRole::getRoleCode).toList();
return new CustomUser(sysUser, AuthorityUtils.createAuthorityList(roleAuthoritieList));
}
}

View File

@ -0,0 +1,37 @@
package cn.bunny.service.service;
import cn.bunny.entity.email.EmailSend;
public interface EmailService {
/**
* 发送邮件-简单
*
* @param emailSend 邮件消息
*/
void sendSimpleEmail(EmailSend emailSend);
/**
* 发送带附件邮件
*
* @param emailSend 邮件消息
* @return 是否成功
*/
boolean sendAttachmentEmail(EmailSend emailSend);
/**
* 发送富文本邮件
*
* @param emailSend 邮件消息
* @return 是否成功
*/
boolean sendRich(EmailSend emailSend);
/**
* 发送带抄送的邮件
*
* @param emailSend 邮件消息
* @return 是否成功
*/
boolean sendCC(EmailSend emailSend);
}

View File

@ -0,0 +1,16 @@
package cn.bunny.service.service;
import cn.bunny.entity.system.SysMenu;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 菜单表 服务类
* </p>
*
* @author Bunny
* @since 2024-05-06
*/
public interface SysMenuService extends IService<SysMenu> {
}

View File

@ -0,0 +1,8 @@
package cn.bunny.service.service;
import cn.bunny.entity.system.SysRole;
import com.baomidou.mybatisplus.extension.service.IService;
public interface SysRoleService extends IService<SysRole> {
}

View File

@ -32,4 +32,12 @@ public interface SysUserService extends IService<SysUser> {
* @return 用户信息
*/
SysUserinfo getUserinfo(HttpServletRequest request);
/**
* 根据用户名查询用户信息
*
* @param username 用户名
* @return 用户信息
*/
SysUser getByUsername(String username);
}

View File

@ -0,0 +1,98 @@
package cn.bunny.service.service.impl;
import cn.bunny.entity.email.EmailSend;
import cn.bunny.entity.email.EmailSendInit;
import cn.bunny.module.mail.utils.MailSenderUtil;
import cn.bunny.service.service.EmailService;
import jakarta.mail.MessagingException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Service
@Slf4j
public class EmailServiceImpl implements EmailService {
/**
* 发送邮件-简单
*
* @param emailSend 邮件消息
*/
@Override
public void sendSimpleEmail(EmailSend emailSend) {
EmailSendInit emailSendInit = new EmailSendInit();
emailSendInit.setHost("smtp.qq.com");
emailSendInit.setPort(465);
emailSendInit.setUsername("3324855376@qq.com");
emailSendInit.setPassword("axyqbvfuxkdqdaai");
MailSenderUtil mailSenderUtil = new MailSenderUtil(emailSendInit);
mailSenderUtil.sendSimpleEmail(emailSend);
}
/**
* 发送带附件邮件
*
* @param emailSend 邮件消息
* @return 是否成功
*/
@Override
public boolean sendAttachmentEmail(EmailSend emailSend) {
try {
EmailSendInit emailSendInit = new EmailSendInit();
emailSendInit.setHost("smtp.qq.com");
emailSendInit.setPort(465);
emailSendInit.setUsername("3324855376@qq.com");
emailSendInit.setPassword("axyqbvfuxkdqdaai");
MailSenderUtil mailSenderUtil = new MailSenderUtil(emailSendInit);
mailSenderUtil.sendEmail(emailSend);
return true;
} catch (MessagingException e) {
return false;
}
}
/**
* 发送富文本邮件
*
* @param emailSend 邮件消息
* @return 是否成功
*/
@Override
public boolean sendRich(EmailSend emailSend) {
try {
EmailSendInit emailSendInit = new EmailSendInit();
emailSendInit.setHost("smtp.qq.com");
emailSendInit.setPort(465);
emailSendInit.setUsername("3324855376@qq.com");
emailSendInit.setPassword("axyqbvfuxkdqdaai");
MailSenderUtil mailSenderUtil = new MailSenderUtil(emailSendInit);
mailSenderUtil.sendRichText(emailSend, true);
return true;
} catch (MessagingException e) {
return false;
}
}
/**
* 发送带抄送的邮件
*
* @param emailSend 邮件消息
*/
@Override
public boolean sendCC(EmailSend emailSend) {
try {
EmailSendInit emailSendInit = new EmailSendInit();
emailSendInit.setHost("smtp.qq.com");
emailSendInit.setPort(465);
emailSendInit.setUsername("3324855376@qq.com");
emailSendInit.setPassword("axyqbvfuxkdqdaai");
MailSenderUtil mailSenderUtil = new MailSenderUtil(emailSendInit);
mailSenderUtil.sendCC(emailSend, true);
return true;
} catch (MessagingException e) {
return false;
}
}
}

View File

@ -0,0 +1,20 @@
package cn.bunny.service.service.impl;
import cn.bunny.entity.system.SysMenu;
import cn.bunny.service.mapper.SysMenuMapper;
import cn.bunny.service.service.SysMenuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 菜单表 服务实现类
* </p>
*
* @author Bunny
* @since 2024-05-06
*/
@Service
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements SysMenuService {
}

View File

@ -0,0 +1,11 @@
package cn.bunny.service.service.impl;
import cn.bunny.entity.system.SysRole;
import cn.bunny.service.mapper.SysRoleMapper;
import cn.bunny.service.service.SysRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService {
}

View File

@ -1,8 +1,8 @@
package cn.bunny.service.service.impl;
import cn.bunny.common.service.constant.MessageConstant;
import cn.bunny.common.constant.CommonMessageConstant;
import cn.bunny.common.service.exception.BunnyException;
import cn.bunny.common.service.utils.JwtHelper;
import cn.bunny.entity.system.Login;
import cn.bunny.entity.system.SysUser;
import cn.bunny.entity.system.SysUserinfo;
@ -10,6 +10,7 @@ import cn.bunny.service.mapper.SysUserMapper;
import cn.bunny.service.service.SysUserService;
import cn.bunny.vo.system.LoginVo;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
@ -47,21 +48,22 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
// 用户是否存在
if (sysUser == null) {
throw new BunnyException(MessageConstant.ACCOUNT_NOT_FOUND);
throw new BunnyException(CommonMessageConstant.ACCOUNT_NOT_FOUND);
}
// 判断是否被禁用
if (sysUser.getStatus() == 0) {
throw new BunnyException(MessageConstant.ACCOUNT_LOCKED);
throw new BunnyException(CommonMessageConstant.ACCOUNT_LOCKED);
}
// 判断密码
String md5DigestAsHexPassword = DigestUtils.md5DigestAsHex(password.getBytes());
if (!md5DigestAsHexPassword.equals(sysUser.getPassword())) {
throw new BunnyException(MessageConstant.PASSWORD_ERROR);
throw new BunnyException(CommonMessageConstant.PASSWORD_ERROR);
}
// 添加token
return Login.builder().token("token").build();
String token = JwtHelper.createToken(sysUser.getId(), sysUser.getUsername());
return Login.builder().token(token).build();
}
/**
@ -75,4 +77,15 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
redisTemplate.opsForValue().set("test", "测试");
return null;
}
/**
* 根据用户名查询用户信息
*
* @param username 用户名
* @return 用户信息
*/
@Override
public SysUser getByUsername(String username) {
return getOne(Wrappers.<SysUser>lambdaQuery().eq(SysUser::getUsername, username));
}
}

View File

@ -0,0 +1,14 @@
package cn.bunny.service.task;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class TemplateTask {
@Scheduled(cron = "0/1 5 * * * ?")
public void templateTask() {
log.info("定时任务执行...");
}
}

View File

@ -0,0 +1,71 @@
package cn.bunny.service.websocket;
import jakarta.websocket.OnClose;
import jakarta.websocket.OnMessage;
import jakarta.websocket.OnOpen;
import jakarta.websocket.Session;
import jakarta.websocket.server.PathParam;
import jakarta.websocket.server.ServerEndpoint;
import org.springframework.stereotype.Component;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
/**
* WebSocket服务
*/
@Component
@ServerEndpoint("/ws/{sid}")
public class WebSocketServer {
// 存放会话对象
private static final Map<String, Session> sessionMap = new HashMap();
/**
* 连接建立成功调用的方法
*/
@OnOpen
public void onOpen(Session session, @PathParam("sid") String sid) {
System.out.println("客户端:" + sid + "建立连接");
sessionMap.put(sid, session);
}
/**
* 收到客户端消息后调用的方法
*
* @param message 客户端发送过来的消息
*/
@OnMessage
public void onMessage(String message, @PathParam("sid") String sid) {
System.out.println("收到来自客户端:" + sid + "的信息:" + message);
}
/**
* 连接关闭调用的方法
*
* @param sid 请求id
*/
@OnClose
public void onClose(@PathParam("sid") String sid) {
System.out.println("连接断开:" + sid);
sessionMap.remove(sid);
}
/**
* 群发
*
* @param message 消息
*/
public void sendToAllClient(String message) {
Collection<Session> sessions = sessionMap.values();
for (Session session : sessions) {
try {
// 服务器向客户端发送消息
session.getBasicRemote().sendText(message);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}

View File

@ -30,10 +30,6 @@ spring:
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
security:
user:
name: user
password: 1
mybatis-plus:
mapper-locations: classpath:mapper/*.xml
@ -50,3 +46,18 @@ logging:
file:
path: "logs/${spring.application.name}"
bunny:
minio:
endpointUrl: ${bunny.minio.endpointUrl}
accessKey: ${bunny.minio.accessKey}
secretKey: ${bunny.minio.secretKey}
bucket-name: ${bunny.minio.bucket-name}
snowflake:
datacenterBits: 5 # 数据中心id位数
workerBits: 5 # 机器id位数
sequenceBits: 12 # 序列id所占位数
datacenterId: 1 # 数据中心id,范围0-2^5-1
workerId: 1 # 机器id,范围0-2^5-1
twepoch: 1704038400000 # 时间戳起始点2024-01-01 00::00:00 的毫秒数)
maxBatchCount: 100000 #单次批量生成id的最大数量 默认10万

View File

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8" ?>
<configuration debug="false" xmlns="http://ch.qos.logback/xml/ns/logback"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ch.qos.logback/xml/ns/logback
https://raw.githubusercontent.com/enricopulatzo/logback-XSD/master/src/main/xsd/logback.xsd">
<appender name="STOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>
%cyan([%thread]) %yellow(%-5level) %green(%logger{100}).%boldRed(%method)-%boldMagenta(%line) - %blue(%msg%n)
</pattern>
</encoder>
</appender>
<!-- additivity:false 禁止重复打印日志 -->
<!-- 让SpringBoot内部日志ERROR级别 减少日志输出 -->
<logger name="org.springframework" level="ERROR" additivity="false">
<appender-ref ref="STOUT"/>
</logger>
<!-- 让mybatis整合包日志ERROR 减少日志输出 -->
<logger name="org.mybatis" level="ERROR" additivity="false">
<appender-ref ref="STOUT"/>
</logger>
<!-- 让ibatis 日志ERROR 减少日志输出 -->
<logger name="org.apache.ibatis" level="ERROR" additivity="false">
<appender-ref ref="STOUT"/>
</logger>
<!-- 让 tomcat包打印日志 日志ERROR 减少日志输出 -->
<logger name="org.apache" level="ERROR" additivity="false">
<appender-ref ref="STOUT"/>
</logger>
<!-- 我们自己开发的程序为DEBUG -->
<logger name="com.redpig" level="DEBUG" additivity="false">
<appender-ref ref="STOUT"/>
</logger>
<logger name="com.baomidou" level="ERROR" additivity="false">
<appender-ref ref="STOUT"/>
</logger>
<logger name="com.zaxxer" level="ERROR" additivity="false">
<appender-ref ref="STOUT"/>
</logger>
<!-- Activiti日志 -->
<logger name="org.activiti" level="ERROR" />
<logger name="org.activiti.engine.impl.persistence.entity" level="DEBUG" />
<logger name="_org.springframework" level="ERROR" />
<logger name="springfox.documentation" level="ERROR" />
<!-- root级别开debug 子目录根据需要关闭 -->
<root level="DEBUG">
<appender-ref ref="STOUT"/>
</root>
</configuration>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.bunny.service.mapper.SysMenuMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.bunny.entity.system.SysMenu">
<id column="id" property="id"/>
<result column="parent_id" property="parentId"/>
<result column="name" property="name"/>
<result column="type" property="type"/>
<result column="path" property="path"/>
<result column="component" property="component"/>
<result column="perms" property="perms"/>
<result column="icon" property="icon"/>
<result column="status" property="status"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="is_deleted" property="isDeleted"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, parent_id, name, type, path, component, perms, icon, sort_value, status, create_time, update_time, is_deleted
</sql>
</mapper>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.bunny.service.mapper.SysRoleMapper">
</mapper>

View File

@ -0,0 +1,27 @@
package cn.bunny;
import cn.bunny.security.custom.CustomPasswordEncoder;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.security.crypto.password.PasswordEncoder;
@SpringBootTest(classes = CustomPasswordEncoder.class)
class CustomPasswordEncoderTest {
@Autowired
private CustomPasswordEncoder customPasswordEncoder;
@Autowired
private PasswordEncoder passwordEncoder;
@Test
void testCustomPasswordEncoder() {
String encode = customPasswordEncoder.encode("111111");
System.out.println(encode);
}
@Test
void testPasswordEncoder() {
String encode = passwordEncoder.encode("111111");
System.out.println(encode);
}
}