1
0
mirror of https://gitee.com/coder-xiaomo/flashsale synced 2025-09-14 07:51:38 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

交易下单3-下单部分

This commit is contained in:
2022-03-03 23:37:17 +08:00
parent e3917d1ff1
commit 49d3380c40
6 changed files with 109 additions and 8 deletions

View File

@@ -62,6 +62,26 @@
>
> - 可以用 `org.springframework.beans` 包中的 `BeanUtils.copyProperties` 进行DO转Model或Model转DO要字段和类型完全一致的字段才能拷贝其他不对应字段的需要手动设置
7.
7. Service返回Controller前完成将DO转换为Model同时进行业务处理最后返回Model
8. Service返回Controller前将DO
8. 创建Controller继承BaseController在class上添加注解
```java
@Controller("/item")
@RequestMapping("/item")
@CrossOrigin(allowedHeaders = "*", allowCredentials = "true")
```
9. 创建Controller方法添加以下注释
```java
// POST
@RequestMapping(value = "/create", method = {RequestMethod.POST}, consumes = {CONTENT_TYPE_FORMED})
@ResponseBody
// GET
@RequestMapping(value = "/get", method = {RequestMethod.GET})
@ResponseBody
```
10.