package com.sv.api.controller;

import com.sv.entity.MemberFaceInfo;
import com.sv.service.api.MemberFaceInfoService;
import com.ydd.framework.core.common.dto.ResponseDTO;
import com.ydd.framework.core.controller.BaseApiController;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Controller - 用户人脸识别表
 *
 * @author lihong
 * @since 2018-08-11
 */
@RestController
public class MemberFaceInfoController extends BaseApiController {

	private final Logger logger = LoggerFactory.getLogger(MemberFaceInfoController.class);
	
	@Resource
	private MemberFaceInfoService memberFaceInfoService;

    /**
     * 人脸采集信息
     */
    @RequestMapping(value = "/member/face/info/infos", method = RequestMethod.POST)
    public ResponseDTO information(){
        MemberFaceInfo info = memberFaceInfoService.findByMember(getMemberIdByAccessToken());
        if (info == null){
            info = new MemberFaceInfo();
        }
        return ResponseDTO.ok().addAttribute("info",info);
    }
}
