package com.yida.data.user.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.user.EduStudentApply;
import com.yida.data.user.fallback.RemoteStudentApplyServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(value = FebsServerConstant.EDU_USER, contextId = "studentApplyServiceClient",
        fallbackFactory = RemoteStudentApplyServiceFallback.class)
public interface RemoteStudentApplyService {

    @GetMapping("/in/transaction/studentApply/listApply")
    ResultBean<Map<Long, List<String>>> listApplyCode(@RequestParam("studentIds") Long[] studentIds);

    @GetMapping("/transaction/studentApply/hasApply")
    ResultBean<Boolean> hasApply(@RequestParam("studentId") Long studentId,
                                 @RequestParam("applyCode") String applyCode);

    @GetMapping("/transaction/studentApply/getStudentApplyByIdAndCode")
    ResultBean<EduStudentApply> getStudentApply(@RequestParam("studentId") Long studentId,
                                                @RequestParam("applyCode") String applyCode);
}
