package com.bonus.canteen.core.user.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

import cn.hutool.core.util.ObjectUtil;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.houqin.constant.RetCodeEnum;
import com.bonus.common.houqin.encrypt.RequiresGuest;
import com.bonus.common.houqin.i18n.I18n;
import com.bonus.common.log.enums.OperaType;
import com.bonus.system.api.domain.SysUser;
import com.bonus.system.api.domain.SysUserFace;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.bonus.common.log.annotation.SysLog;
import com.bonus.canteen.core.user.domain.UserFace;
import com.bonus.canteen.core.user.service.IUserFaceService;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.utils.poi.ExcelUtil;
import com.bonus.common.core.web.page.TableDataInfo;

/**
 * 人员生物识别特征Controller
 *
 * @author xsheng
 * @date 2025-04-03
 */
@Api(tags = "人员生物识别特征接口")
@RestController
@RequestMapping("/userFace")
public class UserFaceController extends BaseController {
    @Autowired
    private IUserFaceService UserFaceService;

    @ApiOperation("保存人脸图片")
    @PostMapping({"/uploadUserFace"})
    @RequiresGuest
    public AjaxResult uploadUserFace(@RequestBody @Valid SysUserFace sysUserFace) {
        UserFace dto = new UserFace();
        dto.setUserId(sysUserFace.getUserId());
        dto.setPhotoUrl(sysUserFace.getPhotoUrl());
        return UserFaceService.uploadUserFace(dto);
    }

}
