update - Controller 添加 @Validated, 并引入 spring-boot-starter-validation maven pom
This commit is contained in:
parent
31ee07e5f5
commit
614fc77b62
@ -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>-->
|
||||
<!-- <!–mybatis-plus–>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.axzo.framework</groupId>-->
|
||||
<!-- <artifactId>axzo-mybatisplus-spring-boot-starter</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <!– swagger-yapi –>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.axzo.framework</groupId>-->
|
||||
<!-- <artifactId>axzo-swagger-yapi-spring-boot-starter</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <!– druid –>-->
|
||||
<!-- <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>
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user