package com.zd.system.api.students;

import com.zd.common.core.constant.ServiceNameConstants;
import com.zd.common.core.domain.R;
import com.zd.system.api.domain.LabStudentsInfo;
import com.zd.system.api.factory.RemoteFileFallbackFactory;
import com.zd.system.api.students.factory.RemoteStudentsFallbackFactory;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * 文件服务
 *
 * @author zd
 */
@FeignClient(contextId = "remoteStudentsService", value = ServiceNameConstants.LABORATORY_SERVICE, fallbackFactory = RemoteStudentsFallbackFactory.class)
public interface RemoteStudentsService {
    /**
     * 获取学生信息
     * @param id 学生Id
     * @return 结果
     */
    @GetMapping(value = "/studentinfo/{joinStudentsId}")
    public R<LabStudentsInfo> getInfo(@PathVariable("joinStudentsId") Long id);

    /**
     * 提交学生卡
     * @param file
     * @return
     */
    @PostMapping (value = "/studentinfo/commit/crad",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public R commitCard(@RequestPart("file") MultipartFile file);
}
