feat: 代码生成-生成的mapper和service使用mybatis-plus增强

pull/158/head
Roan 2024-11-28 15:35:26 +08:00
parent 860b099ec4
commit 6d4bd9e85b
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,7 @@
package ${basePackage}.module.${table.moduleName}.service.${table.businessName}; package ${basePackage}.module.${table.moduleName}.service.${table.businessName};
import java.util.*; import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import ${jakartaPackage}.validation.*; import ${jakartaPackage}.validation.*;
import ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo.*; import ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo.*;
import ${basePackage}.module.${table.moduleName}.dal.dataobject.${table.businessName}.${table.className}DO; import ${basePackage}.module.${table.moduleName}.dal.dataobject.${table.businessName}.${table.className}DO;
@ -16,7 +17,7 @@ import ${PageParamClassName};
* *
* @author ${table.author} * @author ${table.author}
*/ */
public interface ${table.className}Service { public interface ${table.className}Service extends IService<${table.className}DO>{
/** /**
* 创建${table.classComment} * 创建${table.classComment}

View File

@ -4,6 +4,7 @@ import org.springframework.stereotype.Service;
import ${jakartaPackage}.annotation.Resource; import ${jakartaPackage}.annotation.Resource;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.*; import java.util.*;
import ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo.*; import ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo.*;
@ -33,7 +34,7 @@ import static ${basePackage}.module.${table.moduleName}.enums.ErrorCodeConstants
*/ */
@Service @Service
@Validated @Validated
public class ${table.className}ServiceImpl implements ${table.className}Service { public class ${table.className}ServiceImpl extends ServiceImpl<${table.className}Mapper, ${table.className}DO> implements ${table.className}Service {
@Resource @Resource
private ${table.className}Mapper ${classNameVar}Mapper; private ${table.className}Mapper ${classNameVar}Mapper;