Skip to content

Commit f3bc917

Browse files
authored
fix: Modify code format (#208)
* fix: Modify code format
1 parent 50e94c7 commit f3bc917

File tree

9 files changed

+29
-35
lines changed

9 files changed

+29
-35
lines changed

app/src/main/java/com/tinyengine/it/config/filter/WebConfig.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,12 @@
2424
import java.util.List;
2525

2626
@Configuration
27-
public class WebConfig implements WebMvcConfigurer {
27+
public class WebConfig implements WebMvcConfigurer {
2828
@Value("${cors.allowed-origins}")
2929
private String allowedOrigins;
3030

3131
@Bean
32-
public CorsFilter corsFilter()
33-
{
32+
public CorsFilter corsFilter() {
3433
// 跨域配置地址
3534
List<String> crosDomainList = Arrays.asList(allowedOrigins.split(","));
3635

@@ -46,6 +45,6 @@ public CorsFilter corsFilter()
4645

4746
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
4847
source.registerCorsConfiguration("/**", corsConfiguration);
49-
return new CorsFilter(source);
50-
}
48+
return new CorsFilter(source);
49+
}
5150
}

base/src/main/java/com/tinyengine/it/controller/ComponentController.java

-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import com.tinyengine.it.model.dto.BundleResultDto;
1919
import com.tinyengine.it.model.dto.CustComponentDto;
2020
import com.tinyengine.it.model.dto.FileResult;
21-
import com.tinyengine.it.model.entity.Component;
2221
import com.tinyengine.it.service.material.ComponentService;
2322

2423
import io.swagger.v3.oas.annotations.Operation;
@@ -38,7 +37,6 @@
3837
import org.springframework.web.multipart.MultipartFile;
3938

4039
import javax.validation.Valid;
41-
import java.util.List;
4240

4341
/**
4442
* 组件api

base/src/main/java/com/tinyengine/it/model/dto/PackagesDto.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ public class PackagesDto {
3232
private String version;
3333
private String script;
3434
private String css;
35-
private Map<String,Object> others;
35+
private Map<String, Object> others;
3636
}

base/src/main/java/com/tinyengine/it/model/entity/App.java

-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
import lombok.Setter;
2525

2626
import java.time.LocalDateTime;
27-
import java.util.ArrayList;
28-
import java.util.HashMap;
2927
import java.util.List;
3028
import java.util.Map;
3129

base/src/main/java/com/tinyengine/it/service/app/impl/v1/AppV1ServiceImpl.java

+9-8
Original file line numberDiff line numberDiff line change
@@ -252,19 +252,20 @@ private SchemaMeta getSchemaMeta(MetaDto metaDto) {
252252
*
253253
* @return List<ComponentLibrary> the List<ComponentLibrary>
254254
*/
255-
private List<PackagesDto> getPackages(){
255+
private List<PackagesDto> getPackages() {
256256
List<ComponentLibrary> componentLibraryList = componentLibraryMapper.queryAllComponentLibrary();
257257
List<PackagesDto> packagesDtoList = new ArrayList<>();
258-
if(componentLibraryList.isEmpty()){
258+
if (componentLibraryList.isEmpty()) {
259259
return packagesDtoList;
260260
}
261-
for (ComponentLibrary componentLibrary: componentLibraryList){
261+
for (ComponentLibrary componentLibrary : componentLibraryList) {
262262
PackagesDto pakagesDto = new PackagesDto();
263263
BeanUtils.copyProperties(componentLibrary, pakagesDto);
264264
packagesDtoList.add(pakagesDto);
265265
}
266266
return packagesDtoList;
267267
}
268+
268269
/**
269270
* 获取应用信息
270271
*
@@ -497,11 +498,11 @@ public List<Map<String, Object>> getSchemaComponentsMap(MetaDto metaDto) {
497498
// 转换组件数据为schema
498499
List<Component> components = materialHistory.getComponents();
499500
List<ComponentLibrary> componentLibraryList = componentLibraryMapper.queryAllComponentLibrary();
500-
if(!componentLibraryList.isEmpty()){
501-
List<Component> componentList = componentLibraryList.stream()
502-
.flatMap(componentLibrary -> componentLibrary.getComponents().stream()) // 扁平化每个 List<Component>
503-
.collect(Collectors.toList()); // 收集到一个新的 List<Component>
504-
components.addAll(componentList);
501+
if (!componentLibraryList.isEmpty()) {
502+
List<Component> componentList = componentLibraryList.stream()
503+
.flatMap(componentLibrary -> componentLibrary.getComponents().stream()) // 扁平化每个 List<Component>
504+
.collect(Collectors.toList()); // 收集到一个新的 List<Component>
505+
components.addAll(componentList);
505506
}
506507
List<Map<String, Object>> componentsSchema = getComponentSchema(components);
507508
// 合并两个 List

base/src/main/java/com/tinyengine/it/service/material/MaterialService.java

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import com.tinyengine.it.common.base.Result;
1616
import com.tinyengine.it.model.entity.Material;
1717

18-
import com.tinyengine.it.model.entity.MaterialHistory;
1918
import org.apache.ibatis.annotations.Param;
2019

2120
import java.util.List;

base/src/main/java/com/tinyengine/it/service/material/impl/ComponentLibraryServiceImpl.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ public List<ComponentLibrary> queryComponentLibraryByCondition(ComponentLibrary
7777
* @return execute success data number
7878
*/
7979
@Override
80-
public Result<ComponentLibrary> deleteComponentLibraryById(@Param("id") Integer id) {
80+
public Result<ComponentLibrary> deleteComponentLibraryById(@Param("id") Integer id) {
8181
Result<ComponentLibrary> result = this.queryComponentLibraryById(id);
82-
if(result.getData() == null || result.getData().getId() == null){
82+
if (result.getData() == null || result.getData().getId() == null) {
8383
return Result.success();
8484
}
85-
int deleteResult = componentLibraryMapper.deleteComponentLibraryById(id);
86-
if(deleteResult != 1){
85+
int deleteResult = componentLibraryMapper.deleteComponentLibraryById(id);
86+
if (deleteResult != 1) {
8787
return Result.failed(ExceptionEnum.CM008);
8888
}
8989
return result;
@@ -97,9 +97,9 @@ public Result<ComponentLibrary> deleteComponentLibraryById(@Param("id") Integer
9797
* @return execute success data number
9898
*/
9999
@Override
100-
public Result<ComponentLibrary> updateComponentLibraryById(ComponentLibrary componentLibrary) {
100+
public Result<ComponentLibrary> updateComponentLibraryById(ComponentLibrary componentLibrary) {
101101
int updateResult = componentLibraryMapper.updateComponentLibraryById(componentLibrary);
102-
if(updateResult != 1){
102+
if (updateResult != 1) {
103103
return Result.failed(ExceptionEnum.CM008);
104104
}
105105
Result<ComponentLibrary> result = this.queryComponentLibraryById(componentLibrary.getId());
@@ -113,9 +113,9 @@ public Result<ComponentLibrary> updateComponentLibraryById(ComponentLibrary com
113113
* @return execute success data number
114114
*/
115115
@Override
116-
public Result<ComponentLibrary> createComponentLibrary(ComponentLibrary componentLibrary) {
116+
public Result<ComponentLibrary> createComponentLibrary(ComponentLibrary componentLibrary) {
117117
int createResult = componentLibraryMapper.createComponentLibrary(componentLibrary);
118-
if(createResult != 1){
118+
if (createResult != 1) {
119119
return Result.failed(ExceptionEnum.CM008);
120120
}
121121
Result<ComponentLibrary> result = this.queryComponentLibraryById(componentLibrary.getId());

base/src/main/java/com/tinyengine/it/service/material/impl/MaterialServiceImpl.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ public List<Material> queryMaterialByCondition(Material material) {
7777
* @return execute success data number
7878
*/
7979
@Override
80-
public Result<Material> deleteMaterialById(@Param("id") Integer id) {
81-
int deleteResult = materialMapper.deleteMaterialById(id);
82-
if(deleteResult != 1){
80+
public Result<Material> deleteMaterialById(@Param("id") Integer id) {
81+
int deleteResult = materialMapper.deleteMaterialById(id);
82+
if (deleteResult != 1) {
8383
return Result.failed(ExceptionEnum.CM008);
8484
}
8585
Result<Material> result = this.queryMaterialById(id);
@@ -94,9 +94,9 @@ public Result<Material> deleteMaterialById(@Param("id") Integer id) {
9494
* @return execute success data number
9595
*/
9696
@Override
97-
public Result<Material> updateMaterialById(Material material) {
97+
public Result<Material> updateMaterialById(Material material) {
9898
int updateResult = materialMapper.updateMaterialById(material);
99-
if(updateResult != 1){
99+
if (updateResult != 1) {
100100
return Result.failed(ExceptionEnum.CM008);
101101
}
102102
Result<Material> result = this.queryMaterialById(material.getId());
@@ -110,9 +110,9 @@ public Result<Material> updateMaterialById(Material material) {
110110
* @return execute success data number
111111
*/
112112
@Override
113-
public Result<Material> createMaterial(Material material) {
113+
public Result<Material> createMaterial(Material material) {
114114
int createResult = materialMapper.createMaterial(material);
115-
if(createResult != 1){
115+
if (createResult != 1) {
116116
return Result.failed(ExceptionEnum.CM008);
117117
}
118118
Result<Material> result = this.queryMaterialById(material.getId());

base/src/test/java/com/tinyengine/it/service/material/impl/MaterialServiceImplTest.java

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import com.tinyengine.it.mapper.MaterialMapper;
1818
import com.tinyengine.it.model.entity.Material;
1919

20-
import com.tinyengine.it.model.entity.MaterialHistory;
2120
import org.junit.jupiter.api.Assertions;
2221
import org.junit.jupiter.api.BeforeEach;
2322
import org.junit.jupiter.api.Test;

0 commit comments

Comments
 (0)