|  |  |  | 
|---|
|  |  |  | package cc.mrbird.febs.mall.controller; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import cc.mrbird.febs.common.entity.FebsResponse; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.dto.MallGoodsQueryDto; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.service.IApiMallGoodsService; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.vo.MallGoodsDetailsVo; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.vo.MallGoodsListVo; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import io.swagger.annotations.ApiResponse; | 
|---|
|  |  |  | import io.swagger.annotations.ApiResponses; | 
|---|
|  |  |  | import lombok.RequiredArgsConstructor; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RestController; | 
|---|
|  |  |  | import org.springframework.validation.annotation.Validated; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author wzy | 
|---|
|  |  |  | * @date 2021-09-17 | 
|---|
|  |  |  | **/ | 
|---|
|  |  |  | @Slf4j | 
|---|
|  |  |  | @Validated | 
|---|
|  |  |  | @RestController | 
|---|
|  |  |  | @RequiredArgsConstructor | 
|---|
|  |  |  | @RequestMapping(value = "/api/goods") | 
|---|
|  |  |  | @Api(value = "ApiMallGoodsController", tags = "商城商品接口类") | 
|---|
|  |  |  | public class ApiMallGoodsController { | 
|---|
|  |  |  | private final IApiMallGoodsService mallGoodsService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "获取商城商品列表", notes = "获取商城商品列表") | 
|---|
|  |  |  | @ApiResponses({ | 
|---|
|  |  |  | @ApiResponse(code = 200, message = "success", response = MallGoodsListVo.class) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @PostMapping(value = "/findMallGoodsList") | 
|---|
|  |  |  | public FebsResponse findMallGoodsList(@RequestBody MallGoodsQueryDto queryDto) { | 
|---|
|  |  |  | return new FebsResponse().success().data(mallGoodsService.findMallGoodsListInPage(queryDto)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "获取商品详情", notes = "获取商品详情") | 
|---|
|  |  |  | @ApiResponses({ | 
|---|
|  |  |  | @ApiResponse(code = 200, message = "success", response = MallGoodsDetailsVo.class) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @GetMapping(value = "/findMallGoodsDetailsById/{id}") | 
|---|
|  |  |  | public FebsResponse findMallGoodsDetailsById(@PathVariable("id") Long id) { | 
|---|
|  |  |  | return new FebsResponse().success().data(mallGoodsService.findMallGoodsDetailsById(id)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|