package com.zhongshu.card.server.core.controller.openAPI.face;

import com.github.microservice.net.ResultContent;
import com.github.microservice.staticVariable.OpenApiMark;
import com.zhongshu.card.client.openApi.model.face.OrgUserFaceOpenApiParam;
import com.zhongshu.card.client.openApi.model.face.OrgUserFaceOpenModel;
import com.zhongshu.card.client.openApi.model.face.UpdateFaceFileIdParam;
import com.zhongshu.card.client.openApi.params.UserOpenApiParam;
import com.zhongshu.card.server.core.service.openAPI.face.OrgUserFaceOpenService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
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.RestController;

import java.util.List;

/**
 * @author TRX
 * @date 2024/6/5
 */
@RestController
@RequestMapping("/" + OpenApiMark.fullCardOpenAPI + "/v1/face")
@Tag(name = "openAPI-人脸管理")
public class UserFaceOpenApiController {

    @Autowired
    private OrgUserFaceOpenService orgUserFaceOpenService;

    @Operation(summary = "增加人脸", description = "增加人脸")
    @RequestMapping(value = {"saveFace"}, method = {RequestMethod.POST})
    public ResultContent saveFace(@RequestBody OrgUserFaceOpenApiParam param) {
        return orgUserFaceOpenService.saveFace(param);
    }

    @Operation(summary = "用户人脸信息列表", description = "用户人脸信息列表")
    @RequestMapping(value = {"faceListQuery"}, method = {RequestMethod.POST})
    public ResultContent<List<OrgUserFaceOpenModel>> faceListQuery(@RequestBody UserOpenApiParam param) {
        return orgUserFaceOpenService.faceListQuery(param);
    }

    @Operation(summary = "人脸信息详情", description = "人脸信息详情")
    @RequestMapping(value = {"detailByFaceId"}, method = {RequestMethod.POST})
    public ResultContent<OrgUserFaceOpenModel> detailByFaceId(@RequestBody UpdateFaceFileIdParam param) {
        return orgUserFaceOpenService.detailByFaceId(param);
    }

    @Operation(summary = "删除人脸信息", description = "删除人脸信息详")
    @RequestMapping(value = {"deleteByFaceId"}, method = {RequestMethod.POST})
    public ResultContent<OrgUserFaceOpenModel> deleteByFaceId(@RequestBody UpdateFaceFileIdParam param) {
        return orgUserFaceOpenService.deleteByFaceId(param);
    }

}
