修复请求体超过256KB无法请求问题

This commit is contained in:
tanghc
2020-07-30 11:58:32 +08:00
parent f86e569c03
commit 4d6693aca2
14 changed files with 180 additions and 24 deletions

View File

@@ -2,6 +2,7 @@ package com.gitee.sop.storyweb.controller;
import com.gitee.sop.servercommon.annotation.Open;
import com.gitee.sop.storyweb.controller.param.CategoryParam;
import com.gitee.sop.storyweb.controller.param.LargeTextParam;
import com.gitee.sop.storyweb.controller.param.StoryParam;
import com.gitee.sop.storyweb.controller.result.CategoryResult;
import com.gitee.sop.storyweb.controller.result.StoryResult;
@@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@@ -69,6 +71,15 @@ public class Example1001_BaseController {
return result;
}
@Open(value = "story.get.large")
@RequestMapping("/get/large/v1")
public StoryResult getStoryLarge(LargeTextParam param) {
StoryResult result = new StoryResult();
int length = param.getContent().getBytes(StandardCharsets.UTF_8).length;
result.setName("length:" + length);
return result;
}
// 返回数组结果
@ApiOperation(value = "返回数组结果", notes = "返回数组结果")
@Open("story.list")

View File

@@ -0,0 +1,11 @@
package com.gitee.sop.storyweb.controller.param;
import lombok.Data;
/**
* @author tanghc
*/
@Data
public class LargeTextParam {
private String content;
}