Skip to content

Commit

Permalink
Merge pull request #195 from little3201/develop
Browse files Browse the repository at this point in the history
移除 重复代码,冗余配置;权限删除接口定义,仅保留树接口
little3201 authored Oct 6, 2024
2 parents 5fa13e7 + c107e06 commit 53d4c67
Showing 137 changed files with 1,360 additions and 1,776 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -3,7 +3,8 @@
<p align="center">
<img src="https://img.shields.io/badge/Spring%20Boot-3.3.4-green.svg" alt="Downloads">
<img src="https://sonarcloud.io/api/project_badges/measure?project=little3201_leafage-basic&metric=alert_status" alt="Quality Gate Status">
<img src="https://sonarcloud.io/api/project_badges/measure?project=little3201_leafage-basic&metric=coverage"/>
<img src="https://sonarcloud.io/api/project_badges/measure?project=little3201_leafage-basic&metric=code_smells" alt="code_smells">
<img src="https://sonarcloud.io/api/project_badges/measure?project=little3201_leafage-basic&metric=coverage" alt="coverage"/>
</p>

### 依赖
4 changes: 2 additions & 2 deletions assets/pom.xml
Original file line number Diff line number Diff line change
@@ -45,10 +45,10 @@
<groupId>top.leafage</groupId>
<artifactId>leafage-common</artifactId>
</dependency>
<!--<dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
</dependency>-->
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
159 changes: 0 additions & 159 deletions assets/src/main/java/io/leafage/basic/assets/audit/AuditMetadata.java

This file was deleted.

This file was deleted.

This file was deleted.

50 changes: 50 additions & 0 deletions assets/src/main/java/io/leafage/basic/assets/bo/FileRecordBO.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package io.leafage.basic.assets.bo;

/**
* bo class for file record.
*
* @author wq li
*/
public abstract class FileRecordBO {

private String name;

private String path;

private String type;

private float size;


public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getPath() {
return path;
}

public void setPath(String path) {
this.path = path;
}

public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}

public float getSize() {
return size;
}

public void setSize(float size) {
this.size = size;
}
}
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@
import java.util.Set;

/**
* bo class for post
* bo class for post.
*
* @author wq li
*/
Original file line number Diff line number Diff line change
@@ -17,19 +17,23 @@

package io.leafage.basic.assets.config;

import io.leafage.basic.assets.audit.AuditorAwareImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.domain.AuditorAware;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.data.web.config.EnableSpringDataWebSupport;
import top.leafage.common.servlet.audit.AuditorAwareImpl;

import static org.springframework.data.web.config.EnableSpringDataWebSupport.PageSerializationMode.VIA_DTO;

/**
* jpa config.
* audit config.
*
* @author wq li
*/
@Configuration
@EnableJpaAuditing
@EnableSpringDataWebSupport(pageSerializationMode = VIA_DTO)
public class AuditingConfiguration {

/**
Original file line number Diff line number Diff line change
@@ -17,21 +17,21 @@

package io.leafage.basic.assets.config;

//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.http.HttpMethod;
//import org.springframework.security.config.Customizer;
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
//import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
//import org.springframework.security.web.SecurityFilterChain;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.web.SecurityFilterChain;

/**
* resource server config.
*
* @author wq li
*/
//@Configuration
//@EnableWebSecurity
@Configuration
@EnableWebSecurity
public class ResourceServerConfiguration {

/**
@@ -41,12 +41,12 @@ public class ResourceServerConfiguration {
* @return a {@link org.springframework.security.web.SecurityFilterChain} object
* @throws java.lang.Exception if any.
*/
// @Bean
// public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
// http.authorizeHttpRequests((authorize) -> authorize
// .requestMatchers(HttpMethod.GET).permitAll()
// .anyRequest().authenticated()
// ).oauth2ResourceServer(o -> o.jwt(Customizer.withDefaults()));
// return http.build();
// }
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
http.authorizeHttpRequests((authorize) -> authorize
.requestMatchers(HttpMethod.GET).permitAll()
.anyRequest().authenticated()
).oauth2ResourceServer(o -> o.jwt(Customizer.withDefaults()));
return http.build();
}
}
Loading

0 comments on commit 53d4c67

Please sign in to comment.