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

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
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.RequestParam;

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

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

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

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

    @GetMapping(PREFIX + "/selectCount")
    @Schema(description = "获取数量")
    CommonResult<Long> selectCount();
}
