update - Controller 添加 @Validated, 并引入 spring-boot-starter-validation maven pom

This commit is contained in:
wangli 2023-07-30 22:48:21 +08:00
parent 31ee07e5f5
commit 614fc77b62
8 changed files with 18 additions and 58 deletions

View File

@ -22,6 +22,10 @@
<groupId>cn.axzo.framework</groupId>
<artifactId>axzo-web-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>cn.axzo.workflow</groupId>
<artifactId>workflow-engine-core</artifactId>
@ -64,63 +68,6 @@
<artifactId>axzo-spring-cloud-starter</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>cn.axzo.framework</groupId>-->
<!-- <artifactId>axzo-consumer-spring-cloud-starter</artifactId>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>cn.axzo.framework</groupId>-->
<!-- <artifactId>axzo-processor-spring-boot-starter</artifactId>-->
<!-- </dependency>-->
<!-- &lt;!&ndash;mybatis-plus&ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>cn.axzo.framework</groupId>-->
<!-- <artifactId>axzo-mybatisplus-spring-boot-starter</artifactId>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; swagger-yapi &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>cn.axzo.framework</groupId>-->
<!-- <artifactId>axzo-swagger-yapi-spring-boot-starter</artifactId>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; druid &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.alibaba</groupId>-->
<!-- <artifactId>druid-spring-boot-starter</artifactId>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>cn.axzo.framework</groupId>-->
<!-- <artifactId>axzo-logger-spring-boot-starter</artifactId>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.activiti</groupId>-->
<!-- <artifactId>activiti-spring-boot-starter</artifactId>-->
<!-- <version>${activiti.version}</version>-->
<!-- <exclusions>-->
<!-- <exclusion>-->
<!-- <groupId>de.odysseus.juel</groupId>-->
<!-- <artifactId>juel-api</artifactId>-->
<!-- </exclusion>-->
<!-- <exclusion>-->
<!-- <groupId>de.odysseus.juel</groupId>-->
<!-- <artifactId>juel-spi</artifactId>-->
<!-- </exclusion>-->
<!-- <exclusion>-->
<!-- <groupId>org.mybatis</groupId>-->
<!-- <artifactId>mybatis</artifactId>-->
<!-- </exclusion>-->
<!-- <exclusion>-->
<!-- <artifactId>el-api</artifactId>-->
<!-- <groupId>javax.el</groupId>-->
<!-- </exclusion>-->
<!-- </exclusions>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.activiti</groupId>-->
<!-- <artifactId>activiti-image-generator</artifactId>-->
<!-- <version>${activiti.version}</version>-->
<!-- </dependency>-->
</dependencies>
</project>

View File

@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.flowable.common.engine.impl.db.SuspensionState;
import org.flowable.engine.repository.ProcessDefinition;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@ -22,6 +23,7 @@ import static cn.azxo.framework.common.model.CommonResponse.success;
@Slf4j
@RequestMapping("/web/v1/api/process/definition")
@RestController
@Validated
public class BpmnProcessDefinitionController {
@Resource
private BpmnProcessDefinitionService bpmnProcessDefinitionService;

View File

@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@ -22,6 +23,7 @@ import static cn.azxo.framework.common.model.CommonResponse.success;
@Slf4j
@RequestMapping("/web/v1/api/process/instance")
@RestController
@Validated
public class BpmnProcessInstanceController {
@Autowired

View File

@ -11,6 +11,7 @@ import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.flowable.form.api.FormInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@ -22,6 +23,7 @@ import static cn.azxo.framework.common.model.CommonResponse.success;
@Slf4j
@RequestMapping("/web/v1/api/process/task")
@RestController
@Validated
public class BpmnTaskController {
@Autowired

View File

@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@ -23,6 +24,7 @@ import static cn.azxo.framework.common.model.CommonResponse.success;
@Slf4j
@RequestMapping("/web/v1/api/category")
@RestController
@Validated
public class CategoryController {
@Autowired

View File

@ -8,6 +8,7 @@ import cn.azxo.framework.common.model.CommonResponse;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@ -27,6 +28,7 @@ import static cn.azxo.framework.common.model.CommonResponse.success;
@Slf4j
@RequestMapping("/web/v1/api/form/definition")
@RestController
@Validated
public class FormDefinitionController {
@Resource

View File

@ -5,6 +5,7 @@ import cn.axzo.workflow.core.service.dto.request.form.instance.FormContentUpdate
import cn.azxo.framework.common.model.CommonResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@ -23,6 +24,7 @@ import static cn.azxo.framework.common.model.CommonResponse.success;
@Slf4j
@RequestMapping("/web/v1/api/form/instance")
@RestController
@Validated
public class FormInstanceController {
@Autowired

View File

@ -11,6 +11,7 @@ import io.swagger.annotations.ApiParam;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@ -29,7 +30,7 @@ import static cn.azxo.framework.common.model.CommonResponse.success;
@Slf4j
@RequestMapping("/web/v1/api/form/model")
@RestController
@Valid
@Validated
public class FormModelController {
@Resource