fix: 代码生成问题修复
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
package com.youlai.boot.common.base;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 基础分页请求对象
|
||||
*
|
||||
@@ -12,7 +14,11 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
@Schema
|
||||
public class BasePageQuery {
|
||||
public class BasePageQuery implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@Schema(description = "页码", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private int pageNum = 1;
|
||||
|
||||
@@ -99,7 +99,7 @@ public class UserController {
|
||||
@Operation(summary = "删除用户")
|
||||
@DeleteMapping("/{ids}")
|
||||
@PreAuthorize("@ss.hasPerm('sys:user:delete')")
|
||||
public Result<?> deleteUsers(
|
||||
public Result<Void> deleteUsers(
|
||||
@Parameter(description = "用户ID,多个以英文逗号(,)分割") @PathVariable String ids
|
||||
) {
|
||||
boolean result = userService.deleteUsers(ids);
|
||||
@@ -108,7 +108,7 @@ public class UserController {
|
||||
|
||||
@Operation(summary = "修改用户状态")
|
||||
@PatchMapping(value = "/{userId}/status")
|
||||
public Result<?> updateUserStatus(
|
||||
public Result<Void> updateUserStatus(
|
||||
@Parameter(description = "用户ID") @PathVariable Long userId,
|
||||
@Parameter(description = "用户状态(1:启用;0:禁用)") @RequestParam Integer status
|
||||
) {
|
||||
@@ -144,7 +144,7 @@ public class UserController {
|
||||
|
||||
@Operation(summary = "导入用户")
|
||||
@PostMapping("/import")
|
||||
public Result<?> importUsers(MultipartFile file) throws IOException {
|
||||
public Result<String> importUsers(MultipartFile file) throws IOException {
|
||||
UserImportListener listener = new UserImportListener();
|
||||
String msg = ExcelUtils.importExcel(file.getInputStream(), UserImportDTO.class, listener);
|
||||
return Result.success(msg);
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ${entityName}Controller {
|
||||
@Operation(summary = "新增${businessName}")
|
||||
@PostMapping
|
||||
@PreAuthorize("@ss.hasPerm('${moduleName}:${lowerFirstEntityName}:add')")
|
||||
public Result save${entityName}(@RequestBody @Valid ${entityName}Form formData ) {
|
||||
public Result<Void> save${entityName}(@RequestBody @Valid ${entityName}Form formData ) {
|
||||
boolean result = ${lowerFirstEntityName}Service.save${entityName}(formData);
|
||||
return Result.judge(result);
|
||||
}
|
||||
@@ -61,7 +61,7 @@ public class ${entityName}Controller {
|
||||
@Operation(summary = "修改${businessName}")
|
||||
@PutMapping(value = "/{id}")
|
||||
@PreAuthorize("@ss.hasPerm('${moduleName}:${lowerFirstEntityName}:edit')")
|
||||
public Result update${entityName}(
|
||||
public Result<Void> update${entityName}(
|
||||
@Parameter(description = "$!{businessName}ID") @PathVariable Long id,
|
||||
@RequestBody @Validated ${entityName}Form formData
|
||||
) {
|
||||
@@ -72,7 +72,7 @@ public class ${entityName}Controller {
|
||||
@Operation(summary = "删除${businessName}")
|
||||
@DeleteMapping("/{ids}")
|
||||
@PreAuthorize("@ss.hasPerm('${moduleName}:${lowerFirstEntityName}:delete')")
|
||||
public Result delete${entityName}s(
|
||||
public Result<Void> delete${entityName}s(
|
||||
@Parameter(description = "$!{businessName}ID,多个以英文逗号(,)分割") @PathVariable String ids
|
||||
) {
|
||||
boolean result = ${lowerFirstEntityName}Service.delete${entityName}s(ids);
|
||||
|
||||
@@ -174,10 +174,8 @@
|
||||
<el-form-item label="$fieldConfig.fieldComment" prop="$fieldConfig.fieldName">
|
||||
#if($fieldConfig.formType == "INPUT")
|
||||
<el-input
|
||||
v-model="queryParams.$fieldConfig.fieldName"
|
||||
v-model="formData.$fieldConfig.fieldName"
|
||||
placeholder="$fieldConfig.fieldComment"
|
||||
clearable
|
||||
@keyup.enter="handleQuery()"
|
||||
/>
|
||||
#elseif($fieldConfig.formType == "SELECT")
|
||||
#if($fieldConfig.dictType != "")
|
||||
@@ -189,34 +187,34 @@
|
||||
</el-select>
|
||||
#end
|
||||
#elseif($fieldConfig.formType == "RADIO")
|
||||
<el-radio-group v-model="queryParams.$fieldConfig.fieldName">
|
||||
<el-radio-group v-model="formData.$fieldConfig.fieldName">
|
||||
<el-radio :value="0">选项一</el-radio>
|
||||
<el-radio :value="1">选项二</el-radio>
|
||||
</el-radio-group>
|
||||
#elseif($fieldConfig.formType == "CHECK_BOX")
|
||||
<el-checkbox-group v-model="queryParams.$fieldConfig.fieldName">
|
||||
<el-checkbox-group v-model="formData.$fieldConfig.fieldName">
|
||||
<el-checkbox :value="0">选项一</el-checkbox>
|
||||
<el-checkbox :value="1">选项二</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
#elseif($fieldConfig.formType == "INPUT_NUMBER")
|
||||
<el-input-number
|
||||
v-model="queryParams.$fieldConfig.fieldName"
|
||||
v-model="formData.$fieldConfig.fieldName"
|
||||
placeholder="$fieldConfig.fieldComment"
|
||||
/>
|
||||
#elseif($fieldConfig.formType == "SWITCH")
|
||||
<el-switch
|
||||
v-model="queryParams.$fieldConfig.fieldName"
|
||||
v-model="formData.$fieldConfig.fieldName"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
/>
|
||||
#elseif($fieldConfig.formType == "TEXT_AREA")
|
||||
<el-input type="textarea"
|
||||
v-model="queryParams.$fieldConfig.fieldName"
|
||||
v-model="formData.$fieldConfig.fieldName"
|
||||
placeholder="$fieldConfig.fieldComment"
|
||||
/>
|
||||
#elseif($fieldConfig.formType == "DATE_TIME")
|
||||
<el-date-picker
|
||||
v-model="queryParams.$fieldConfig.fieldName"
|
||||
v-model="formData.$fieldConfig.fieldName"
|
||||
type="datetime"
|
||||
placeholder="$fieldConfig.fieldComment"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
@@ -224,7 +222,7 @@
|
||||
#elseif($fieldConfig.formType == "DATE")
|
||||
<el-date-picker
|
||||
class="!w-[240px]"
|
||||
v-model="queryParams.$fieldConfig.fieldName"
|
||||
v-model="formData.$fieldConfig.fieldName"
|
||||
type="date"
|
||||
placeholder="$fieldConfig.fieldComment"
|
||||
value-format="YYYY-MM-DD"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package ${packageName}.${moduleName}.${subpackageName};
|
||||
|
||||
import com.youlai.boot.common.base.BasePageQuery;
|
||||
import ${packageName}.common.base.BasePageQuery;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -23,8 +23,6 @@ import java.math.BigDecimal;
|
||||
@Setter
|
||||
public class ${entityName}Query extends BasePageQuery {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
#if($fieldConfigs)
|
||||
#foreach($fieldConfig in ${fieldConfigs})
|
||||
#if($fieldConfig.isShowInQuery)
|
||||
|
||||
Reference in New Issue
Block a user