Skip to content

Commit 80059a5

Browse files
authored
Merge pull request #196 from little3201/develop
添加代码生成接口
2 parents 53d4c67 + a0d631a commit 80059a5

File tree

255 files changed

+7802
-4021
lines changed

Some content is hidden

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

255 files changed

+7802
-4021
lines changed

assets/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LABEL maintainer="[email protected]"
77
# Add a volume pointing to /tmp
88
VOLUME /tmp
99

10-
# Make port 8763 available to the world outside this container
10+
# Make port 8764 available to the world outside this container
1111
EXPOSE 8764
1212

1313
# Add the application's jar to the container

assets/pom.xml

+9-11
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
~ Copyright 2018-2024 little3201.
4-
~
5-
~ Licensed under the Apache License, Version 2.0 (the "License");
6-
~ you may not use this file except in compliance with the License.
7-
~ You may obtain a copy of the License at
3+
~ Copyright (c) 2024. little3201.
84
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
98
~ https://www.apache.org/licenses/LICENSE-2.0
109
~
11-
~ Unless required by applicable law or agreed to in writing, software
12-
~ distributed under the License is distributed on an "AS IS" BASIS,
13-
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
~ See the License for the specific language governing permissions and
15-
~ limitations under the License.
16-
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" BASIS,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
1715
-->
1816

1917
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"

assets/src/main/java/io/leafage/basic/assets/AssetsApplication.java

+9-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
/*
2-
* Copyright 2018-2024 little3201.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
2+
* Copyright (c) 2024. little3201.
73
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
87
* https://www.apache.org/licenses/LICENSE-2.0
98
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
1614
*/
1715
package io.leafage.basic.assets;
1816

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

+9-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
/*
2-
* Copyright 2018-2024 little3201.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
2+
* Copyright (c) 2024. little3201.
73
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
87
* https://www.apache.org/licenses/LICENSE-2.0
98
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
1614
*/
1715

1816
package io.leafage.basic.assets.bo;

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

+20
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,36 @@
1+
/*
2+
* Copyright (c) 2024. little3201.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* https://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
116
package io.leafage.basic.assets.bo;
217

18+
import jakarta.validation.constraints.NotBlank;
19+
320
/**
421
* bo class for file record.
522
*
623
* @author wq li
724
*/
825
public abstract class FileRecordBO {
926

27+
@NotBlank
1028
private String name;
1129

30+
@NotBlank
1231
private String path;
1332

33+
@NotBlank
1434
private String type;
1535

1636
private float size;

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

+9-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
/*
2-
* Copyright 2018-2024 little3201.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
2+
* Copyright (c) 2024. little3201.
73
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
87
* https://www.apache.org/licenses/LICENSE-2.0
98
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
1614
*/
1715

1816
package io.leafage.basic.assets.bo;

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

+9-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
/*
2-
* Copyright 2018-2024 little3201.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
2+
* Copyright (c) 2024. little3201.
73
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
87
* https://www.apache.org/licenses/LICENSE-2.0
98
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
1614
*/
1715

1816
package io.leafage.basic.assets.bo;

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

+9-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
/*
2-
* Copyright 2018-2024 little3201.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
2+
* Copyright (c) 2024. little3201.
73
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
87
* https://www.apache.org/licenses/LICENSE-2.0
98
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
1614
*/
1715

1816
package io.leafage.basic.assets.bo;

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

+9-12
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
/*
2-
* Copyright 2018-2024 little3201.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
2+
* Copyright (c) 2024. little3201.
73
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
87
* https://www.apache.org/licenses/LICENSE-2.0
98
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
1614
*/
1715

1816
package io.leafage.basic.assets.config;
@@ -22,7 +20,6 @@
2220
import org.springframework.data.domain.AuditorAware;
2321
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
2422
import org.springframework.data.web.config.EnableSpringDataWebSupport;
25-
import top.leafage.common.servlet.audit.AuditorAwareImpl;
2623

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

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (c) 2024. little3201.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* https://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
16+
package io.leafage.basic.assets.config;
17+
18+
19+
import org.springframework.data.domain.AuditorAware;
20+
import org.springframework.security.core.context.SecurityContext;
21+
import org.springframework.security.core.context.SecurityContextHolder;
22+
import org.springframework.security.core.userdetails.User;
23+
24+
import java.util.Optional;
25+
26+
/**
27+
* auditor aware.
28+
*
29+
* @author wq li
30+
* @since 0.3.0
31+
*/
32+
public class AuditorAwareImpl implements AuditorAware<String> {
33+
34+
/**
35+
* {@inheritDoc}
36+
*/
37+
@Override
38+
public Optional<String> getCurrentAuditor() {
39+
return Optional.ofNullable(SecurityContextHolder.getContext())
40+
.map(SecurityContext::getAuthentication)
41+
.filter(auth -> auth.isAuthenticated() && auth.getPrincipal() instanceof User)
42+
.map(auth -> ((User) auth.getPrincipal()).getUsername());
43+
}
44+
}

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

+10-12
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
/*
2-
* Copyright 2018-2024 little3201.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
2+
* Copyright (c) 2024. little3201.
73
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
87
* https://www.apache.org/licenses/LICENSE-2.0
98
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
1614
*/
1715

1816
package io.leafage.basic.assets.config;
@@ -30,7 +28,7 @@
3028
*
3129
* @author wq li
3230
*/
33-
@Configuration
31+
@Configuration(proxyBeanMethods = false)
3432
@EnableWebSecurity
3533
public class ResourceServerConfiguration {
3634

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (c) 2024. little3201.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* https://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
@org.springframework.lang.NonNullApi
16+
package io.leafage.basic.assets.config;

assets/src/main/java/io/leafage/basic/assets/constants/StatisticsEnum.java

+9-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
/*
2-
* Copyright 2018-2024 little3201.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
2+
* Copyright (c) 2024. little3201.
73
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
87
* https://www.apache.org/licenses/LICENSE-2.0
98
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
1614
*/
1715

1816
package io.leafage.basic.assets.constants;

0 commit comments

Comments
 (0)