Skip to content

Commit 53d4c67

Browse files
authored
Merge pull request #195 from little3201/develop
移除 重复代码,冗余配置;权限删除接口定义,仅保留树接口
2 parents 5fa13e7 + c107e06 commit 53d4c67

File tree

137 files changed

+1360
-1776
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+1360
-1776
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
<p align="center">
44
<img src="https://img.shields.io/badge/Spring%20Boot-3.3.4-green.svg" alt="Downloads">
55
<img src="https://sonarcloud.io/api/project_badges/measure?project=little3201_leafage-basic&metric=alert_status" alt="Quality Gate Status">
6-
<img src="https://sonarcloud.io/api/project_badges/measure?project=little3201_leafage-basic&metric=coverage"/>
6+
<img src="https://sonarcloud.io/api/project_badges/measure?project=little3201_leafage-basic&metric=code_smells" alt="code_smells">
7+
<img src="https://sonarcloud.io/api/project_badges/measure?project=little3201_leafage-basic&metric=coverage" alt="coverage"/>
78
</p>
89

910
### 依赖

assets/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@
4545
<groupId>top.leafage</groupId>
4646
<artifactId>leafage-common</artifactId>
4747
</dependency>
48-
<!--<dependency>
48+
<dependency>
4949
<groupId>org.springframework.boot</groupId>
5050
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
51-
</dependency>-->
51+
</dependency>
5252
<dependency>
5353
<groupId>org.postgresql</groupId>
5454
<artifactId>postgresql</artifactId>

assets/src/main/java/io/leafage/basic/assets/audit/AuditMetadata.java

-159
This file was deleted.

assets/src/main/java/io/leafage/basic/assets/audit/AuditorAwareImpl.java

-36
This file was deleted.

assets/src/main/java/io/leafage/basic/assets/audit/package-info.java

-24
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package io.leafage.basic.assets.bo;
2+
3+
/**
4+
* bo class for file record.
5+
*
6+
* @author wq li
7+
*/
8+
public abstract class FileRecordBO {
9+
10+
private String name;
11+
12+
private String path;
13+
14+
private String type;
15+
16+
private float size;
17+
18+
19+
public String getName() {
20+
return name;
21+
}
22+
23+
public void setName(String name) {
24+
this.name = name;
25+
}
26+
27+
public String getPath() {
28+
return path;
29+
}
30+
31+
public void setPath(String path) {
32+
this.path = path;
33+
}
34+
35+
public String getType() {
36+
return type;
37+
}
38+
39+
public void setType(String type) {
40+
this.type = type;
41+
}
42+
43+
public float getSize() {
44+
return size;
45+
}
46+
47+
public void setSize(float size) {
48+
this.size = size;
49+
}
50+
}

assets/src/main/java/io/leafage/basic/assets/bo/PostBO.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import java.util.Set;
2525

2626
/**
27-
* bo class for post
27+
* bo class for post.
2828
*
2929
* @author wq li
3030
*/

assets/src/main/java/io/leafage/basic/assets/config/AuditingConfiguration.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,23 @@
1717

1818
package io.leafage.basic.assets.config;
1919

20-
import io.leafage.basic.assets.audit.AuditorAwareImpl;
2120
import org.springframework.context.annotation.Bean;
2221
import org.springframework.context.annotation.Configuration;
2322
import org.springframework.data.domain.AuditorAware;
2423
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
24+
import org.springframework.data.web.config.EnableSpringDataWebSupport;
25+
import top.leafage.common.servlet.audit.AuditorAwareImpl;
26+
27+
import static org.springframework.data.web.config.EnableSpringDataWebSupport.PageSerializationMode.VIA_DTO;
2528

2629
/**
27-
* jpa config.
30+
* audit config.
2831
*
2932
* @author wq li
3033
*/
3134
@Configuration
3235
@EnableJpaAuditing
36+
@EnableSpringDataWebSupport(pageSerializationMode = VIA_DTO)
3337
public class AuditingConfiguration {
3438

3539
/**

assets/src/main/java/io/leafage/basic/assets/config/ResourceServerConfiguration.java

+17-17
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@
1717

1818
package io.leafage.basic.assets.config;
1919

20-
//import org.springframework.context.annotation.Bean;
21-
//import org.springframework.context.annotation.Configuration;
22-
//import org.springframework.http.HttpMethod;
23-
//import org.springframework.security.config.Customizer;
24-
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
25-
//import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
26-
//import org.springframework.security.web.SecurityFilterChain;
20+
import org.springframework.context.annotation.Bean;
21+
import org.springframework.context.annotation.Configuration;
22+
import org.springframework.http.HttpMethod;
23+
import org.springframework.security.config.Customizer;
24+
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
25+
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
26+
import org.springframework.security.web.SecurityFilterChain;
2727

2828
/**
2929
* resource server config.
3030
*
3131
* @author wq li
3232
*/
33-
//@Configuration
34-
//@EnableWebSecurity
33+
@Configuration
34+
@EnableWebSecurity
3535
public class ResourceServerConfiguration {
3636

3737
/**
@@ -41,12 +41,12 @@ public class ResourceServerConfiguration {
4141
* @return a {@link org.springframework.security.web.SecurityFilterChain} object
4242
* @throws java.lang.Exception if any.
4343
*/
44-
// @Bean
45-
// public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
46-
// http.authorizeHttpRequests((authorize) -> authorize
47-
// .requestMatchers(HttpMethod.GET).permitAll()
48-
// .anyRequest().authenticated()
49-
// ).oauth2ResourceServer(o -> o.jwt(Customizer.withDefaults()));
50-
// return http.build();
51-
// }
44+
@Bean
45+
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
46+
http.authorizeHttpRequests((authorize) -> authorize
47+
.requestMatchers(HttpMethod.GET).permitAll()
48+
.anyRequest().authenticated()
49+
).oauth2ResourceServer(o -> o.jwt(Customizer.withDefaults()));
50+
return http.build();
51+
}
5252
}

0 commit comments

Comments
 (0)