Skip to content

Commit 7b41498

Browse files
authored
feat: Service extends IService (#242)
* feat: Service extends IService
1 parent 929a971 commit 7b41498

File tree

66 files changed

+434
-520
lines changed

Some content is hidden

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

66 files changed

+434
-520
lines changed

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

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,31 @@
1616
import org.springframework.context.annotation.Bean;
1717
import org.springframework.context.annotation.Configuration;
1818
import org.springframework.web.cors.CorsConfiguration;
19-
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
20-
import org.springframework.web.filter.CorsFilter;
21-
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
19+
import org.springframework.web.cors.reactive.CorsWebFilter;
20+
import org.springframework.web.reactive.config.WebFluxConfigurer;
2221

2322
import java.util.Arrays;
2423
import java.util.List;
2524

2625
@Configuration
27-
public class WebConfig implements WebMvcConfigurer {
26+
public class WebConfig implements WebFluxConfigurer {
2827
@Value("${cors.allowed-origins}")
2928
private String allowedOrigins;
3029

3130
@Bean
32-
public CorsFilter corsFilter() {
33-
// 跨域配置地址
31+
public CorsWebFilter corsFilter() {
3432
List<String> crosDomainList = Arrays.asList(allowedOrigins.split(","));
3533

3634
CorsConfiguration corsConfiguration = new CorsConfiguration();
37-
// 1、允许来源
3835
corsConfiguration.setAllowedOriginPatterns(crosDomainList);
39-
// 2、允许任何请求头
4036
corsConfiguration.addAllowedHeader(CorsConfiguration.ALL);
41-
// 3、允许任何方法
4237
corsConfiguration.addAllowedMethod(CorsConfiguration.ALL);
43-
// 4、允许凭证
4438
corsConfiguration.setAllowCredentials(true);
4539

46-
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
40+
org.springframework.web.cors.reactive.UrlBasedCorsConfigurationSource source =
41+
new org.springframework.web.cors.reactive.UrlBasedCorsConfigurationSource();
4742
source.registerCorsConfiguration("/**", corsConfiguration);
48-
return new CorsFilter(source);
43+
44+
return new CorsWebFilter(source);
4945
}
50-
}
46+
}

base/src/main/java/com/tinyengine/it/service/app/AppExtensionService.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,18 @@
1212

1313
package com.tinyengine.it.service.app;
1414

15+
import com.baomidou.mybatisplus.extension.service.IService;
1516
import com.tinyengine.it.common.base.Result;
1617
import com.tinyengine.it.model.entity.AppExtension;
1718

18-
import org.apache.ibatis.annotations.Param;
19-
2019
import java.util.List;
2120

2221
/**
2322
* The interface App extension service.
2423
*
2524
* @since 2024-10-20
2625
*/
27-
public interface AppExtensionService {
26+
public interface AppExtensionService extends IService<AppExtension> {
2827
/**
2928
* 查询表t_app_extension所有信息
3029
*
@@ -38,7 +37,7 @@ public interface AppExtensionService {
3837
* @param id the id
3938
* @return the app extension
4039
*/
41-
AppExtension findAppExtensionById(@Param("id") Integer id);
40+
AppExtension findAppExtensionById(Integer id);
4241

4342
/**
4443
* 根据条件查询表t_app_extension信息
@@ -54,7 +53,7 @@ public interface AppExtensionService {
5453
* @param id the id
5554
* @return the result
5655
*/
57-
Result<AppExtension> deleteAppExtensionById(@Param("id") Integer id);
56+
Result<AppExtension> deleteAppExtensionById(Integer id);
5857

5958
/**
6059
* 根据主键id更新表t_app_extension信息

base/src/main/java/com/tinyengine/it/service/app/AppService.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,21 @@
1212

1313
package com.tinyengine.it.service.app;
1414

15+
import com.baomidou.mybatisplus.extension.service.IService;
1516
import com.tinyengine.it.common.base.Result;
1617
import com.tinyengine.it.model.dto.I18nEntryDto;
1718
import com.tinyengine.it.model.dto.PreviewDto;
1819
import com.tinyengine.it.model.dto.SchemaI18n;
1920
import com.tinyengine.it.model.entity.App;
2021

21-
import org.apache.ibatis.annotations.Param;
22-
2322
import java.util.List;
2423

2524
/**
2625
* The interface App service.
2726
*
2827
* @since 2024-10-20
2928
*/
30-
public interface AppService {
29+
public interface AppService extends IService<App> {
3130
/**
3231
* 查询表t_app所有信息
3332
*
@@ -41,7 +40,7 @@ public interface AppService {
4140
* @param id the id
4241
* @return the result
4342
*/
44-
Result<App> queryAppById(@Param("id") Integer id);
43+
Result<App> queryAppById(Integer id);
4544

4645
/**
4746
* 根据条件查询表t_app信息
@@ -57,7 +56,7 @@ public interface AppService {
5756
* @param id the id
5857
* @return the result
5958
*/
60-
Result<App> deleteAppById(@Param("id") Integer id);
59+
Result<App> deleteAppById(Integer id);
6160

6261
/**
6362
* 根据主键id更新表t_app信息

base/src/main/java/com/tinyengine/it/service/app/DatasourceService.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,25 @@
1212

1313
package com.tinyengine.it.service.app;
1414

15+
import com.baomidou.mybatisplus.extension.service.IService;
1516
import com.tinyengine.it.common.base.Result;
1617
import com.tinyengine.it.model.entity.Datasource;
1718

18-
import org.apache.ibatis.annotations.Param;
19-
2019
import java.util.List;
2120

2221
/**
2322
* The interface Datasource service.
2423
*
2524
* @since 2024-10-20
2625
*/
27-
public interface DatasourceService {
26+
public interface DatasourceService extends IService<Datasource> {
2827
/**
2928
* 根据主键id查询表t_datasource信息
3029
*
3130
* @param id the id
3231
* @return the datasource
3332
*/
34-
Datasource queryDatasourceById(@Param("id") Integer id);
33+
Datasource queryDatasourceById(Integer id);
3534

3635
/**
3736
* 根据条件查询表t_datasource信息
@@ -47,7 +46,7 @@ public interface DatasourceService {
4746
* @param id the id
4847
* @return the result
4948
*/
50-
Result<Datasource> deleteDatasourceById(@Param("id") Integer id);
49+
Result<Datasource> deleteDatasourceById(Integer id);
5150

5251
/**
5352
* 根据主键id更新表t_datasource信息

base/src/main/java/com/tinyengine/it/service/app/I18nEntryService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
package com.tinyengine.it.service.app;
1414

15+
import com.baomidou.mybatisplus.extension.service.IService;
1516
import com.tinyengine.it.common.base.Result;
1617
import com.tinyengine.it.model.dto.DeleteI18nEntry;
1718
import com.tinyengine.it.model.dto.FileResult;
@@ -22,7 +23,6 @@
2223
import com.tinyengine.it.model.dto.SchemaI18n;
2324
import com.tinyengine.it.model.entity.I18nEntry;
2425

25-
import org.apache.ibatis.annotations.Param;
2626
import org.springframework.web.multipart.MultipartFile;
2727

2828
import java.util.List;
@@ -32,7 +32,7 @@
3232
*
3333
* @since 2024-10-20
3434
*/
35-
public interface I18nEntryService {
35+
public interface I18nEntryService extends IService<I18nEntry> {
3636
/**
3737
* 查询表t_i18n_entry所有信息
3838
*
@@ -46,7 +46,7 @@ public interface I18nEntryService {
4646
* @param id the id
4747
* @return the 18 n entry
4848
*/
49-
I18nEntryDto findI18nEntryById(@Param("id") Integer id);
49+
I18nEntryDto findI18nEntryById(Integer id);
5050

5151
/**
5252
* 根据条件查询表t_i18n_entry信息

base/src/main/java/com/tinyengine/it/service/app/I18nLangService.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,17 @@
1212

1313
package com.tinyengine.it.service.app;
1414

15+
import com.baomidou.mybatisplus.extension.service.IService;
1516
import com.tinyengine.it.model.entity.I18nLang;
1617

17-
import org.apache.ibatis.annotations.Param;
18-
1918
import java.util.List;
2019

2120
/**
2221
* The interface 18 n lang service.
2322
*
2423
* @since 2024-10-20
2524
*/
26-
public interface I18nLangService {
25+
public interface I18nLangService extends IService<I18nLang> {
2726
/**
2827
* 查询表t_i18n_lang所有信息
2928
*
@@ -37,7 +36,7 @@ public interface I18nLangService {
3736
* @param id the id
3837
* @return the 18 n lang
3938
*/
40-
I18nLang queryI18nLangById(@Param("id") Integer id);
39+
I18nLang queryI18nLangById(Integer id);
4140

4241
/**
4342
* 根据条件查询表t_i18n_lang信息
@@ -53,7 +52,7 @@ public interface I18nLangService {
5352
* @param id the id
5453
* @return the integer
5554
*/
56-
Integer deleteI18nLangById(@Param("id") Integer id);
55+
Integer deleteI18nLangById(Integer id);
5756

5857
/**
5958
* 根据主键id更新表t_i18n_lang信息

base/src/main/java/com/tinyengine/it/service/app/PageHistoryService.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,19 @@
1313
package com.tinyengine.it.service.app;
1414

1515
import com.baomidou.mybatisplus.core.metadata.IPage;
16+
import com.baomidou.mybatisplus.extension.service.IService;
1617
import com.tinyengine.it.common.base.PageQueryVo;
1718
import com.tinyengine.it.model.dto.PublishedPageVo;
1819
import com.tinyengine.it.model.entity.PageHistory;
1920

20-
import org.apache.ibatis.annotations.Param;
21-
2221
import java.util.List;
2322

2423
/**
2524
* The interface Page history service.
2625
*
2726
* @since 2024-10-20
2827
*/
29-
public interface PageHistoryService {
28+
public interface PageHistoryService extends IService<PageHistory> {
3029
/**
3130
* 查询表t_page_history所有信息
3231
*
@@ -56,7 +55,7 @@ public interface PageHistoryService {
5655
* @param id the id
5756
* @return the integer
5857
*/
59-
Integer deletePageHistoryById(@Param("id") Integer id);
58+
Integer deletePageHistoryById(Integer id);
6059

6160
/**
6261
* 根据主键id更新表t_page_history信息

base/src/main/java/com/tinyengine/it/service/app/PageService.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,20 @@
1212

1313
package com.tinyengine.it.service.app;
1414

15+
import com.baomidou.mybatisplus.extension.service.IService;
1516
import com.tinyengine.it.common.base.Result;
1617
import com.tinyengine.it.model.dto.PreviewDto;
1718
import com.tinyengine.it.model.dto.PreviewParam;
1819
import com.tinyengine.it.model.entity.Page;
1920

20-
import org.apache.ibatis.annotations.Param;
21-
2221
import java.util.List;
2322

2423
/**
2524
* The interface Page service.
2625
*
2726
* @since 2024-10-20
2827
*/
29-
public interface PageService {
28+
public interface PageService extends IService<Page> {
3029
/**
3130
* 查询表t_page所有信息
3231
*
@@ -41,7 +40,7 @@ public interface PageService {
4140
* @param id the id
4241
* @return the page
4342
*/
44-
Page queryPageById(@Param("id") Integer id);
43+
Page queryPageById(Integer id);
4544

4645
/**
4746
* 根据条件查询表t_page信息
@@ -57,7 +56,7 @@ public interface PageService {
5756
* @param id the id
5857
* @return the result
5958
*/
60-
Result<Page> delPage(@Param("id") Integer id);
59+
Result<Page> delPage(Integer id);
6160

6261
/**
6362
* 创建页面

base/src/main/java/com/tinyengine/it/service/app/PageTemplateService.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,18 @@
1212

1313
package com.tinyengine.it.service.app;
1414

15+
import com.baomidou.mybatisplus.extension.service.IService;
1516
import com.tinyengine.it.common.base.Result;
1617
import com.tinyengine.it.model.entity.PageTemplate;
1718

18-
import org.apache.ibatis.annotations.Param;
19-
2019
import java.util.List;
2120

2221
/**
2322
* The interface Page template service.
2423
*
2524
* @since 2024-10-20
2625
*/
27-
public interface PageTemplateService {
26+
public interface PageTemplateService extends IService<PageTemplate> {
2827
/**
2928
* 查询表page_template所有信息
3029
*
@@ -40,7 +39,7 @@ public interface PageTemplateService {
4039
* @param id the id
4140
* @return the page template
4241
*/
43-
Result<PageTemplate> queryPageTemplateById(@Param("id") Integer id);
42+
Result<PageTemplate> queryPageTemplateById(Integer id);
4443

4544
/**
4645
* 根据条件查询表page_template信息
@@ -56,7 +55,7 @@ public interface PageTemplateService {
5655
* @param ids id
5756
* @return the integer
5857
*/
59-
Result<Integer> deletePageTemplateByIds(@Param("ids") List<Integer> ids);
58+
Result<Integer> deletePageTemplateByIds(List<Integer> ids);
6059

6160
/**
6261
* 根据主键id更新表page_template信息

base/src/main/java/com/tinyengine/it/service/app/TaskRecordService.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,17 @@
1212

1313
package com.tinyengine.it.service.app;
1414

15+
import com.baomidou.mybatisplus.extension.service.IService;
1516
import com.tinyengine.it.model.entity.TaskRecord;
1617

17-
import org.apache.ibatis.annotations.Param;
18-
1918
import java.util.List;
2019

2120
/**
2221
* The interface Task record service.
2322
*
2423
* @since 2024-10-20
2524
*/
26-
public interface TaskRecordService {
25+
public interface TaskRecordService extends IService<TaskRecord> {
2726
/**
2827
* 查询表t_task_record所有信息
2928
*
@@ -37,7 +36,7 @@ public interface TaskRecordService {
3736
* @param id the id
3837
* @return the task record
3938
*/
40-
TaskRecord queryTaskRecordById(@Param("id") Integer id);
39+
TaskRecord queryTaskRecordById(Integer id);
4140

4241
/**
4342
* 根据条件查询表t_task_record信息
@@ -53,7 +52,7 @@ public interface TaskRecordService {
5352
* @param id the id
5453
* @return the integer
5554
*/
56-
Integer deleteTaskRecordById(@Param("id") Integer id);
55+
Integer deleteTaskRecordById(Integer id);
5756

5857
/**
5958
* 根据主键id更新表t_task_record信息

0 commit comments

Comments
 (0)