package com.yida.data.system.feign;

import com.yida.data.common.core.common.ResultBean;
import com.yida.data.common.core.entity.constant.FebsServerConstant;
import com.yida.data.common.core.entity.system.EduApp;
import com.yida.data.common.core.entity.system.EduAppTemplate;
import com.yida.data.common.core.entity.system.EduQywxServiceProvider;
import com.yida.data.system.fallback.RemoteAppServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = FebsServerConstant.FEBS_SERVER_SYSTEM, contextId = "appServiceClient",
        fallbackFactory = RemoteAppServiceFallback.class)
public interface RemoteAppService {

    @GetMapping("/in/app/getAppBySchoolOrCorpIdAndCode")
    ResultBean<EduApp> getAppBySchoolOrCorpIdAndCode(@RequestParam("schoolId") Long schoolId,
                                                     @RequestParam("corpId") String corpId,
                                                     @RequestParam("code") String code);

    @GetMapping("/in/app/getAppTemplateByTemplateId")
    ResultBean<EduAppTemplate> getAppTemplateByTemplateId(@RequestParam("templateId") String templateId,
                                                          @RequestParam("serviceCorpId") String serviceCorpId);

    @GetMapping("/in/app/getServiceProviderByServiceCorpId")
    ResultBean<EduQywxServiceProvider> getServiceProviderByServiceCorpId(@RequestParam("serviceCorpId") String serviceCorpId);
}
