| | |
| | | |
| | | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.xzx.gc.common.Result; |
| | | import com.xzx.gc.common.request.BaseController; |
| | | import com.xzx.gc.model.JsonResult; |
| | | import com.xzx.gc.service.BaseAccountService; |
| | | import com.xzx.gc.shop.dto.AddGoodsOrderDto; |
| | | import com.xzx.gc.shop.dto.XcxGoodsListDto; |
| | | import com.xzx.gc.shop.service.GoodsService; |
| | | import com.xzx.gc.shop.service.OrderService; |
| | | import com.xzx.gc.shop.vo.GoodsCategoryVo; |
| | | import com.xzx.gc.shop.vo.XcxGoodsDetailVo; |
| | | import com.xzx.gc.shop.vo.XcxGoodsListVo; |
| | |
| | | @RestController |
| | | @Api(tags = {"积分商城--API商品管理"}) |
| | | @Slf4j |
| | | public class ApiGoodsController { |
| | | public class ApiGoodsController extends BaseController { |
| | | |
| | | @Autowired |
| | | private GoodsService goodsService; |
| | | |
| | | @Autowired |
| | | private OrderService orderService; |
| | | |
| | | @ApiOperation("分类列表") |
| | | @ApiResponses( |
| | |
| | | return JsonResult.success(goodsService.findGoodsDetails(id)); |
| | | } |
| | | |
| | | @ApiOperation("积分商城下单") |
| | | @PostMapping(value = "/goods/order/add") |
| | | public Result<String> addOrder(@RequestBody AddGoodsOrderDto addGoodsOrderDto, HttpServletRequest request) { |
| | | String userId = getUserId(request); |
| | | addGoodsOrderDto.setUserId(userId); |
| | | |
| | | orderService.addOrder(addGoodsOrderDto); |
| | | |
| | | Result<String> result = Result.success(); |
| | | result.setMsg("下单成功"); |
| | | return result; |
| | | } |
| | | |
| | | } |