package com.xunmei.system.api;

import com.xunmei.common.core.constant.SecurityConstants;
import com.xunmei.common.core.constant.ServiceNameConstants;
import com.xunmei.common.core.domain.R;
import com.xunmei.system.api.domain.SysConfig;
import com.xunmei.system.api.factory.RemoteConfigFallbackFactory;
import com.xunmei.system.api.factory.RemoteLogFallbackFactory;
import com.xunmei.system.api.factory.RemoteUserFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(contextId = "remoteConfigService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteConfigFallbackFactory.class)
public interface RemoteConfigService {
    @GetMapping("/config/findFirstByCode")
    R<SysConfig> findFirstByCode(@RequestParam("code") String code, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
