“OpenFeign 传递对象类型普通表单数据”的版本间的差异
跳到导航
跳到搜索
Jihongchang(讨论 | 贡献) (建立内容为“https://www.bilibili.com/video/BV1My4y1W7vy?p=7”的新页面) |
Jihongchang(讨论 | 贡献) |
||
| 第1行: | 第1行: | ||
https://www.bilibili.com/video/BV1My4y1W7vy?p=7 | https://www.bilibili.com/video/BV1My4y1W7vy?p=7 | ||
| + | |||
| + | === 被调用 application service 的一方 === | ||
| + | |||
| + | ==== DemoController.java ==== | ||
| + | <syntaxhighlight lang="java"> | ||
| + | package io.github.jihch.controller; | ||
| + | |||
| + | import io.github.jihch.pojo.People; | ||
| + | import org.springframework.web.bind.annotation.PathVariable; | ||
| + | import org.springframework.web.bind.annotation.RequestBody; | ||
| + | import org.springframework.web.bind.annotation.RequestMapping; | ||
| + | import org.springframework.web.bind.annotation.RestController; | ||
| + | |||
| + | import java.util.ArrayList; | ||
| + | import java.util.List; | ||
| + | import java.util.Map; | ||
| + | |||
| + | @RestController | ||
| + | public class DemoController { | ||
| + | |||
| + | @RequestMapping("/newDemo6") | ||
| + | public People newDemo6(People people) { | ||
| + | return people; | ||
| + | } | ||
| + | |||
| + | } | ||
| + | </syntaxhighlight> | ||
2023年3月28日 (二) 07:25的最新版本
https://www.bilibili.com/video/BV1My4y1W7vy?p=7
被调用 application service 的一方
DemoController.java
package io.github.jihch.controller;
import io.github.jihch.pojo.People;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@RestController
public class DemoController {
@RequestMapping("/newDemo6")
public People newDemo6(People people) {
return people;
}
}