mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 21:57:56 +08:00
网关二合一
This commit is contained in:
@@ -17,6 +17,8 @@ import io.swagger.annotations.ApiOperation;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -39,6 +41,9 @@ import java.util.List;
|
||||
@Api(tags = "故事接口")
|
||||
public class AlipayController {
|
||||
|
||||
@Autowired
|
||||
private Environment environment;
|
||||
|
||||
// http://localhost:2222/story_get
|
||||
// 原生的接口,可正常调用
|
||||
@RequestMapping("story_get")
|
||||
@@ -180,7 +185,7 @@ public class AlipayController {
|
||||
public StoryResult getStory(StoryParam param) {
|
||||
StoryResult story = new StoryResult();
|
||||
story.setId(1L);
|
||||
story.setName("海底小纵队(alipay.story.get1.0), param:" + param);
|
||||
story.setName("海底小纵队(alipay.story.get1.0), port:" + environment.getProperty("server.port") + ", param:" + param);
|
||||
return story;
|
||||
}
|
||||
|
||||
|
@@ -34,7 +34,6 @@ public class FileUploadDemoController {
|
||||
@ApiOperation(value = "文件上传例1", notes = "上传文件demo")
|
||||
@ApiMapping(value = "demo.file.upload")
|
||||
public FileUploadResult file1(FileUploadParam param) {
|
||||
System.out.println(param.getRemark());
|
||||
// 获取上传的文件
|
||||
MultipartFile file1 = param.getFile1();
|
||||
MultipartFile file2 = param.getFile2();
|
||||
@@ -43,6 +42,7 @@ public class FileUploadDemoController {
|
||||
FileUploadResult.FileMeta fileMeta1 = buildFileMeta(file1);
|
||||
FileUploadResult.FileMeta fileMeta2 = buildFileMeta(file2);
|
||||
|
||||
result.setRemark(param.getRemark());
|
||||
result.getFiles().add(fileMeta1);
|
||||
result.getFiles().add(fileMeta2);
|
||||
return result;
|
||||
|
@@ -13,6 +13,7 @@ import java.util.List;
|
||||
public class FileUploadResult {
|
||||
|
||||
private List<FileMeta> files = new ArrayList();
|
||||
private String remark;
|
||||
|
||||
@Data
|
||||
public static class FileMeta {
|
||||
|
Reference in New Issue
Block a user