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

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.basic.api.redis.dto.BusinessInfoDTO;
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;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.security.PermitAll;

@FeignClient(name = ApiConstants.NAME) // TODO 芋艿：fallbackFactory =
@Api(tags = "RPC 服务 - 商户")
public interface BusinessInfoApi {

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

    @GetMapping(PREFIX + "/getBusinessInfoById")
    @ApiOperation("根据商户主键ID获取商户信息")
    @ApiImplicitParam(name = "id", value = "商户ID", required = true, example = "1024", dataTypeClass = Long.class)
    CommonResult<BusinessInfoDTO> getBusinessInfoById(@RequestParam("id") Long id);

    @GetMapping(PREFIX + "/getBusinessInfoByBusinessId")
    @ApiOperation("根据商户编码获取商户信息")
    @ApiImplicitParam(name = "businessId", value = "商户编码", required = true, example = "1024", dataTypeClass = Long.class)
    CommonResult<BusinessInfoDTO> getBusinessInfoByBusinessId(@RequestParam("businessId") String businessId);

    @GetMapping(PREFIX + "/getBusinessInfoByIdWithOutTenantId")
    @PermitAll
    @ApiOperation("根据商户主键ID获取商户信息")
    @ApiImplicitParam(name = "id", value = "商户ID", required = true, example = "1024", dataTypeClass = Long.class)
    CommonResult<BusinessInfoDTO> getBusinessInfoByIdWithOutTenantId(@RequestParam("id") Long id);

}
