package com.sv.netty.controller;

import com.sv.entity.face.FaceRecognizeResponse;
import com.sv.netty.netty.MemberDto;
import com.sv.netty.netty.ResponseDTO;
import com.sv.netty.service.MessageService;
import com.sv.netty.service.impl.TcpMessageHandlerAdapter;
import com.sv.service.oms.DeviceService;
import com.sv.service.oms.VenueService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class MessageControler {

    @Resource()
    private TcpMessageHandlerAdapter messageService;

    @Resource
    private DeviceService deviceService;

    @Resource
    private VenueService venueService;

    @RequestMapping("/message/send/t")
    public ResponseDTO sendMessage1() {
        FaceRecognizeResponse recognizeResponse = new FaceRecognizeResponse();
        recognizeResponse.setPerson(new FaceRecognizeResponse.PersonBeanX());
        recognizeResponse.getPerson().setId(49);
        messageService.enter(deviceService.findById(1), recognizeResponse, venueService.findById(32));
        return ResponseDTO.ok();
    }

//
//    @RequestMapping("/upload/image")
//    public ResponseDTO sendMessage(){
//        messageService.sendMessage(memberDto);
//        return ResponseDTO.ok();
//    }

}
