Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

package com.tinyengine.it.service.app;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tinyengine.it.common.base.Result;
import com.tinyengine.it.model.entity.AppExtension;

Comment on lines +15 to 18
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Same layering concern: remove @Param and keep service layer free from MyBatis specifics

See comment in AppService.

🤖 Prompt for AI Agents
In base/src/main/java/com/tinyengine/it/service/app/AppExtensionService.java
around lines 15 to 18, remove all usages and imports of MyBatis-specific
annotations like @Param from the service layer. Refactor method signatures to
use plain Java parameters without MyBatis annotations to keep the service layer
independent of persistence framework details, following the same layering
principle applied in AppService.

Expand All @@ -24,7 +25,7 @@
*
* @since 2024-10-20
*/
public interface AppExtensionService {
public interface AppExtensionService extends IService<AppExtension> {
/**
* 查询表t_app_extension所有信息
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

package com.tinyengine.it.service.app;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tinyengine.it.common.base.Result;
import com.tinyengine.it.model.dto.I18nEntryDto;
import com.tinyengine.it.model.dto.PreviewDto;
Expand All @@ -27,7 +28,7 @@
*
* @since 2024-10-20
*/
public interface AppService {
public interface AppService extends IService<App> {
/**
* 查询表t_app所有信息
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

package com.tinyengine.it.service.app;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tinyengine.it.common.base.Result;
import com.tinyengine.it.model.entity.Datasource;

Expand All @@ -24,7 +25,7 @@
*
* @since 2024-10-20
*/
public interface DatasourceService {
public interface DatasourceService extends IService<Datasource> {
/**
* 根据主键id查询表t_datasource信息
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

package com.tinyengine.it.service.app;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tinyengine.it.common.base.Result;
import com.tinyengine.it.model.dto.DeleteI18nEntry;
import com.tinyengine.it.model.dto.FileResult;
Expand All @@ -32,7 +33,7 @@
*
* @since 2024-10-20
*/
public interface I18nEntryService {
public interface I18nEntryService extends IService<I18nEntry> {
/**
* 查询表t_i18n_entry所有信息
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

package com.tinyengine.it.service.app;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tinyengine.it.model.entity.I18nLang;

import org.apache.ibatis.annotations.Param;
Expand All @@ -23,7 +24,7 @@
*
* @since 2024-10-20
*/
public interface I18nLangService {
public interface I18nLangService extends IService<I18nLang> {
/**
* 查询表t_i18n_lang所有信息
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
package com.tinyengine.it.service.app;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tinyengine.it.common.base.PageQueryVo;
import com.tinyengine.it.model.dto.PublishedPageVo;
import com.tinyengine.it.model.entity.PageHistory;
Expand All @@ -26,7 +27,7 @@
*
* @since 2024-10-20
*/
public interface PageHistoryService {
public interface PageHistoryService extends IService<PageHistory> {
/**
* 查询表t_page_history所有信息
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

package com.tinyengine.it.service.app;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tinyengine.it.common.base.Result;
import com.tinyengine.it.model.dto.PreviewDto;
import com.tinyengine.it.model.dto.PreviewParam;
Expand All @@ -26,7 +27,7 @@
*
* @since 2024-10-20
*/
public interface PageService {
public interface PageService extends IService<Page> {
/**
* 查询表t_page所有信息
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

package com.tinyengine.it.service.app;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tinyengine.it.common.base.Result;
import com.tinyengine.it.model.entity.PageTemplate;

Expand All @@ -24,7 +25,7 @@
*
* @since 2024-10-20
*/
public interface PageTemplateService {
public interface PageTemplateService extends IService<PageTemplate> {
/**
* 查询表page_template所有信息
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

package com.tinyengine.it.service.app;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tinyengine.it.model.entity.TaskRecord;

import org.apache.ibatis.annotations.Param;
Expand All @@ -23,7 +24,7 @@
*
* @since 2024-10-20
*/
public interface TaskRecordService {
public interface TaskRecordService extends IService<TaskRecord> {
/**
* 查询表t_task_record所有信息
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

package com.tinyengine.it.service.app;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tinyengine.it.model.entity.User;

import org.apache.ibatis.annotations.Param;
Expand All @@ -23,7 +24,7 @@
*
* @since 2024-10-20
*/
public interface UserService {
public interface UserService extends IService<User> {
/**
* 查询表t_user所有信息
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

package com.tinyengine.it.service.app.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tinyengine.it.common.base.Result;
import com.tinyengine.it.common.exception.ExceptionEnum;
import com.tinyengine.it.common.log.SystemServiceLog;
Expand All @@ -34,7 +35,7 @@
*/
@Service
@Slf4j
public class AppExtensionServiceImpl implements AppExtensionService {
public class AppExtensionServiceImpl extends ServiceImpl<AppExtensionMapper, AppExtension> implements AppExtensionService {
@Autowired
private AppExtensionMapper appExtensionMapper;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

package com.tinyengine.it.service.app.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tinyengine.it.common.base.Result;
import com.tinyengine.it.common.enums.Enums;
import com.tinyengine.it.common.exception.ExceptionEnum;
Expand Down Expand Up @@ -50,7 +51,7 @@
*/
@Service
@Slf4j
public class AppServiceImpl implements AppService {
public class AppServiceImpl extends ServiceImpl<AppMapper, App> implements AppService {
/**
* The App mapper.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

package com.tinyengine.it.service.app.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tinyengine.it.common.base.Result;
import com.tinyengine.it.common.exception.ExceptionEnum;
import com.tinyengine.it.mapper.DatasourceMapper;
Expand All @@ -33,7 +34,7 @@
*/
@Service
@Slf4j
public class DatasourceServiceImpl implements DatasourceService {
public class DatasourceServiceImpl extends ServiceImpl<DatasourceMapper, Datasource> implements DatasourceService {
@Autowired
private DatasourceMapper datasourceMapper;

Comment on lines +37 to 40
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Same mapper-duplication issue as in TenantServiceImpl

ServiceImpl<DatasourceMapper, Datasource> already wires a mapper. Remove the extra @Autowired DatasourceMapper or switch your code to baseMapper.

🤖 Prompt for AI Agents
In
base/src/main/java/com/tinyengine/it/service/app/impl/DatasourceServiceImpl.java
around lines 37 to 40, there is a redundant injection of DatasourceMapper via
@Autowired despite extending ServiceImpl which already provides a mapper
instance as baseMapper. Remove the @Autowired DatasourceMapper field and update
any references from datasourceMapper to baseMapper to avoid duplication and use
the inherited mapper correctly.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
package com.tinyengine.it.service.app.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
Expand Down Expand Up @@ -65,7 +66,7 @@
*/
@Service
@Slf4j
public class I18nEntryServiceImpl implements I18nEntryService {
public class I18nEntryServiceImpl extends ServiceImpl<I18nEntryMapper, I18nEntry> implements I18nEntryService {
private static final Logger logger = LoggerFactory.getLogger(I18nEntryServiceImpl.class);

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

package com.tinyengine.it.service.app.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tinyengine.it.mapper.I18nLangMapper;
import com.tinyengine.it.model.entity.I18nLang;
import com.tinyengine.it.service.app.I18nLangService;
Expand All @@ -31,7 +32,7 @@
*/
@Service
@Slf4j
public class I18nLangServiceImpl implements I18nLangService {
public class I18nLangServiceImpl extends ServiceImpl<I18nLangMapper, I18nLang> implements I18nLangService {
@Autowired
private I18nLangMapper i18nLangMapper;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
package com.tinyengine.it.service.app.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tinyengine.it.common.base.PageQueryVo;
import com.tinyengine.it.common.log.SystemServiceLog;
import com.tinyengine.it.mapper.PageHistoryMapper;
Expand All @@ -36,7 +37,7 @@
*/
@Service
@Slf4j
public class PageHistoryServiceImpl implements PageHistoryService {
public class PageHistoryServiceImpl extends ServiceImpl<PageHistoryMapper, PageHistory> implements PageHistoryService {
private static final String DEFAULT_PAGE_HISTORY_VERSION = "0";

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tinyengine.it.common.base.Result;
Comment on lines +17 to 18
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Same duplication pattern – rely on baseMapper instead of a second mapper field.

ServiceImpl<PageMapper, Page> already gives you baseMapper; additionally wiring pageMapper adds no value and muddies the waters when both names appear in the file.

Apply the same removal pattern as suggested for MaterialServiceImpl:

-@Autowired
-private PageMapper pageMapper;

Then rename references (pageMapperbaseMapper) in this class.
This also applies to other *ServiceImpl classes introduced in this PR.

Also applies to: 75-82

🤖 Prompt for AI Agents
In base/src/main/java/com/tinyengine/it/service/app/impl/PageServiceImpl.java
around lines 17-18 and 75-82, remove the explicit declaration and injection of
the pageMapper field since ServiceImpl<PageMapper, Page> already provides
baseMapper. Replace all references of pageMapper with baseMapper throughout the
class to avoid duplication and confusion, following the same pattern used in
MaterialServiceImpl and other similar service implementations in this PR.

import com.tinyengine.it.common.context.LoginUserContext;
import com.tinyengine.it.common.enums.Enums;
Expand Down Expand Up @@ -71,7 +72,7 @@
*/
@Service
@Slf4j
public class PageServiceImpl implements PageService {
public class PageServiceImpl extends ServiceImpl<PageMapper, Page> implements PageService {
/**
* The Page mapper.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

package com.tinyengine.it.service.app.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tinyengine.it.common.base.Result;
import com.tinyengine.it.common.exception.ExceptionEnum;
import com.tinyengine.it.common.exception.ServiceException;
Expand All @@ -36,7 +37,7 @@
*/
@Service
@Slf4j
public class PageTemplateServiceImpl implements PageTemplateService {
public class PageTemplateServiceImpl extends ServiceImpl<PageTemplateMapper, PageTemplate> implements PageTemplateService {
@Autowired
private PageTemplateMapper pageTemplateMapper;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

package com.tinyengine.it.service.app.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tinyengine.it.mapper.TaskRecordMapper;
import com.tinyengine.it.model.entity.TaskRecord;
import com.tinyengine.it.service.app.TaskRecordService;
Expand All @@ -31,7 +32,7 @@
*/
@Service
@Slf4j
public class TaskRecordServiceImpl implements TaskRecordService {
public class TaskRecordServiceImpl extends ServiceImpl<TaskRecordMapper, TaskRecord> implements TaskRecordService {
@Autowired
private TaskRecordMapper taskRecordMapper;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

package com.tinyengine.it.service.app.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tinyengine.it.mapper.UserMapper;
Comment on lines +15 to 16
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Duplicate mapper injection – remove and use baseMapper.

Same comment as above: ServiceImpl<UserMapper, User> already wires a UserMapper. Recommend deleting the explicit field to avoid redundancy.

-@Autowired
-private UserMapper userMapper;

Then update the method bodies to baseMapper.*.

Also applies to: 34-37

🤖 Prompt for AI Agents
In base/src/main/java/com/tinyengine/it/service/app/impl/UserServiceImpl.java
around lines 15-16 and 34-37, there is a redundant explicit injection of
UserMapper despite extending ServiceImpl which already provides a baseMapper
instance. Remove the explicit UserMapper field declaration and replace all
references to the explicit mapper in method bodies with baseMapper to avoid
duplication and simplify the code.

import com.tinyengine.it.model.entity.User;
import com.tinyengine.it.service.app.UserService;
Expand All @@ -30,7 +31,7 @@
*/
@Service
@Slf4j
public class UserServiceImpl implements UserService {
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
@Autowired
private UserMapper userMapper;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

package com.tinyengine.it.service.material;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tinyengine.it.common.base.Result;
import com.tinyengine.it.model.dto.BlockGroupDto;
import com.tinyengine.it.model.entity.BlockGroup;
Expand All @@ -25,7 +26,7 @@
*
* @since 2024-10-20
*/
public interface BlockGroupService {
public interface BlockGroupService extends IService<BlockGroup> {
/**
* 查询表t_block_group所有信息
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

package com.tinyengine.it.service.material;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tinyengine.it.model.entity.BlockHistory;

import org.apache.ibatis.annotations.Param;
Expand All @@ -23,7 +24,7 @@
*
* @since 2024-10-20
*/
public interface BlockHistoryService {
public interface BlockHistoryService extends IService<BlockHistory> {
/**
* 查询表t_block_history所有信息
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
package com.tinyengine.it.service.material;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tinyengine.it.common.base.Result;
import com.tinyengine.it.model.dto.BlockBuildDto;
import com.tinyengine.it.model.dto.BlockDto;
Expand All @@ -32,7 +33,7 @@
*
* @since 2024-10-20
*/
public interface BlockService {
public interface BlockService extends IService<Block> {
/**
* 查询表t_block所有信息
*
Expand Down
Loading
Loading