dev #1

Merged
bunny merged 23 commits from dev into master 2024-04-04 21:23:46 +08:00
16 changed files with 93 additions and 19 deletions
Showing only changes of commit 040ca68248 - Show all commits

View File

@ -17,6 +17,7 @@
<file url="file://$PROJECT_DIR$/service-client/service-product-client/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/service-client/service-product-client/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/service-client/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/service-client/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/service-client/src/main/resources" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/service-client/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/service-gateway/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/service/service-acl/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/service/service-acl/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/service/service-product/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/service/service-product/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/service/service-search/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/service/service-search/src/main/java" charset="UTF-8" />

View File

@ -7,6 +7,11 @@
<option value="$PROJECT_DIR$/pom.xml" /> <option value="$PROJECT_DIR$/pom.xml" />
</list> </list>
</option> </option>
<option name="ignoredFiles">
<set>
<option value="$PROJECT_DIR$/service-gateway/pom.xml" />
</set>
</option>
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" /> <output url="file://$PROJECT_DIR$/out" />

View File

@ -21,5 +21,9 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
.allowCredentials(true)// 是否允许在跨域的情况下传递Cookie .allowCredentials(true)// 是否允许在跨域的情况下传递Cookie
.allowedOrigins("*")// 允许请求来源的域规则 .allowedOrigins("*")// 允许请求来源的域规则
.allowedMethods("*").allowedHeaders("*");// 允许所有的请求头 .allowedMethods("*").allowedHeaders("*");// 允许所有的请求头
registry.addMapping("/api/**")// 添加路径规则
.allowCredentials(true)// 是否允许在跨域的情况下传递Cookie
.allowedOrigins("*")// 允许请求来源的域规则
.allowedMethods("*").allowedHeaders("*");// 允许所有的请求头
} }
} }

View File

@ -33,8 +33,7 @@
<dependency> <dependency>
<groupId>com.github.xiaoymin</groupId> <groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId> <artifactId>knife4j-spring-boot-starter</artifactId>
<!--在引用时请在maven中央仓库搜索2.X最新版本号--> <version>3.0.3</version>
<scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -20,7 +20,10 @@
</properties> </properties>
<dependencies> <dependencies>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -6,7 +6,7 @@ import org.springframework.context.annotation.ComponentScan;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
@SpringBootApplication @SpringBootApplication
@ComponentScan(basePackages = {"com.atguigu.ssyx.common"}) @ComponentScan(basePackages = {"com.atguigu.ssyx.common", "com.atguigu.ssyx.acl"})
@EnableTransactionManagement @EnableTransactionManagement
public class ServiceAclApplication { public class ServiceAclApplication {
public static void main(String[] args) { public static void main(String[] args) {

View File

@ -1,5 +1,5 @@
server: server:
port: 8200 port: 8201
bunny: bunny:
datasource: datasource:

View File

@ -1,5 +1,5 @@
server: server:
port: 8200 port: 8201
spring: spring:
application: application:
name: service-acl name: service-acl

View File

@ -6,7 +6,10 @@ import org.springframework.context.annotation.ComponentScan;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
@SpringBootApplication @SpringBootApplication
@ComponentScan(basePackages = {"com.atguigu.ssyx.common", "com.atguigu.ssyx.mq"}) @ComponentScan(basePackages = {
"com.atguigu.ssyx.common",
"com.atguigu.ssyx.mq",
"com.atguigu.ssyx.product"})
@EnableTransactionManagement @EnableTransactionManagement
public class ServiceProductApplication { public class ServiceProductApplication {
public static void main(String[] args) { public static void main(String[] args) {

View File

@ -64,9 +64,9 @@ mybatis-plus:
logging: logging:
level: level:
com.atguigu.ssyx.acl.mapper: debug com.atguigu.ssyx.product.mapper: debug
com.atguigu.ssyx.acl.controller: info com.atguigu.ssyx.product.controller: info
com.atguigu.ssyx.acl.service: info com.atguigu.ssyx.product.service: info
pattern: pattern:
dateformat: HH:mm:ss:SSS dateformat: HH:mm:ss:SSS
file: file:

View File

@ -8,7 +8,10 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class) @SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@ComponentScan(basePackages = {"com.atguigu.ssyx.common", "com.atguigu.ssyx.mq"}) @ComponentScan(basePackages = {
"com.atguigu.ssyx.common",
"com.atguigu.ssyx.mq",
"com.atguigu.ssyx.search"})
@EnableFeignClients(basePackages = {"com.atguigu.ssyx.client"}) @EnableFeignClients(basePackages = {"com.atguigu.ssyx.client"})
@EnableDiscoveryClient @EnableDiscoveryClient
public class ServiceSearchApplication { public class ServiceSearchApplication {

View File

@ -0,0 +1,54 @@
package com.atguigu.ssyx.search.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.ParameterBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.schema.ModelRef;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.service.Parameter;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
import java.util.ArrayList;
import java.util.List;
@Configuration
@EnableSwagger2WebMvc
public class Knife4jConfig {
@Bean
public Docket adminApiConfig() {
List<Parameter> pars = new ArrayList<>();
ParameterBuilder tokenPar = new ParameterBuilder();
tokenPar.name("adminId")
.description("用户token")
.defaultValue("1")
.modelRef(new ModelRef("string"))
.parameterType("header")
.required(false)
.build();
pars.add(tokenPar.build());
return new Docket(DocumentationType.SWAGGER_2)
.groupName("搜索ES相关API")
.apiInfo(adminApiInfo())
.select()
.apis(RequestHandlerSelectors.basePackage("com.atguigu.ssyx.search.controller"))
.paths(PathSelectors.regex("/api/.*"))
.build()
.globalOperationParameters(pars);
}
private ApiInfo adminApiInfo() {
return new ApiInfoBuilder()
.title("后台管理系统-API文档")
.description("本文档描述了尚上优选后台系统服务接口定义")
.version("1.0")
.contact(new Contact("atguigu", "http://atguigu.com", "atguigu"))
.build();
}
}

View File

@ -72,9 +72,9 @@ feign:
logging: logging:
level: level:
com.atguigu.ssyx.acl.mapper: debug com.atguigu.ssyx.search.mapper: debug
com.atguigu.ssyx.acl.controller: info com.atguigu.ssyx.search.controller: info
com.atguigu.ssyx.acl.service: info com.atguigu.ssyx.search.service: info
pattern: pattern:
dateformat: HH:mm:ss:SSS dateformat: HH:mm:ss:SSS
file: file:

View File

@ -7,7 +7,9 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@SpringBootApplication @SpringBootApplication
@EnableTransactionManagement @EnableTransactionManagement
@ComponentScan(basePackages = {"com.atguigu.ssyx.common"}) @ComponentScan(basePackages = {
"com.atguigu.ssyx.common",
"com.atguigu.ssyx.sys"})
public class ServiceSysApplication { public class ServiceSysApplication {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(ServiceSysApplication.class, args); SpringApplication.run(ServiceSysApplication.class, args);

View File

@ -40,7 +40,7 @@ public class Knife4jConfig {
.select() .select()
// 只显示api路径下的页面 // 只显示api路径下的页面
.apis(RequestHandlerSelectors.basePackage("com.atguigu.ssyx.sys")) .apis(RequestHandlerSelectors.basePackage("com.atguigu.ssyx.sys"))
.paths(PathSelectors.regex("/admin/sys/regionWare/.*|/system/.*")) .paths(PathSelectors.regex("/admin/.*"))
.build() .build()
.globalOperationParameters(pars); .globalOperationParameters(pars);
} }

View File

@ -47,9 +47,9 @@ mybatis-plus:
logging: logging:
level: level:
com.atguigu.ssyx.acl.mapper: debug com.atguigu.ssyx.sys.mapper: debug
com.atguigu.ssyx.acl.controller: info com.atguigu.ssyx.sys.controller: info
com.atguigu.ssyx.acl.service: info com.atguigu.ssyx.sys.service: info
pattern: pattern:
dateformat: HH:mm:ss:SSS dateformat: HH:mm:ss:SSS
file: file: