servicecomb-java-chassis icon indicating copy to clipboard operation
servicecomb-java-chassis copied to clipboard

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

Open minshiwu opened this issue 2 years ago • 1 comments

在通过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;
}

minshiwu avatar Apr 03 '23 06:04 minshiwu

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

lbc97 avatar Apr 03 '23 07:04 lbc97