Commit ef55ce576b8c8a72f5b7c8d7f5a142c37de7c8de

Authored by miaoguoxin
1 parent 0a75e26b

code review

src/main/java/com/diligrp/xtrade/product/controllor/ProductApiController.java 0 → 100644
  1 +package com.diligrp.xtrade.product.controllor;
  2 +
  3 +import com.diligrp.xtrade.product.domain.dto.ProductCreateRequestDto;
  4 +import com.diligrp.xtrade.product.domain.dto.ProductQueryRequestDto;
  5 +import com.diligrp.xtrade.product.domain.dto.ProductQueryResponsetDto;
  6 +import com.diligrp.xtrade.product.service.ProductService;
  7 +import com.diligrp.xtrade.shared.domain.Message;
  8 +import org.springframework.web.bind.annotation.RequestBody;
  9 +import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.bind.annotation.RestController;
  11 +
  12 +import javax.annotation.Resource;
  13 +import java.util.List;
  14 +
  15 +@RestController
  16 +@RequestMapping(value = "/sapi/product")
  17 +public class ProductApiController {
  18 +
  19 + @Resource
  20 + private ProductService productService;
  21 +
  22 + @RequestMapping(value = "/createProduct")
  23 + public Message<?> createOrder(@RequestBody ProductCreateRequestDto productCreateRequestDto) {
  24 + productService.createProduct(productCreateRequestDto);
  25 + return Message.success();
  26 + }
  27 +
  28 + @RequestMapping(value = "/listProducts")
  29 + public Message<List<ProductQueryResponsetDto>> listOrders(@RequestBody ProductQueryRequestDto productQueryRequestDto) {
  30 + return Message.success(productService.orderLists(productQueryRequestDto));
  31 + }
  32 +
  33 + @RequestMapping(value = "/productDetail")
  34 + public Message<ProductQueryResponsetDto> orderDetail(@RequestBody ProductQueryRequestDto productQueryRequestDto) {
  35 + return Message.success(productService.orderDetail(productQueryRequestDto));
  36 + }
  37 +
  38 +}
... ...