refactor: 优化代码生成模板中的业务名称显示
- 在 API、控制器、转换器、实体、表单、Mapper 等文件中 - 将业务名称的显示使用 trim() 方法去除前后空格 - 优化代码注释和接口文档中的业务名称显示效果
This commit is contained in:
@@ -3,7 +3,7 @@ import request from "@/utils/request";
|
|||||||
const ${entityName.toUpperCase()}_BASE_URL = "/api/v1/${lowerFirstEntityName}s";
|
const ${entityName.toUpperCase()}_BASE_URL = "/api/v1/${lowerFirstEntityName}s";
|
||||||
|
|
||||||
const ${entityName}API = {
|
const ${entityName}API = {
|
||||||
/** 获取${businessName}分页数据 */
|
/** 获取${businessName.trim()}分页数据 */
|
||||||
getPage(queryParams?: ${entityName}PageQuery) {
|
getPage(queryParams?: ${entityName}PageQuery) {
|
||||||
return request<any, PageResult<${entityName}PageVO[]>>({
|
return request<any, PageResult<${entityName}PageVO[]>>({
|
||||||
url: `${${entityName.toUpperCase()}_BASE_URL}/page`,
|
url: `${${entityName.toUpperCase()}_BASE_URL}/page`,
|
||||||
@@ -12,7 +12,7 @@ const ${entityName}API = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 获取${businessName}表单数据
|
* 获取${businessName.trim()}表单数据
|
||||||
*
|
*
|
||||||
* @param id ${entityName}ID
|
* @param id ${entityName}ID
|
||||||
* @returns ${entityName}表单数据
|
* @returns ${entityName}表单数据
|
||||||
@@ -24,7 +24,7 @@ const ${entityName}API = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 添加${businessName}*/
|
/** 添加${businessName.trim()}*/
|
||||||
add(data: ${entityName}Form) {
|
add(data: ${entityName}Form) {
|
||||||
return request({
|
return request({
|
||||||
url: `${${entityName.toUpperCase()}_BASE_URL}`,
|
url: `${${entityName.toUpperCase()}_BASE_URL}`,
|
||||||
@@ -34,7 +34,7 @@ const ${entityName}API = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新${businessName}
|
* 更新${businessName.trim()}
|
||||||
*
|
*
|
||||||
* @param id ${entityName}ID
|
* @param id ${entityName}ID
|
||||||
* @param data ${entityName}表单数据
|
* @param data ${entityName}表单数据
|
||||||
@@ -48,9 +48,9 @@ const ${entityName}API = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除${businessName},多个以英文逗号(,)分割
|
* 批量删除${businessName.trim()},多个以英文逗号(,)分割
|
||||||
*
|
*
|
||||||
* @param ids ${businessName}ID字符串,多个以英文逗号(,)分割
|
* @param ids ${businessName.trim()}ID字符串,多个以英文逗号(,)分割
|
||||||
*/
|
*/
|
||||||
deleteByIds(ids: string) {
|
deleteByIds(ids: string) {
|
||||||
return request({
|
return request({
|
||||||
@@ -62,7 +62,7 @@ const ${entityName}API = {
|
|||||||
|
|
||||||
export default ${entityName}API;
|
export default ${entityName}API;
|
||||||
|
|
||||||
/** ${businessName}分页查询参数 */
|
/** ${businessName.trim()}分页查询参数 */
|
||||||
export interface ${entityName}PageQuery extends PageQuery {
|
export interface ${entityName}PageQuery extends PageQuery {
|
||||||
#foreach($fieldConfig in $fieldConfigs)
|
#foreach($fieldConfig in $fieldConfigs)
|
||||||
#if($fieldConfig.isShowInQuery)
|
#if($fieldConfig.isShowInQuery)
|
||||||
@@ -82,7 +82,7 @@ export interface ${entityName}PageQuery extends PageQuery {
|
|||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
|
||||||
/** ${businessName}表单对象 */
|
/** ${businessName.trim()}表单对象 */
|
||||||
export interface ${entityName}Form {
|
export interface ${entityName}Form {
|
||||||
#foreach($fieldConfig in $fieldConfigs)
|
#foreach($fieldConfig in $fieldConfigs)
|
||||||
#if($fieldConfig.isShowInForm)
|
#if($fieldConfig.isShowInForm)
|
||||||
@@ -94,7 +94,7 @@ export interface ${entityName}Form {
|
|||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
|
||||||
/** ${businessName}分页对象 */
|
/** ${businessName.trim()}分页对象 */
|
||||||
export interface ${entityName}PageVO {
|
export interface ${entityName}PageVO {
|
||||||
#foreach($fieldConfig in $fieldConfigs)
|
#foreach($fieldConfig in $fieldConfigs)
|
||||||
#if($fieldConfig.isShowInList)
|
#if($fieldConfig.isShowInList)
|
||||||
|
|||||||
@@ -19,12 +19,12 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $!{businessName}前端控制层
|
* $!{businessName.trim()}前端控制层
|
||||||
*
|
*
|
||||||
* @author ${author}
|
* @author ${author}
|
||||||
* @since ${date}
|
* @since ${date}
|
||||||
*/
|
*/
|
||||||
@Tag(name = "${businessName}接口")
|
@Tag(name = "${businessName.trim()}接口")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/v1/${lowerFirstEntityName}s")
|
@RequestMapping("/api/v1/${lowerFirstEntityName}s")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@@ -32,7 +32,7 @@ public class ${entityName}Controller {
|
|||||||
|
|
||||||
private final ${entityName}Service ${lowerFirstEntityName}Service;
|
private final ${entityName}Service ${lowerFirstEntityName}Service;
|
||||||
|
|
||||||
@Operation(summary = "$!{businessName}分页列表")
|
@Operation(summary = "$!{businessName.trim()}分页列表")
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@PreAuthorize("@ss.hasPerm('${moduleName}:${lowerFirstEntityName}:query')")
|
@PreAuthorize("@ss.hasPerm('${moduleName}:${lowerFirstEntityName}:query')")
|
||||||
public PageResult<${entityName}VO> get${entityName}Page(${entityName}Query queryParams ) {
|
public PageResult<${entityName}VO> get${entityName}Page(${entityName}Query queryParams ) {
|
||||||
@@ -40,7 +40,7 @@ public class ${entityName}Controller {
|
|||||||
return PageResult.success(result);
|
return PageResult.success(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "新增${businessName}")
|
@Operation(summary = "新增${businessName.trim()}")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@PreAuthorize("@ss.hasPerm('${moduleName}:${lowerFirstEntityName}:add')")
|
@PreAuthorize("@ss.hasPerm('${moduleName}:${lowerFirstEntityName}:add')")
|
||||||
public Result<Void> save${entityName}(@RequestBody @Valid ${entityName}Form formData ) {
|
public Result<Void> save${entityName}(@RequestBody @Valid ${entityName}Form formData ) {
|
||||||
@@ -48,32 +48,32 @@ public class ${entityName}Controller {
|
|||||||
return Result.judge(result);
|
return Result.judge(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "获取${businessName}表单数据")
|
@Operation(summary = "获取${businessName.trim()}表单数据")
|
||||||
@GetMapping("/{id}/form")
|
@GetMapping("/{id}/form")
|
||||||
@PreAuthorize("@ss.hasPerm('${moduleName}:${lowerFirstEntityName}:edit')")
|
@PreAuthorize("@ss.hasPerm('${moduleName}:${lowerFirstEntityName}:edit')")
|
||||||
public Result<${entityName}Form> get${entityName}Form(
|
public Result<${entityName}Form> get${entityName}Form(
|
||||||
@Parameter(description = "$!{businessName}ID") @PathVariable Long id
|
@Parameter(description = "$!{businessName.trim()}ID") @PathVariable Long id
|
||||||
) {
|
) {
|
||||||
${entityName}Form formData = ${lowerFirstEntityName}Service.get${entityName}FormData(id);
|
${entityName}Form formData = ${lowerFirstEntityName}Service.get${entityName}FormData(id);
|
||||||
return Result.success(formData);
|
return Result.success(formData);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "修改${businessName}")
|
@Operation(summary = "修改${businessName.trim()}")
|
||||||
@PutMapping(value = "/{id}")
|
@PutMapping(value = "/{id}")
|
||||||
@PreAuthorize("@ss.hasPerm('${moduleName}:${lowerFirstEntityName}:edit')")
|
@PreAuthorize("@ss.hasPerm('${moduleName}:${lowerFirstEntityName}:edit')")
|
||||||
public Result<Void> update${entityName}(
|
public Result<Void> update${entityName}(
|
||||||
@Parameter(description = "$!{businessName}ID") @PathVariable Long id,
|
@Parameter(description = "$!{businessName.trim()}ID") @PathVariable Long id,
|
||||||
@RequestBody @Validated ${entityName}Form formData
|
@RequestBody @Validated ${entityName}Form formData
|
||||||
) {
|
) {
|
||||||
boolean result = ${lowerFirstEntityName}Service.update${entityName}(id, formData);
|
boolean result = ${lowerFirstEntityName}Service.update${entityName}(id, formData);
|
||||||
return Result.judge(result);
|
return Result.judge(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "删除${businessName}")
|
@Operation(summary = "删除${businessName.trim()}")
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
@PreAuthorize("@ss.hasPerm('${moduleName}:${lowerFirstEntityName}:delete')")
|
@PreAuthorize("@ss.hasPerm('${moduleName}:${lowerFirstEntityName}:delete')")
|
||||||
public Result<Void> delete${entityName}s(
|
public Result<Void> delete${entityName}s(
|
||||||
@Parameter(description = "$!{businessName}ID,多个以英文逗号(,)分割") @PathVariable String ids
|
@Parameter(description = "$!{businessName.trim()}ID,多个以英文逗号(,)分割") @PathVariable String ids
|
||||||
) {
|
) {
|
||||||
boolean result = ${lowerFirstEntityName}Service.delete${entityName}s(ids);
|
boolean result = ${lowerFirstEntityName}Service.delete${entityName}s(ids);
|
||||||
return Result.judge(result);
|
return Result.judge(result);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import ${packageName}.${moduleName}.model.entity.${entityName};
|
|||||||
import ${packageName}.${moduleName}.model.form.${entityName}Form;
|
import ${packageName}.${moduleName}.model.form.${entityName}Form;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $!{businessName}对象转换器
|
* $!{businessName.trim()}对象转换器
|
||||||
*
|
*
|
||||||
* @author ${author}
|
* @author ${author}
|
||||||
* @since ${date}
|
* @since ${date}
|
||||||
|
|||||||
@@ -12,14 +12,14 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
|||||||
import com.youlai.boot.common.base.BaseEntity;
|
import com.youlai.boot.common.base.BaseEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $!{businessName}实体对象
|
* $!{businessName.trim()}实体对象
|
||||||
*
|
*
|
||||||
* @author ${author}
|
* @author ${author}
|
||||||
* @since ${date}
|
* @since ${date}
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@TableName("${tableName}")
|
@TableName("${tableName.trim()}")
|
||||||
public class ${entityName} extends BaseEntity {
|
public class ${entityName} extends BaseEntity {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|||||||
@@ -16,14 +16,14 @@ import jakarta.validation.constraints.*;
|
|||||||
#end
|
#end
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $!{businessName}表单对象
|
* $!{businessName.trim()}表单对象
|
||||||
*
|
*
|
||||||
* @author ${author}
|
* @author ${author}
|
||||||
* @since ${date}
|
* @since ${date}
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@Schema(description = "$!{businessName}表单对象")
|
@Schema(description = "$!{businessName.trim()}表单对象")
|
||||||
public class ${entityName}Form implements Serializable {
|
public class ${entityName}Form implements Serializable {
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
|
|||||||
@@ -169,7 +169,7 @@
|
|||||||
/>
|
/>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<!-- $!{businessName}表单弹窗 -->
|
<!-- $!{businessName.trim()}表单弹窗 -->
|
||||||
<el-dialog
|
<el-dialog
|
||||||
v-model="dialog.visible"
|
v-model="dialog.visible"
|
||||||
:title="dialog.title"
|
:title="dialog.title"
|
||||||
@@ -270,7 +270,7 @@
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
});
|
});
|
||||||
|
|
||||||
// $!{businessName}表格数据
|
// $!{businessName.trim()}表格数据
|
||||||
const pageData = ref<${entityName}PageVO[]>([]);
|
const pageData = ref<${entityName}PageVO[]>([]);
|
||||||
|
|
||||||
// 弹窗
|
// 弹窗
|
||||||
@@ -279,10 +279,10 @@
|
|||||||
visible: false,
|
visible: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
// $!{businessName}表单数据
|
// $!{businessName.trim()}表单数据
|
||||||
const formData = reactive<${entityName}Form>({});
|
const formData = reactive<${entityName}Form>({});
|
||||||
|
|
||||||
// $!{businessName}表单校验规则
|
// $!{businessName.trim()}表单校验规则
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
#if($fieldConfigs)
|
#if($fieldConfigs)
|
||||||
#foreach($fieldConfig in ${fieldConfigs})
|
#foreach($fieldConfig in ${fieldConfigs})
|
||||||
@@ -293,7 +293,7 @@
|
|||||||
#end
|
#end
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 查询$!{businessName} */
|
/** 查询$!{businessName.trim()} */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
${entityName}API.getPage(queryParams)
|
${entityName}API.getPage(queryParams)
|
||||||
@@ -306,7 +306,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置$!{businessName}查询 */
|
/** 重置$!{businessName.trim()}查询 */
|
||||||
function handleResetQuery() {
|
function handleResetQuery() {
|
||||||
queryFormRef.value!.resetFields();
|
queryFormRef.value!.resetFields();
|
||||||
queryParams.pageNum = 1;
|
queryParams.pageNum = 1;
|
||||||
@@ -318,20 +318,20 @@
|
|||||||
removeIds.value = selection.map((item: any) => item.id);
|
removeIds.value = selection.map((item: any) => item.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 打开$!{businessName}弹窗 */
|
/** 打开$!{businessName.trim()}弹窗 */
|
||||||
function handleOpenDialog(id?: number) {
|
function handleOpenDialog(id?: number) {
|
||||||
dialog.visible = true;
|
dialog.visible = true;
|
||||||
if (id) {
|
if (id) {
|
||||||
dialog.title = "修改$!{businessName}";
|
dialog.title = "修改$!{businessName.trim()}";
|
||||||
${entityName}API.getFormData(id).then((data) => {
|
${entityName}API.getFormData(id).then((data) => {
|
||||||
Object.assign(formData, data);
|
Object.assign(formData, data);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
dialog.title = "新增$!{businessName}";
|
dialog.title = "新增$!{businessName.trim()}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提交$!{businessName}表单 */
|
/** 提交$!{businessName.trim()}表单 */
|
||||||
function handleSubmit() {
|
function handleSubmit() {
|
||||||
dataFormRef.value.validate((valid: any) => {
|
dataFormRef.value.validate((valid: any) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
@@ -358,7 +358,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 关闭$!{businessName}弹窗 */
|
/** 关闭$!{businessName.trim()}弹窗 */
|
||||||
function handleCloseDialog() {
|
function handleCloseDialog() {
|
||||||
dialog.visible = false;
|
dialog.visible = false;
|
||||||
dataFormRef.value.resetFields();
|
dataFormRef.value.resetFields();
|
||||||
@@ -366,7 +366,7 @@
|
|||||||
formData.id = undefined;
|
formData.id = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除$!{businessName} */
|
/** 删除$!{businessName.trim()} */
|
||||||
function handleDelete(id?: number) {
|
function handleDelete(id?: number) {
|
||||||
const ids = [id || removeIds.value].join(",");
|
const ids = [id || removeIds.value].join(",");
|
||||||
if (!ids) {
|
if (!ids) {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import ${packageName}.${moduleName}.model.vo.${entityName}VO;
|
|||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $!{businessName}Mapper接口
|
* $!{businessName.trim()}Mapper接口
|
||||||
*
|
*
|
||||||
* @author ${author}
|
* @author ${author}
|
||||||
* @since ${date}
|
* @since ${date}
|
||||||
@@ -17,7 +17,7 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
public interface ${entityName}Mapper extends BaseMapper<${entityName}> {
|
public interface ${entityName}Mapper extends BaseMapper<${entityName}> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取${businessName}分页数据
|
* 获取${businessName.trim()}分页数据
|
||||||
*
|
*
|
||||||
* @param page 分页对象
|
* @param page 分页对象
|
||||||
* @param queryParams 查询参数
|
* @param queryParams 查询参数
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="${packageName}.${moduleName}.mapper.${entityName}Mapper">
|
<mapper namespace="${packageName}.${moduleName}.mapper.${entityName}Mapper">
|
||||||
|
|
||||||
<!-- 获取${businessName}分页列表 -->
|
<!-- 获取${businessName.trim()}分页列表 -->
|
||||||
<select id="get${entityName}Page" resultType="${packageName}.${moduleName}.model.vo.${entityName}VO">
|
<select id="get${entityName}Page" resultType="${packageName}.${moduleName}.model.vo.${entityName}VO">
|
||||||
SELECT
|
SELECT
|
||||||
#if($fieldConfigs)
|
#if($fieldConfigs)
|
||||||
|
|||||||
@@ -13,12 +13,12 @@ import java.math.BigDecimal;
|
|||||||
#end
|
#end
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $!{businessName}分页查询对象
|
* $!{businessName.trim()}分页查询对象
|
||||||
*
|
*
|
||||||
* @author ${author}
|
* @author ${author}
|
||||||
* @since ${date}
|
* @since ${date}
|
||||||
*/
|
*/
|
||||||
@Schema(description ="$!{businessName}查询对象")
|
@Schema(description ="$!{businessName.trim()}查询对象")
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class ${entityName}Query extends BasePageQuery {
|
public class ${entityName}Query extends BasePageQuery {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $!{businessName}服务类
|
* $!{businessName.trim()}服务类
|
||||||
*
|
*
|
||||||
* @author ${author}
|
* @author ${author}
|
||||||
* @since ${date}
|
* @since ${date}
|
||||||
@@ -16,41 +16,41 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||||||
public interface ${entityName}Service extends IService<${entityName}> {
|
public interface ${entityName}Service extends IService<${entityName}> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*$!{businessName}分页列表
|
*$!{businessName.trim()}分页列表
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
IPage<${entityName}VO> get${entityName}Page(${entityName}Query queryParams);
|
IPage<${entityName}VO> get${entityName}Page(${entityName}Query queryParams);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取${businessName}表单数据
|
* 获取${businessName.trim()}表单数据
|
||||||
*
|
*
|
||||||
* @param id $!{businessName}ID
|
* @param id $!{businessName.trim()}ID
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
${entityName}Form get${entityName}FormData(Long id);
|
${entityName}Form get${entityName}FormData(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增${businessName}
|
* 新增${businessName.trim()}
|
||||||
*
|
*
|
||||||
* @param formData $!{businessName}表单对象
|
* @param formData $!{businessName.trim()}表单对象
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
boolean save${entityName}(${entityName}Form formData);
|
boolean save${entityName}(${entityName}Form formData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改${businessName}
|
* 修改${businessName.trim()}
|
||||||
*
|
*
|
||||||
* @param id $!{businessName}ID
|
* @param id $!{businessName.trim()}ID
|
||||||
* @param formData $!{businessName}表单对象
|
* @param formData $!{businessName.trim()}表单对象
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
boolean update${entityName}(Long id, ${entityName}Form formData);
|
boolean update${entityName}(Long id, ${entityName}Form formData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除${businessName}
|
* 删除${businessName.trim()}
|
||||||
*
|
*
|
||||||
* @param ids $!{businessName}ID,多个以英文逗号(,)分割
|
* @param ids $!{businessName.trim()}ID,多个以英文逗号(,)分割
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
boolean delete${entityName}s(String ids);
|
boolean delete${entityName}s(String ids);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import cn.hutool.core.lang.Assert;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $!{businessName}服务实现类
|
* $!{businessName.trim()}服务实现类
|
||||||
*
|
*
|
||||||
* @author ${author}
|
* @author ${author}
|
||||||
* @since ${date}
|
* @since ${date}
|
||||||
@@ -33,10 +33,10 @@ public class ${entityName}ServiceImpl extends ServiceImpl<${entityName}Mapper, $
|
|||||||
private final ${entityName}Converter ${lowerFirstEntityName}Converter;
|
private final ${entityName}Converter ${lowerFirstEntityName}Converter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取${businessName}分页列表
|
* 获取${businessName.trim()}分页列表
|
||||||
*
|
*
|
||||||
* @param queryParams 查询参数
|
* @param queryParams 查询参数
|
||||||
* @return {@link IPage<${entityName}VO>} $!{businessName}分页列表
|
* @return {@link IPage<${entityName}VO>} $!{businessName.trim()}分页列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IPage<${entityName}VO> get${entityName}Page(${entityName}Query queryParams) {
|
public IPage<${entityName}VO> get${entityName}Page(${entityName}Query queryParams) {
|
||||||
@@ -48,9 +48,9 @@ public class ${entityName}ServiceImpl extends ServiceImpl<${entityName}Mapper, $
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取${businessName}表单数据
|
* 获取${businessName.trim()}表单数据
|
||||||
*
|
*
|
||||||
* @param id $!{businessName}ID
|
* @param id $!{businessName.trim()}ID
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@@ -60,9 +60,9 @@ public class ${entityName}ServiceImpl extends ServiceImpl<${entityName}Mapper, $
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增${businessName}
|
* 新增${businessName.trim()}
|
||||||
*
|
*
|
||||||
* @param formData $!{businessName}表单对象
|
* @param formData $!{businessName.trim()}表单对象
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@@ -72,10 +72,10 @@ public class ${entityName}ServiceImpl extends ServiceImpl<${entityName}Mapper, $
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新${businessName}
|
* 更新${businessName.trim()}
|
||||||
*
|
*
|
||||||
* @param id $!{businessName}ID
|
* @param id $!{businessName.trim()}ID
|
||||||
* @param formData $!{businessName}表单对象
|
* @param formData $!{businessName.trim()}表单对象
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@@ -85,14 +85,14 @@ public class ${entityName}ServiceImpl extends ServiceImpl<${entityName}Mapper, $
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除${businessName}
|
* 删除${businessName.trim()}
|
||||||
*
|
*
|
||||||
* @param ids $!{businessName}ID,多个以英文逗号(,)分割
|
* @param ids $!{businessName.trim()}ID,多个以英文逗号(,)分割
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean delete${entityName}s(String ids) {
|
public boolean delete${entityName}s(String ids) {
|
||||||
Assert.isTrue(StrUtil.isNotBlank(ids), "删除的${businessName}数据为空");
|
Assert.isTrue(StrUtil.isNotBlank(ids), "删除的${businessName.trim()}数据为空");
|
||||||
// 逻辑删除
|
// 逻辑删除
|
||||||
List<Long> idList = Arrays.stream(ids.split(","))
|
List<Long> idList = Arrays.stream(ids.split(","))
|
||||||
.map(Long::parseLong)
|
.map(Long::parseLong)
|
||||||
|
|||||||
@@ -14,14 +14,14 @@ import java.math.BigDecimal;
|
|||||||
#end
|
#end
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $!{businessName}视图对象
|
* $!{businessName.trim()}视图对象
|
||||||
*
|
*
|
||||||
* @author ${author}
|
* @author ${author}
|
||||||
* @since ${date}
|
* @since ${date}
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@Schema( description = "$!{businessName}视图对象")
|
@Schema( description = "$!{businessName.trim()}视图对象")
|
||||||
public class ${entityName}VO implements Serializable {
|
public class ${entityName}VO implements Serializable {
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
|
|||||||
Reference in New Issue
Block a user