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

import cn.hutool.core.util.ObjectUtil;
import com.bonus.canteen.core.android.dto.AppDTO;
import com.bonus.canteen.core.android.service.FaceService;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.web.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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.RestController;

@Api(tags = "android-双屏消费机-人脸特征值")
@RestController
@RequestMapping("/api/android/face")
public class FaceController {
    @Autowired
    private FaceService faceService;

    @ApiOperation("获取人脸特征值")
    @RequestMapping("/getFaceFeatureList")
    public AjaxResult getFaceFeatureList(@RequestBody AppDTO dto) {
        try {
            return faceService.getFaceFeatureList(dto);
        }catch (ServiceException e){
            return AjaxResult.error("获取人脸特征值失败！");
        }
    }
}
