package cn.iocoder.yudao.module.product.api.storeproductattrvalue;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.product.api.storeproductattrvalue.dto.StoreProductAttrValueApiDTO;
import cn.iocoder.yudao.module.product.api.storeproductattrvalue.vo.StoreProductAttrValueApiVO;
import cn.iocoder.yudao.module.product.enums.ApiConstants;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = ApiConstants.NAME) // TODO 芋艿：fallbackFactory =
@Tag(name = "RPC 服务 - 商品属性值 API")
public interface StoreProductAttrValueApi {

    String PREFIX = ApiConstants.PREFIX + "/productAttrValue";

    @PostMapping(PREFIX + "/getStoreProductAttrValueList")
    @Schema(description = "获取商品属性值列表")
    CommonResult<List<StoreProductAttrValueApiVO>> getStoreProductAttrValueList(@RequestBody StoreProductAttrValueApiDTO dto);

    @GetMapping(PREFIX + "/decStockIncSales")
    @Schema(description = "普通商品 减库存 加销量")
    CommonResult<Integer> decStockIncSales(@RequestParam(name = "num") Integer num,
                                           @RequestParam(name = "productId") Long productId,
                                           @RequestParam(name = "unique") String unique);

    @GetMapping(PREFIX + "/inStockIncSales")
    @Schema(description = "普通商品 加库存 减销量")
    CommonResult<Integer> inStockIncSales(@RequestParam(name = "num") Integer num,
                                           @RequestParam(name = "productId") Long productId,
                                           @RequestParam(name = "unique") String unique);

}
