mirror of
https://gitee.com/coder-xiaomo/flashsale
synced 2025-09-14 07:51:38 +08:00
交易下单3-下单部分
This commit is contained in:
24
README.md
24
README.md
@@ -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.
|
||||
|
Reference in New Issue
Block a user