rk
9 小时以前 580f4d3c2ca9eee53eee95a4de2f6610b790780a
server/dmmall_web/src/main/java/com/doumee/api/web/mall/GoodsApi.java
@@ -6,6 +6,8 @@
import com.doumee.core.annotation.trace.Trace;
import com.doumee.core.model.ApiResponse;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
import com.doumee.dao.business.model.SearchHistory;
import com.doumee.dao.web.request.goods.GoodsRequest;
import com.doumee.dao.web.response.goods.GoodsInfoResponse;
import io.swagger.annotations.Api;
@@ -14,6 +16,8 @@
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * Created by IntelliJ IDEA.
@@ -42,11 +46,11 @@
    @ApiOperation("商品详情")
    @GetMapping("/goodsInfo")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true),
            @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "goodsId", value = "商品主键", required = true),
            @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "memberId", value = "用户主键", required = true),
    })
    public ApiResponse<GoodsInfoResponse> goodsInfo(@RequestParam Integer goodsId) {
        GoodsInfoResponse goodsInfoResponse = goodsService.getGoodsInfo(goodsId);
    public ApiResponse<GoodsInfoResponse> goodsInfo(@RequestParam Integer goodsId,Integer memberId) {
        GoodsInfoResponse goodsInfoResponse = goodsService.getGoodsInfo(goodsId,memberId);
        return ApiResponse.success("查询成功",goodsInfoResponse);
    }
@@ -62,4 +66,28 @@
        return ApiResponse.success("生成成功",path);
    }
    @LoginRequired
    @ApiOperation("商品搜索历史")
    @GetMapping("/searchHistoryList")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true),
    })
    public ApiResponse<List<SearchHistory>> searchHistoryList(@RequestParam Integer type) {
        return ApiResponse.success(searchHistoryService.findListByType(Constants.ZERO,getMemberId()));
    }
    @LoginRequired
    @ApiOperation("清空搜索历史")
    @GetMapping("/cleanSearchHistory")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true),
    })
    public ApiResponse cleanSearchHistory(@RequestParam Integer type) {
        searchHistoryService.cleanHistory(Constants.ZERO,getMemberId());
        return ApiResponse.success("操作成功");
    }
}