From 69025742508b4dde10398e2de5a945561e053a17 Mon Sep 17 00:00:00 2001 From: Jermaine Nee Date: Wed, 16 Nov 2022 10:06:53 +0800 Subject: [PATCH] Delete trip-web-server/baseframe/mybatis-plus/target/classes directory --- .../target/classes/application-plus.yml | 23 --- .../mybatis-plus/target/classes/gen.yml | 11 -- .../templates/backup/controller.java.ftl | 96 ------------ .../classes/templates/backup/entity.java.ftl | 139 ----------------- .../classes/templates/backup/mapper.java.ftl | 16 -- .../classes/templates/backup/mapper.xml.ftl | 77 ---------- .../classes/templates/backup/service.java.ftl | 18 --- .../templates/backup/serviceImpl.java.ftl | 58 ------- .../templates/code/controller.java.ftl | 108 -------------- .../classes/templates/code/entity.java.ftl | 141 ------------------ .../classes/templates/code/mapper.java.ftl | 14 -- .../classes/templates/code/mapper.xml.ftl | 76 ---------- .../classes/templates/code/service.java.ftl | 23 --- .../templates/code/serviceImpl.java.ftl | 30 ---- 14 files changed, 830 deletions(-) delete mode 100644 trip-web-server/baseframe/mybatis-plus/target/classes/application-plus.yml delete mode 100644 trip-web-server/baseframe/mybatis-plus/target/classes/gen.yml delete mode 100644 trip-web-server/baseframe/mybatis-plus/target/classes/templates/backup/controller.java.ftl delete mode 100644 trip-web-server/baseframe/mybatis-plus/target/classes/templates/backup/entity.java.ftl delete mode 100644 trip-web-server/baseframe/mybatis-plus/target/classes/templates/backup/mapper.java.ftl delete mode 100644 trip-web-server/baseframe/mybatis-plus/target/classes/templates/backup/mapper.xml.ftl delete mode 100644 trip-web-server/baseframe/mybatis-plus/target/classes/templates/backup/service.java.ftl delete mode 100644 trip-web-server/baseframe/mybatis-plus/target/classes/templates/backup/serviceImpl.java.ftl delete mode 100644 trip-web-server/baseframe/mybatis-plus/target/classes/templates/code/controller.java.ftl delete mode 100644 trip-web-server/baseframe/mybatis-plus/target/classes/templates/code/entity.java.ftl delete mode 100644 trip-web-server/baseframe/mybatis-plus/target/classes/templates/code/mapper.java.ftl delete mode 100644 trip-web-server/baseframe/mybatis-plus/target/classes/templates/code/mapper.xml.ftl delete mode 100644 trip-web-server/baseframe/mybatis-plus/target/classes/templates/code/service.java.ftl delete mode 100644 trip-web-server/baseframe/mybatis-plus/target/classes/templates/code/serviceImpl.java.ftl diff --git a/trip-web-server/baseframe/mybatis-plus/target/classes/application-plus.yml b/trip-web-server/baseframe/mybatis-plus/target/classes/application-plus.yml deleted file mode 100644 index 81120cc..0000000 --- a/trip-web-server/baseframe/mybatis-plus/target/classes/application-plus.yml +++ /dev/null @@ -1,23 +0,0 @@ -mybatis-plus: - configuration: - log-impl: org.apache.ibatis.logging.stdout.StdOutImpl - globalConfig: - db-config: - #主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID"; - idType: AUTO - #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断" - fieldStrategy: 2 - #驼峰下划线转换 - dbColumnUnderline: true - #刷新mapper 调试神器 - isRefresh: true - #数据库大写下划线转换 - isCapitalMode: true - #逻辑删除配置 - logicDeleteValue: 0 - logicNotDeleteValue: 1 - mapper-locations: classpath:/mapper/*.xml #XML文件路径 - type-aliases-package: cn.zm.trip.entity - generate: - module: mybatis-plus - package: cn.zm.trip diff --git a/trip-web-server/baseframe/mybatis-plus/target/classes/gen.yml b/trip-web-server/baseframe/mybatis-plus/target/classes/gen.yml deleted file mode 100644 index 9e3d662..0000000 --- a/trip-web-server/baseframe/mybatis-plus/target/classes/gen.yml +++ /dev/null @@ -1,11 +0,0 @@ -#db -spring: - datasource: - driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://localhost:3306/trip_web?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8 - username: root - password: root -mybatis-plus: - generate: - module: generator/mybatis-plus - package: cn.zm.plus \ No newline at end of file diff --git a/trip-web-server/baseframe/mybatis-plus/target/classes/templates/backup/controller.java.ftl b/trip-web-server/baseframe/mybatis-plus/target/classes/templates/backup/controller.java.ftl deleted file mode 100644 index e8ff547..0000000 --- a/trip-web-server/baseframe/mybatis-plus/target/classes/templates/backup/controller.java.ftl +++ /dev/null @@ -1,96 +0,0 @@ -package ${package.Controller}; - -import ${package.Entity}.${entity}; -import com.github.pagehelper.PageInfo; -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import com.kofan.juanzong.admin.sys.annotation.CurrentUser; -import com.kofan.juanzong.admin.sys.annotation.LoginRequired; -import com.kofan.juanzong.admin.sys.annotation.NoAuth; -import com.kofan.juanzong.admin.sys.annotation.NotNull; -import com.kofan.juanzong.admin.user.entity.User; -import org.springframework.web.bind.annotation.RequestMapping; -import com.kofan.juanzong.sys.util.ResultUtil; -import ${package.Service}.${table.serviceName}; - -<#if restControllerStyle> - import org.springframework.web.bind.annotation.RestController; -<#else> - import org.springframework.stereotype.Controller; - -<#if superControllerClassPackage??> - import ${superControllerClassPackage}; - - -/** -*

-* a${table.comment!} -*

-* -* @author ${author} -* @since ${date} -*/ -<#if restControllerStyle> - @RestController -<#else> - @Controller - -<#if kotlin> - class ${table.controllerName}<#if superControllerClass??> : ${superControllerClass}() -<#else> - <#if superControllerClass??> - public class ${table.controllerName} extends ${superControllerClass} { - <#else> - public class ${table.controllerName} { - - - @Autowired - ${table.serviceName} ${table.entityPath}Service; - - @RequestMapping("/${table.entityPath}GetByPage") - @LoginRequired - @NoAuth("${table.comment!}查询(分页)") - @NotNull(str="pageNum,pageSize") - public Object getByPage(${entity} ${table.entityPath}, int pageNum, int pageSize, @CurrentUser User currentUser) { - List<${entity}> ${table.entityPath}List = ${table.entityPath}Service.get(${table.entityPath}, pageNum, pageSize); - PageInfo<${entity}> pageInfo = new PageInfo<>(${table.entityPath}List); - return ResultUtil.success(pageInfo); - } - - @RequestMapping("/${table.entityPath}Get") - @LoginRequired - @NoAuth("${table.comment!}查询") - public Object get(${entity} ${table.entityPath}, @CurrentUser User currentUser) { - List<${entity}> ${table.entityPath}List = ${table.entityPath}Service.get(${table.entityPath}); - return ResultUtil.success(${table.entityPath}List); - } - - @RequestMapping("/${table.entityPath}Add") - @LoginRequired - @NoAuth("${table.comment!}新增") - public Object add(${entity} ${table.entityPath}, @CurrentUser User currentUser) { - ${table.entityPath}.setCreate_user_id(currentUser.getUser_id()); - ${table.entityPath}Service.add(${table.entityPath}); - return ResultUtil.success(); - } - - @RequestMapping("/${table.entityPath}Del") - @LoginRequired - @NoAuth("${table.comment!}删除") - @NotNull(str="${table.name}_id") - public Object del(${entity} ${table.entityPath}, @CurrentUser User currentUser) { - ${table.entityPath}.setIs_del("1"); - ${table.entityPath}Service.update(${table.entityPath}); - return ResultUtil.success(); - } - - @RequestMapping("/${table.entityPath}Update") - @LoginRequired - @NoAuth("${table.comment!}修改") - @NotNull(str="${table.name}_id") - public Object update(${entity} ${table.entityPath}, @CurrentUser User currentUser) { - ${table.entityPath}Service.update(${table.entityPath}); - return ResultUtil.success(); - } - } - diff --git a/trip-web-server/baseframe/mybatis-plus/target/classes/templates/backup/entity.java.ftl b/trip-web-server/baseframe/mybatis-plus/target/classes/templates/backup/entity.java.ftl deleted file mode 100644 index 21fc627..0000000 --- a/trip-web-server/baseframe/mybatis-plus/target/classes/templates/backup/entity.java.ftl +++ /dev/null @@ -1,139 +0,0 @@ -package ${package.Entity}; - -<#list table.importPackages as pkg> - import ${pkg}; - -<#if swagger2> - import io.swagger.annotations.ApiModel; - import io.swagger.annotations.ApiModelProperty; - -<#if entityLombokModel> - import lombok.Data; - import lombok.EqualsAndHashCode; - import lombok.experimental.Accessors; - - -<#if entityLombokModel> - @Data - <#if superEntityClass??> - @EqualsAndHashCode(callSuper = true) - <#else> - @EqualsAndHashCode(callSuper = false) - - @Accessors(chain = true) - -<#if table.convert> - @TableName("${table.name}") - -<#if swagger2> - @ApiModel(value="${entity}对象", description="${table.comment!}") - -<#if superEntityClass??> - public class ${entity} extends ${superEntityClass}<#if activeRecord><${entity}> { -<#elseif activeRecord> - public class ${entity} extends Model<${entity}> { -<#else> - public class ${entity} implements Serializable { - -private static final long serialVersionUID = 1L; -<#-- ---------- BEGIN 字段循环遍历 ----------> -<#list table.fields as field> - <#if field.keyFlag> - <#assign keyPropertyName="${field.propertyName}"/> - - <#if field.comment!?length gt 0> - <#if swagger2> - @ApiModelProperty(value = "${field.comment}") - <#else> - - - <#if field.keyFlag> - <#-- 主键 --> - <#if field.keyIdentityFlag> - @TableId(value = "${field.name}", type = IdType.AUTO) - <#elseif idType??> - @TableId(value = "${field.name}", type = IdType.${idType}) - <#elseif field.convert> - @TableId("${field.name}") - - <#-- 普通字段 --> - <#elseif field.fill??> - <#-- ----- 存在字段填充设置 -----> - <#if field.convert> - @TableField(value = "${field.name}", fill = FieldFill.${field.fill}) - <#else> - @TableField(fill = FieldFill.${field.fill}) - - <#elseif field.convert> - @TableField("${field.name}") - -<#-- 乐观锁注解 --> - <#if (versionFieldName!"") == field.name> - @Version - -<#-- 逻辑删除注解 --> - <#if (logicDeleteFieldName!"") == field.name> - @TableLogic - - private ${field.propertyType} ${field.propertyName}; // ${field.comment} - -<#------------ END 字段循环遍历 ----------> - -<#------------ BEGIN lombok ----------> -<#if !entityLombokModel> - <#list table.fields as field> - <#if field.propertyType == "boolean"> - <#assign getprefix="is"/> - <#else> - <#assign getprefix="get"/> - - public ${field.propertyType} ${getprefix}${field.capitalName}() { - return ${field.propertyName}; - } - - <#if entityBuilderModel> - public ${entity} set${field.capitalName}(${field.propertyType} ${field.propertyName}) { - <#else> - public void set${field.capitalName}(${field.propertyType} ${field.propertyName}) { - - this.${field.propertyName} = ${field.propertyName}; - <#if entityBuilderModel> - return this; - - } - - -<#------------ END lombok ----------> - -<#if entityColumnConstant> - <#list table.fields as field> - public static final String ${field.name?upper_case} = "${field.name}"; - - - -<#if activeRecord> - @Override - protected Serializable pkVal() { - <#if keyPropertyName??> - return this.${keyPropertyName}; - <#else> - return null; - - } - - -<#if !entityLombokModel> - @Override - public String toString() { - return "${entity}{" + - <#list table.fields as field> - <#if field_index==0> - "${field.propertyName}=" + ${field.propertyName} + - <#else> - ", ${field.propertyName}=" + ${field.propertyName} + - - - "}"; - } - -} \ No newline at end of file diff --git a/trip-web-server/baseframe/mybatis-plus/target/classes/templates/backup/mapper.java.ftl b/trip-web-server/baseframe/mybatis-plus/target/classes/templates/backup/mapper.java.ftl deleted file mode 100644 index 9aa0ac3..0000000 --- a/trip-web-server/baseframe/mybatis-plus/target/classes/templates/backup/mapper.java.ftl +++ /dev/null @@ -1,16 +0,0 @@ -package ${package.Mapper}; - -import java.util.List; -import ${package.Entity}.${entity}; -import ${superMapperClassPackage}; -<#if kotlin> -interface ${table.mapperName} : ${superMapperClass}<${entity}> -<#else> -public interface ${table.mapperName} extends ${superMapperClass}<${entity}> { - public void add(${entity} ${package.ModuleName}); - public void update(${entity} ${package.ModuleName}); - public void del(String ${package.ModuleName}_id); - public ${entity} getById(String ${package.ModuleName}_id); - public List<${entity}> get(${entity} ${package.ModuleName}); - } - diff --git a/trip-web-server/baseframe/mybatis-plus/target/classes/templates/backup/mapper.xml.ftl b/trip-web-server/baseframe/mybatis-plus/target/classes/templates/backup/mapper.xml.ftl deleted file mode 100644 index 51b1897..0000000 --- a/trip-web-server/baseframe/mybatis-plus/target/classes/templates/backup/mapper.xml.ftl +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - insert into ${table.name}( - <#list table.fields as field> - <#if field.propertyName == "${package.ModuleName}_id"> - <#else> - ${field.propertyName}<#if field_has_next>, - - - )values( - <#list table.fields as field> - <#if field.propertyName == "${package.ModuleName}_id"> - <#else> - <#noparse>#{${field.propertyName}<#noparse>}<#if field_has_next>, - - - ) - - - - - - - - update ${table.name} v - set v.${package.ModuleName}_id = <#noparse>#{${package.ModuleName}_id<#noparse>} - <#list table.fields as field> - <#if field.propertyName == "${package.ModuleName}_id"> - <#else> - , v.${field.propertyName} - = <#noparse>#{${field.propertyName}<#noparse>} - - - where v.${package.ModuleName}_id = <#noparse>#{${package.ModuleName}_id<#noparse>} - - - - delete from ${table.name} - where ${package.ModuleName}_id = <#noparse>#{${package.ModuleName}_id<#noparse>} - - diff --git a/trip-web-server/baseframe/mybatis-plus/target/classes/templates/backup/service.java.ftl b/trip-web-server/baseframe/mybatis-plus/target/classes/templates/backup/service.java.ftl deleted file mode 100644 index 99d8ca7..0000000 --- a/trip-web-server/baseframe/mybatis-plus/target/classes/templates/backup/service.java.ftl +++ /dev/null @@ -1,18 +0,0 @@ -package ${package.Service}; - -import java.util.List; -import ${package.Entity}.${entity}; -import ${superServiceClassPackage}; - -<#if kotlin> - interface ${table.serviceName} : ${superServiceClass}<${entity}> -<#else> - public interface ${table.serviceName} extends ${superServiceClass}<${entity}> { - public void add(${entity} ${package.ModuleName}); - public void update(${entity} ${package.ModuleName}); - public void del(String ${package.ModuleName}_id); - public ${entity} getById(String ${package.ModuleName}_id); - public List<${entity}> get(${entity} ${package.ModuleName}); - public List<${entity}> get(${entity} ${package.ModuleName}, int pageNum, int pageSize); - } - diff --git a/trip-web-server/baseframe/mybatis-plus/target/classes/templates/backup/serviceImpl.java.ftl b/trip-web-server/baseframe/mybatis-plus/target/classes/templates/backup/serviceImpl.java.ftl deleted file mode 100644 index 4b14170..0000000 --- a/trip-web-server/baseframe/mybatis-plus/target/classes/templates/backup/serviceImpl.java.ftl +++ /dev/null @@ -1,58 +0,0 @@ -package ${package.ServiceImpl}; - -import ${package.Entity}.${entity}; -import ${package.Mapper}.${table.mapperName}; -import ${package.Service}.${table.serviceName}; -import ${superServiceImplClassPackage}; -import java.util.List; -import com.github.pagehelper.PageHelper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -<#if kotlin> - open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}>(), ${table.serviceName} { - - } -<#else> - public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName}, ${entity}> implements ${table.serviceName} { - - @Autowired - ${table.mapperName} ${package.ModuleName}Mapper; - - @Override - public void add(${entity} ${package.ModuleName}) { - ${package.ModuleName}Mapper.add(${package.ModuleName}); - } - - @Override - public void del(String ${package.ModuleName}_id) { - ${package.ModuleName}Mapper.del(${package.ModuleName}_id); - } - - @Override - public void update(${entity} ${package.ModuleName}) { - ${package.ModuleName}Mapper.update(${package.ModuleName}); - } - - - @Override - public ${entity} getById(String ${package.ModuleName}_id) { - return ${package.ModuleName}Mapper.getById(${package.ModuleName}_id); - } - - @Override - public List<${entity}> get(${entity} ${package.ModuleName}) { - List<${entity}> ${package.ModuleName}List = ${package.ModuleName}Mapper.get(${package.ModuleName}); - return ${package.ModuleName}List; - } - - @Override - public List<${entity}> get(${entity} ${package.ModuleName}, int pageNum, int pageSize) { - PageHelper.startPage(pageNum, pageSize); - List<${entity}> ${package.ModuleName}List = ${package.ModuleName}Mapper.get(${package.ModuleName}); - return ${package.ModuleName}List; - } - - } - diff --git a/trip-web-server/baseframe/mybatis-plus/target/classes/templates/code/controller.java.ftl b/trip-web-server/baseframe/mybatis-plus/target/classes/templates/code/controller.java.ftl deleted file mode 100644 index 9ef58a7..0000000 --- a/trip-web-server/baseframe/mybatis-plus/target/classes/templates/code/controller.java.ftl +++ /dev/null @@ -1,108 +0,0 @@ -package ${package.Controller}; - -import ${package.Service}.${table.serviceName}; -<#if restControllerStyle> -import org.springframework.web.bind.annotation.RestController; -<#else> -import org.springframework.stereotype.Controller; - -<#if superControllerClassPackage??> -import ${superControllerClassPackage}; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import ResResult; -import ${package.Entity}.dto.<#if entity?ends_with("DTO")>${entity? cap_first? substring(0, entity? index_of("DTO"))}<#else>${entity? cap_first}DTO; -import ${package.Entity}.vo.<#if entity?ends_with("VO")>${entity? cap_first? substring(0, entity? index_of("VO"))}<#else>${entity? cap_first}VO; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.Api; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import javax.annotation.Resource; -import java.util.Objects; -import java.util.List; - -/** - * ${table.comment!} - * @author ${author} - * @since ${date} - */ -<#if restControllerStyle> -@RequestMapping("<#if entity?ends_with("DTO")>${entity? substring(0, entity? uncap_first? index_of("DTO"))}<#else>${entity? uncap_first}") -@RestController -@Api(tags = "${table.comment}") -<#else> -@Controller - -<#if kotlin> -class ${table.controllerName}<#if superControllerClass??> : ${superControllerClass}() -<#else> - <#if superControllerClass??> -public class ${table.controllerName} extends ${superControllerClass} { - <#else> -public class ${table.controllerName} { - - - @Resource - private ${table.serviceName} <#if entity?ends_with("DTO")>${entity? substring(0, entity? uncap_first? index_of("DTO"))}<#else>${entity? uncap_first}Service; - - @GetMapping - @ApiOperation("${table.comment!}page查询") - @ApiImplicitParams({ - @ApiImplicitParam(name = "page", value = "当前页数", defaultValue = "1"), - @ApiImplicitParam(name = "size", value = "每页个数", defaultValue = "10"), - @ApiImplicitParam(name = "orderByColumn", value = "排序字段"), - @ApiImplicitParam(name = "isDesc", value = "是否降序") - }) - public ResResult${entity? cap_first? substring(0, entity? index_of("DTO"))}<#else>${entity? cap_first}VO>> getByPage(@Validated <#if entity?ends_with("DTO")>${entity? cap_first? substring(0, entity? index_of("DTO"))}<#else>${entity}DTO <#if entity?ends_with("DTO")>${entity? substring(0, entity? uncap_first? index_of("DTO"))}<#else>${entity? uncap_first}) { - // TODO 分页查询 - IPage<<#if entity?ends_with("DTO")>${entity? cap_first? substring(0, entity? index_of("DTO"))}<#else>${entity? cap_first}VO> page = <#if entity?ends_with("DTO")>${entity? substring(0, entity? uncap_first? index_of("DTO"))}<#else>${entity? uncap_first}Service.selectByPage(getPage(), ${entity? uncap_first}); - return ResResult.succ(page); - } - - @PostMapping("list") - @ApiOperation("${table.comment!}list查询") - @ApiImplicitParams({ - @ApiImplicitParam(name = "orderByColumn", value = "排序字段"), - @ApiImplicitParam(name = "isDesc", value = "是否降序") - }) - public ResResult${entity? cap_first? substring(0, entity? index_of("DTO"))}<#else>${entity? cap_first}VO>> list(@Validated @RequestBody <#if entity?ends_with("DTO")>${entity? cap_first? substring(0, entity? index_of("DTO"))}<#else>${entity}DTO <#if entity?ends_with("DTO")>${entity? substring(0, entity? uncap_first? index_of("DTO"))}<#else>${entity? uncap_first}) { - // TODO 分页查询 - IPage<<#if entity?ends_with("DTO")>${entity? cap_first? substring(0, entity? index_of("DTO"))}<#else>${entity? cap_first}VO> page = <#if entity?ends_with("DTO")>${entity? substring(0, entity? uncap_first? index_of("DTO"))}<#else>${entity? uncap_first}Service.list(getPage(), ${entity? uncap_first}); - return ResResult.succ(page); - } - - @GetMapping("{id}") - @ApiOperation("${table.comment!}查询(id)") - public ResResult<<#if entity?ends_with("DTO")>${entity? cap_first? substring(0, entity? index_of("DTO"))}<#else>${entity? cap_first}VO> get(@PathVariable String id) { - // TODO 查询 - boolean aNull = Objects.isNull(<#if entity?ends_with("DTO")>${entity? substring(0, entity? uncap_first? index_of("DTO"))}<#else>${entity? uncap_first}Service.getById(id)); - return ResResult.succ(aNull ? null : <#if entity?ends_with("DTO")>${entity? substring(0, entity? uncap_first? index_of("DTO"))}<#else>${entity? uncap_first}Service.getById(id).convert()); - } - - @PostMapping - @ApiOperation("${table.comment!}新增") - public ResResult add(@RequestBody @Validated <#if entity?ends_with("DTO")>${entity? cap_first? substring(0, entity? index_of("DTO"))}<#else>${entity}DTO <#if entity?ends_with("DTO")>${entity? substring(0, entity? uncap_first? index_of("DTO"))}<#else>${entity? uncap_first}) { - // TODO 新增 - <#if entity?ends_with("DTO")>${entity? substring(0, entity? uncap_first? index_of("DTO"))}<#else>${entity? uncap_first}Service.save(${entity? uncap_first}.convert()); - return ResResult.succ("新增成功"); - } - - @DeleteMapping("{id}") - @ApiOperation("${table.comment!}删除") - public ResResult del(@PathVariable String id) { - // TODO 删除 - <#if entity?ends_with("DTO")>${entity? substring(0, entity? uncap_first? index_of("DTO"))}<#else>${entity? uncap_first}Service.removeById(id); - return ResResult.succ("删除成功"); - } - - @PutMapping - @ApiOperation("${table.comment!}修改") - public ResResult update(@RequestBody @Validated <#if entity?ends_with("DTO")>${entity? cap_first? substring(0, entity? index_of("DTO"))}<#else>${entity}DTO <#if entity?ends_with("DTO")>${entity? substring(0, entity? uncap_first? index_of("DTO"))}<#else>${entity? uncap_first}) { - // TODO 修改 - <#if entity?ends_with("DTO")>${entity? substring(0, entity? uncap_first? index_of("DTO"))}<#else>${entity? uncap_first}Service.updateById(${entity? uncap_first}.convert()); - return ResResult.succ("修改成功"); - } -} - diff --git a/trip-web-server/baseframe/mybatis-plus/target/classes/templates/code/entity.java.ftl b/trip-web-server/baseframe/mybatis-plus/target/classes/templates/code/entity.java.ftl deleted file mode 100644 index ce2f590..0000000 --- a/trip-web-server/baseframe/mybatis-plus/target/classes/templates/code/entity.java.ftl +++ /dev/null @@ -1,141 +0,0 @@ -package ${package.Entity}; - -<#list table.importPackages as pkg> -import ${pkg}; - -<#if swagger2> -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -<#if entityLombokModel> -import lombok.Data; -import lombok.experimental.Accessors; - -<#if entity?ends_with("DTO")> -import ${package.Entity?substring(0, package.Entity? index_of("dto"))}<#if entity?ends_with("DTO")>${entity? cap_first? substring(0, entity? index_of("DTO"))}<#else>${entity? cap_first}; -<#elseif !entity?ends_with("DTO")&&!entity?ends_with("VO")> -import ${package.Entity}.vo.<#if entity?ends_with("DTO")>${entity? cap_first? substring(0, entity? index_of("DTO"))}<#else>${entity? cap_first}VO; - -<#--<#if entity?ends_with("DTO")>--> -<#-- import ${package.Entity}.<#if entity?ends_with("DTO")>${entity? cap_first? substring(0, entity? index_of("DTO"))}<#else>${entity? cap_first};--> -<#--<#elseif !entity?ends_with("DTO")&&!entity?ends_with("VO")>--> -<#-- import ${package.Entity}.vo.<#if entity?ends_with("DTO")>${entity? cap_first? substring(0, entity? index_of("DTO"))}<#else>${entity? cap_first}VO;--> -<#----> - -<#if entityLombokModel> -@Data -<#if superEntityClass??> - -@Accessors(chain = true) - -<#if table.convert> -@TableName("${table.name}") - -<#if swagger2> -@ApiModel(value="${entity}对象", description="${table.comment!}") - -<#if superEntityClass??> -public class ${entity} <#if !entity?ends_with("VO")>extends ${superEntityClass}<#if entity?ends_with("DTO")><${entity? cap_first? substring(0, entity? index_of("DTO"))}><#else><${entity? cap_first}VO>{ -<#elseif activeRecord> -public class ${entity} extends Model<${entity}> { -<#else> -public class ${entity} implements Serializable { - -<#-- ---------- BEGIN 字段循环遍历 ----------> -<#list table.fields as field> - <#if field.keyFlag> - <#assign keyPropertyName="${field.propertyName}"/> - - <#if field.comment!?length gt 0> - <#if swagger2> - @ApiModelProperty(value = "${field.comment}") - <#else> - - - <#if field.keyFlag> - <#-- 主键 --> - <#if field.keyIdentityFlag> - @TableId(value = "${field.name}", type = IdType.AUTO) - <#elseif idType??> - @TableId(value = "${field.name}", type = IdType.${idType}) - <#elseif field.convert> - @TableId("${field.name}") - - <#-- 普通字段 --> - <#elseif field.fill??> - <#-- ----- 存在字段填充设置 -----> - <#if field.convert> - @TableField(value = "${field.name}", fill = FieldFill.${field.fill}) - <#else> - @TableField(fill = FieldFill.${field.fill}) - - <#elseif field.convert> - @TableField("${field.name}") - - <#-- 乐观锁注解 --> - <#if (versionFieldName!"") == field.name> - @Version - - <#-- 逻辑删除注解 --> - <#if (logicDeleteFieldName!"") == field.name> - @TableLogic - - private ${field.propertyType} ${field.propertyName}; - -<#------------ END 字段循环遍历 ----------> -} -<#------------ BEGIN lombok ----------> -<#if !entityLombokModel> -<#list table.fields as field> - <#if field.propertyType == "boolean"> - <#assign getprefix="is"/> - <#else> - <#assign getprefix="get"/> - - public ${field.propertyType} ${getprefix}${field.capitalName}() { - return ${field.propertyName}; - } - - <#if entityBuilderModel> - public ${entity} set${field.capitalName}(${field.propertyType} ${field.propertyName}) { - <#else> - public void set${field.capitalName}(${field.propertyType} ${field.propertyName}) { - - this.${field.propertyName} = ${field.propertyName}; - <#if entityBuilderModel> - return this; - - } - - -<#------------ END lombok ----------> - -<#if entityColumnConstant> - <#list table.fields as field> - public static final String ${field.name?upper_case} = "${field.name}"; - - -<#if activeRecord> - @Override - protected Serializable pkVal() { - <#if keyPropertyName??> - return this.${keyPropertyName}; - <#else> - return null; - - } - -<#if !entityLombokModel> - @Override - public String toString() { - return "${entity}{" + - <#list table.fields as field> - <#if field_index==0> - "${field.propertyName}=" + ${field.propertyName} + - <#else> - ", ${field.propertyName}=" + ${field.propertyName} + - - - "}"; - } - diff --git a/trip-web-server/baseframe/mybatis-plus/target/classes/templates/code/mapper.java.ftl b/trip-web-server/baseframe/mybatis-plus/target/classes/templates/code/mapper.java.ftl deleted file mode 100644 index c4d0a9d..0000000 --- a/trip-web-server/baseframe/mybatis-plus/target/classes/templates/code/mapper.java.ftl +++ /dev/null @@ -1,14 +0,0 @@ -package ${package.Mapper}; - -import ${package.Entity}.${entity}; -import ${superMapperClassPackage}; -import org.apache.ibatis.annotations.Mapper; - -@Mapper -<#if kotlin> -interface ${table.mapperName} : ${superMapperClass}<${entity}> -<#else> -public interface ${table.mapperName} extends ${superMapperClass}<${entity}> { - -} - diff --git a/trip-web-server/baseframe/mybatis-plus/target/classes/templates/code/mapper.xml.ftl b/trip-web-server/baseframe/mybatis-plus/target/classes/templates/code/mapper.xml.ftl deleted file mode 100644 index ee720f2..0000000 --- a/trip-web-server/baseframe/mybatis-plus/target/classes/templates/code/mapper.xml.ftl +++ /dev/null @@ -1,76 +0,0 @@ - - - - - insert into ${table.name}( - <#list table.fields as field> - <#if field.propertyName == "${package.ModuleName}_id"> - <#else> - ${field.propertyName}<#if field_has_next>, - - - )values( - <#list table.fields as field> - <#if field.propertyName == "${package.ModuleName}_id"> - <#else> - <#noparse>#{${field.propertyName}<#noparse>}<#if field_has_next>, - - - ) - - - - - - - - update ${table.name} v - set v.${package.ModuleName}_id = <#noparse>#{${package.ModuleName}_id<#noparse>} - <#list table.fields as field> - <#if field.propertyName == "${package.ModuleName}_id"> - <#else> - , v.${field.propertyName} - = <#noparse>#{${field.propertyName}<#noparse>} - - - where v.${package.ModuleName}_id = <#noparse>#{${package.ModuleName}_id<#noparse>} - - - - delete from ${table.name} - where ${package.ModuleName}_id = <#noparse>#{${package.ModuleName}_id<#noparse>} - - diff --git a/trip-web-server/baseframe/mybatis-plus/target/classes/templates/code/service.java.ftl b/trip-web-server/baseframe/mybatis-plus/target/classes/templates/code/service.java.ftl deleted file mode 100644 index 21f01d7..0000000 --- a/trip-web-server/baseframe/mybatis-plus/target/classes/templates/code/service.java.ftl +++ /dev/null @@ -1,23 +0,0 @@ -package ${package.Service}; - -import com.baomidou.mybatisplus.core.metadata.IPage; -import ${package.Entity}.${entity}; -import ${superServiceClassPackage}; -import cn.zm.plus.web.entity.dto.${entity? cap_first}DTO; -import cn.zm.plus.web.entity.vo.${entity? cap_first}VO; -<#--import ${package.Entity}.${};--> - -<#if kotlin> -interface ${table.serviceName} : ${superServiceClass}<${entity}> -<#else> -public interface ${table.serviceName} extends ${superServiceClass}<${entity}> { - /** - * 分页查询 - * - * @param page 分页信息 - * @param ${entity} ${table.comment!}入参 - * @return 分页结果 - */ - IPage<${entity? cap_first}VO> selectByPage(IPage<${entity}> page, ${entity? cap_first}DTO ${entity}); -} - diff --git a/trip-web-server/baseframe/mybatis-plus/target/classes/templates/code/serviceImpl.java.ftl b/trip-web-server/baseframe/mybatis-plus/target/classes/templates/code/serviceImpl.java.ftl deleted file mode 100644 index 25fed20..0000000 --- a/trip-web-server/baseframe/mybatis-plus/target/classes/templates/code/serviceImpl.java.ftl +++ /dev/null @@ -1,30 +0,0 @@ -package ${package.ServiceImpl}; - -import ${package.Entity}.${entity}; -import ${package.Mapper}.${table.mapperName}; -import ${package.Service}.${table.serviceName}; -import ${superServiceImplClassPackage}; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import com.baomidou.mybatisplus.core.metadata.IPage; -import cn.zm.plus.web.entity.dto.${entity? cap_first}DTO; -import cn.zm.plus.web.entity.vo.${entity? cap_first}VO; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import ${package.Service?substring(0, package.Service? index_of("web.service"))}utils.ConvertUtil; - - -@Service -@Transactional(rollbackFor = Exception.class) -<#if kotlin> -open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}>(), ${table.serviceName} { - -} -<#else> -public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName}, ${entity}> implements ${table.serviceName} { - @Override - public IPage<${entity? cap_first}VO> selectByPage(IPage<${entity}> page, ${entity? cap_first}DTO ${table.name}) { - IPage<${entity}> ${table.name}Page = baseMapper.selectPage(page, new QueryWrapper<>(${table.name}.convert())); - return ConvertUtil.buildPage(${table.name}Page); - } -} -