package cn.iocoder.yudao.module.basic.api.redis;


import cn.iocoder.yudao.module.basic.api.redis.dto.BusinessInfoDTO;
import cn.iocoder.yudao.module.basic.api.redis.dto.DealerInfoDTO;
import cn.iocoder.yudao.module.basic.api.redis.dto.GoodsInfoDTO;
import cn.iocoder.yudao.module.basic.api.vendorinfo.dto.VendorInfoRespDTO;
import cn.iocoder.yudao.module.basic.enums.ApiConstants;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;


@FeignClient(name = ApiConstants.NAME) // TODO 芋艿：fallbackFactory =
@Api(tags = "RPC 服务 - redis接口")
public interface RedisBasicInfoUtilApi {

    String PREFIX = ApiConstants.PREFIX + "/redis-info";

    /*-------------商户信息Redis缓存方法-------------*/
    @GetMapping(PREFIX + "/validateBusinessInfoRedisExists")
    @ApiOperation("根据商户ID，判断缓存中商户信息是否存在")
    @ApiImplicitParam(name = "bid", value = "商户ID", required = true, example = "1024", dataTypeClass = Long.class)
    boolean validateBusinessInfoRedisExists(Long bid);

    @GetMapping(PREFIX + "/getBusinessInfoRedis")
    @ApiOperation("根据商户ID,从缓存获取商户信息")
    @ApiImplicitParam(name = "id", value = "商户ID", required = true, example = "1024", dataTypeClass = Long.class)
    BusinessInfoDTO getBusinessInfoRedis(Long id);

    @GetMapping(PREFIX + "/updateBusinessInfoRedis")
    @ApiOperation("根据商户ID,更新缓存中商户信息")
    @ApiImplicitParam(name = "id", value = "商户ID", required = true, example = "1024", dataTypeClass = Long.class)
    void updateBusinessInfoRedis(Long id,BusinessInfoDTO businessInfoDO);

    @GetMapping(PREFIX + "/delBusinessInfoRedis")
    @ApiOperation("根据商户ID,从缓存删除商户信息")
    @ApiImplicitParam(name = "id", value = "商户ID", required = true, example = "1024", dataTypeClass = Long.class)
    void delBusinessInfoRedis(Long id);

    /*-------------供应商信息Redis缓存方法-------------*/
    @GetMapping(PREFIX + "/validateVendorInfoRedisExists")
    @ApiOperation("根据供应商ID，判断缓存中供应商信息是否存在")
    @ApiImplicitParam(name = "id", value = "供应商ID", required = true, example = "1024", dataTypeClass = Long.class)
    boolean validateVendorInfoRedisExists(Long id);

    @GetMapping(PREFIX + "/getVendorInfoRedis")
    @ApiOperation("根据供应商ID，从缓存获取供应商信息")
    @ApiImplicitParam(name = "id", value = "供应商ID", required = true, example = "1024", dataTypeClass = Long.class)
    VendorInfoRespDTO getVendorInfoRedis(Long id);

    @GetMapping(PREFIX + "/updateVendorInfoRedis")
    @ApiOperation("根据供应商ID，更新缓存中供应商信息")
    @ApiImplicitParam(name = "vid", value = "供应商ID", required = true, example = "1024", dataTypeClass = Long.class)
    void updateVendorInfoRedis(Long vid, VendorInfoRespDTO vendorInfoRespDTO);

    @GetMapping(PREFIX + "/delVendorInfoRedis")
    @ApiOperation("根据供应商ID，从缓存删除供应商信息")
    @ApiImplicitParam(name = "id", value = "供应商ID", required = true, example = "1024", dataTypeClass = Long.class)
    void delVendorInfoRedis(Long id);

    /*-------------经销商信息Redis缓存方法-------------*/
    @GetMapping(PREFIX + "/validateDealerInfoRedisExists")
    @ApiOperation("根据经销商ID，判断缓存中经销商信息是否存在")
    @ApiImplicitParam(name = "id", value = "经销商ID", required = true, example = "1024", dataTypeClass = Long.class)
    boolean validateDealerInfoRedisExists(Long id);

    @GetMapping(PREFIX + "/getDealerInfoRedis")
    @ApiOperation("根据经销商ID，从缓存获取经销商信息")
    @ApiImplicitParam(name = "id", value = "经销商ID", required = true, example = "1024", dataTypeClass = Long.class)
    DealerInfoDTO getDealerInfoRedis(Long id);

    @GetMapping(PREFIX + "/updateDealerInfoRedis")
    @ApiOperation("根据经销商ID，更新缓存中经销商信息")
    @ApiImplicitParam(name = "did", value = "经销商ID", required = true, example = "1024", dataTypeClass = Long.class)
    void updateDealerInfoRedis(Long did, DealerInfoDTO dealerInfoDTO);

    @GetMapping(PREFIX + "/delDealerInfoRedis")
    @ApiOperation("根据经销商ID，从缓存删除经销商信息")
    @ApiImplicitParam(name = "id", value = "经销商ID", required = true, example = "1024", dataTypeClass = Long.class)
    void delDealerInfoRedis(Long id);

    /*-------------商品信息Redis缓存方法-------------*/
    @GetMapping(PREFIX + "/validateGoodsInfoRedisExists")
    @ApiOperation("根据商品ID，判断缓存中商品信息是否存在")
    @ApiImplicitParam(name = "id", value = "商品ID", required = true, example = "1024", dataTypeClass = Long.class)
    boolean validateGoodsInfoRedisExists(Long id);

    @GetMapping(PREFIX + "/getGoodsInfoRedis")
    @ApiOperation("根据商品ID，从缓存获取商品信息")
    @ApiImplicitParam(name = "id", value = "商品ID", required = true, example = "1024", dataTypeClass = Long.class)
    GoodsInfoDTO getGoodsInfoRedis(Long id);

    @GetMapping(PREFIX + "/updateGoodsInfoRedis")
    @ApiOperation("根据商品ID，更新缓存中商品信息")
    @ApiImplicitParam(name = "gid", value = "商品ID", required = true, example = "1024", dataTypeClass = Long.class)
    void updateGoodsInfoRedis(Long gid, GoodsInfoDTO goodsInfoDTO);

    @GetMapping(PREFIX + "/delGoodsInfoRedis")
    @ApiOperation("根据商品ID，从缓存删除商品信息")
    @ApiImplicitParam(name = "id", value = "商品ID", required = true, example = "1024", dataTypeClass = Long.class)
    void delGoodsInfoRedis(Long id);

}
