apache / servicecomb-java-chassis

ServiceComb Java Chassis is a Software Development Kit (SDK) for rapid development of microservices in Java, providing service registration, service discovery, dynamic routing, and service management features
Apache License 2.0
1.91k stars 813 forks source link

GET接口是如何支持类似RequestBody机制的? #3741

Open minshiwu opened 1 year ago

minshiwu commented 1 year ago

在通过Servicecomb发布和启动微服务里面,支持对Get接口,也定义Model class进行参数映射,且mode class支持java validation注解。看起来像Post接口一样。请问Servicecomb源码是在哪里进行处理的?

// 发布Get接口
@RequestMapping(value = {"/apply/apply-list"}, method = {RequestMethod.GET})
public Object queryApplyList(@Valid QueryApplyReq queryApplyReq) throws Exception {
   // 
}

//  Model define
@Data
public class QueryApplyReq extends BaseReq {
    @Length(max = 50, message = "operator_id length range is [0, 50]")
    @JsonProperty("operator_id")
    @ApiModelProperty(name = "operator_id", dataType = "string")
    private String operatorId;

    @Length(max = 50, message = "approver_id length range is [0, 50]")
    @JsonProperty("approver_id")
    @ApiModelProperty(name = "approver_id", dataType = "string")
    private String approverId;
}
lbc97 commented 1 year ago

正常springboot 框架这样也可以吧 应该是直接借用的springboot框架的能力