package com.github.microservice.auth.client.service;

import com.github.microservice.auth.client.content.ResultContent;
import com.github.microservice.auth.client.model.UserFaceQueryModel;
import com.github.microservice.auth.client.model.UserFaceUploadModel;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@FeignClient(name = "authserver/manager/userFace")
public interface UserFaceService {

    @Operation(summary = "上传用户人脸图片", description = "上传用户人脸图片，用于人脸新增或替换")
    @RequestMapping(value = "upload", method = RequestMethod.POST)
    ResultContent<String> upload(@RequestBody @Valid UserFaceUploadModel userFaceUploadModel);

    @Operation(summary = "删除用户人脸图片", description = "删除指定用户人脸图片")
    @RequestMapping(value = "delete", method = RequestMethod.POST)
    ResultContent delete(@RequestParam("userId") String userId, @RequestParam("faceFileId") String faceFileId);

    @Operation(summary = "查询用户人脸图片", description = "查询用户人脸图片")
    @RequestMapping(value = "get", method = RequestMethod.GET)
    ResultContent<List<UserFaceQueryModel>> get(@RequestParam("userId") String userId);

    @Operation(summary = "比对人脸图片", description = "比对人脸图片")
    @RequestMapping(value = "matches", method = RequestMethod.POST)
    ResultContent<Object> matches(@RequestParam("file") MultipartFile file);
}
