|
|
@@ -9,12 +9,14 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import java.util.List;
|
|
|
|
|
|
@RestController
|
|
|
-@RequestMapping("/api/product")
|
|
|
+@RequestMapping("/api/product") // todo: products
|
|
|
public class ProductController {
|
|
|
|
|
|
@Autowired
|
|
|
ProductService productService;
|
|
|
|
|
|
+// todo: 按照REST规范,资源使用复数,对于新建对象
|
|
|
+// 直接使用@PostMapping("")
|
|
|
@PostMapping("/create")
|
|
|
public ResultVO<Boolean> create(@RequestBody ProductVO productVO){
|
|
|
return ResultVO.buildSuccess(productService.create(productVO));
|