| | |
| | | package com.matrix.system.app.action; |
| | | |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.app.dto.ShoppingGoodsListDto; |
| | | import com.matrix.system.app.vo.ShoppingGoodsListVo; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.hive.bean.ShoppingGoodsCategory; |
| | | import com.matrix.system.hive.service.ShoppingGoodsCategoryService; |
| | | import com.matrix.system.hive.service.ShoppingGoodsService; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2020-12-21 |
| | | **/ |
| | | @Api(value = "ApiOrderAction", tags = "订单接口类") |
| | | @RestController |
| | | @RequestMapping(value = "/api/order") |
| | | public class ApiOrderAction { |
| | | |
| | | @Autowired |
| | | private ShoppingGoodsCategoryService shoppingGoodsCategoryService; |
| | | |
| | | @Autowired |
| | | private ShoppingGoodsService shoppingGoodsService; |
| | | |
| | | @ApiOperation(value = "获取商品类型列表", notes = "获取商品类型列表") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = ShoppingGoodsCategory.class) |
| | | }) |
| | | @GetMapping(value = "/findShoppingGoodsType") |
| | | public AjaxResult findShoppingGoodsType() { |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | |
| | | ShoppingGoodsCategory category = new ShoppingGoodsCategory(); |
| | | category.setShopId(user.getShopId()); |
| | | category.setName("家居产品"); |
| | | return AjaxResult.buildSuccessInstance(shoppingGoodsCategoryService.findChildNodesByName(category)); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取商品列表", notes = "获取商品列表") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = ShoppingGoodsListVo.class) |
| | | }) |
| | | @PostMapping(value = "/findShoppingGoods") |
| | | public AjaxResult findShoppingGoods(@RequestBody @Validated ShoppingGoodsListDto shoppingGoodsListDto) { |
| | | |
| | | return AjaxResult.buildSuccessInstance(shoppingGoodsService.findShoppingGoodsListForApi(shoppingGoodsListDto), shoppingGoodsService.findShoppingGoodsListTotalForApi(shoppingGoodsListDto)); |
| | | } |
| | | |
| | | @PostMapping(value = "/createOrder") |
| | | public AjaxResult createOrder() { |