增加mybatis代码生成功能

This commit is contained in:
2025-07-08 00:11:24 +08:00
parent 8b656907a3
commit 23537aa318
6 changed files with 55 additions and 63 deletions

View File

@ -1,16 +0,0 @@
package com.sczx.store.config;
import org.springdoc.core.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
//@Configuration
public class SpringDocConfig {
@Bean
public GroupedOpenApi publicApi() {
return GroupedOpenApi.builder()
.group("sczx-service")
.packagesToScan("com.sczx.app.controller")
.build();
}
}

View File

@ -0,0 +1,35 @@
package com.sczx.store.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.basePackage("com.sczx.store.controller")) // 修改为你的 controller 包路径
.paths(PathSelectors.any())
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("门店服务接口文档")
.description("sczx_store门店服务接口文档文档")
.version("1.0")
.build();
}
}

View File

@ -13,8 +13,8 @@ import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.List;
@Configuration
@EnableWebMvc
//@Configuration
//@EnableWebMvc
public class WebConfig implements WebMvcConfigurer {
@Override

View File

@ -68,11 +68,11 @@ hystrix:
thread:
timeoutInMilliseconds: 10000 # 默认熔断超时时间
springdoc:
swagger-ui:
url: /v3/api-docs
path: /doc.html
packages-to-scan: com.sczx.store.controller # 替换为你的 controller 包路径
#springdoc:
# swagger-ui:
# url: /v3/api-docs
# path: /doc.html
# packages-to-scan: com.sczx.store.controller # 替换为你的 controller 包路径
mybatis-plus:
mapper-locations: classpath*:mapper/**/*.xml
@ -81,6 +81,6 @@ mybatis-plus:
mapUnderscoreToCamelCase: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 控制台打印 SQL调试用
#auth:
# secret-key: his-is-a-very-long-and-secure-secret-key-for-jwt-signing-please-dont-use-short-keys
# token-expiration: 86400000 # 24小时
auth:
secret-key: his-is-a-very-long-and-secure-secret-key-for-jwt-signing-please-dont-use-short-keys
token-expiration: 86400000 # 24小时