|
@@ -1,19 +1,20 @@
|
|
|
package com.aizuda.boot.modules.flw.controller;
|
|
|
|
|
|
+import com.aizuda.boot.modules.flw.entity.FlwForm;
|
|
|
+import com.aizuda.boot.modules.flw.service.IFlwFormService;
|
|
|
import com.aizuda.core.api.ApiController;
|
|
|
import com.aizuda.core.api.PageParam;
|
|
|
import com.aizuda.core.validation.Create;
|
|
|
import com.aizuda.core.validation.Update;
|
|
|
-import com.aizuda.boot.modules.flw.entity.FlwForm;
|
|
|
-import com.aizuda.boot.modules.flw.service.IFlwFormService;
|
|
|
+import com.baomidou.kisso.annotation.Permission;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
+import jakarta.validation.constraints.NotEmpty;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import jakarta.validation.constraints.NotEmpty;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -30,30 +31,35 @@ public class FlwFormController extends ApiController {
|
|
|
private IFlwFormService flwFormService;
|
|
|
|
|
|
@Operation(summary = "分页列表")
|
|
|
+ @Permission("flw:form:page")
|
|
|
@PostMapping("/page")
|
|
|
public Page<FlwForm> getPage(@RequestBody PageParam<FlwForm> dto) {
|
|
|
return flwFormService.page(dto.page(), dto.getData());
|
|
|
}
|
|
|
|
|
|
@Operation(summary = "查询 id 信息")
|
|
|
+ @Permission("flw:form:get")
|
|
|
@GetMapping("/get")
|
|
|
public FlwForm get(@RequestParam Long id) {
|
|
|
return flwFormService.getById(id);
|
|
|
}
|
|
|
|
|
|
@Operation(summary = "根据 id 修改信息")
|
|
|
+ @Permission("flw:form:update")
|
|
|
@PostMapping("/update")
|
|
|
public boolean update(@Validated(Update.class) @RequestBody FlwForm flwForm) {
|
|
|
return flwFormService.updateById(flwForm);
|
|
|
}
|
|
|
|
|
|
@Operation(summary = "创建添加")
|
|
|
+ @Permission("flw:form:create")
|
|
|
@PostMapping("/create")
|
|
|
public boolean create(@Validated(Create.class) @RequestBody FlwForm flwForm) {
|
|
|
return flwFormService.save(flwForm);
|
|
|
}
|
|
|
|
|
|
@Operation(summary = "根据 ids 删除")
|
|
|
+ @Permission("flw:form:delete")
|
|
|
@PostMapping("/delete")
|
|
|
public boolean delete(@NotEmpty @RequestBody List<Long> ids) {
|
|
|
return flwFormService.removeByIds(ids);
|