package com.zd.system.api.face;

import com.zd.common.core.constant.ServiceNameConstants;
import com.zd.common.core.domain.R;
import com.zd.system.api.face.factory.RemoteFaceFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

/**
 * 文件服务
 *
 * @author zd
 */
@FeignClient(contextId = "remoteFaceService", value = ServiceNameConstants.FACE_SERVICE, fallbackFactory = RemoteFaceFallbackFactory.class)
public interface RemoteFaceService {
    /**
     * 获取人脸特征-根据照片
     * @param file 文件信息
     * @return 结果
     */
    @PostMapping(value = "/faceApi/faceFeature", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public R<byte[]> upload(@RequestPart(value = "file") MultipartFile file);


    /**
     * 人脸特征对比
     * @param faceCompare 文件信息
     * @return 结果
     */
    @PostMapping(value = "/faceApi/compare")
    public R compare(@RequestBody FaceCompare faceCompare);
}
