package com.tuoheng.admin.controller.callback;

import com.tuoheng.admin.entity.FlightData;
import com.tuoheng.admin.service.flightdata.IFlightDataService;
import com.tuoheng.common.core.common.OperationEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 云盒遥测数据表 前端控制器
 * </p>
 *
 * @author 拓恒
 * @since 2021-09-18
 */
@Slf4j
@RestController
@RequestMapping("/cloudbox/callback")
public class CloudBoxCallbackoxController {

    @Autowired
    private IFlightDataService flightDataService;

    /**
     * 飞行遥测数据入库
     *
     * @param entity
     * @return
     */
    @PostMapping("/add")
    public OperationEnum addCallback(@RequestBody FlightData entity) {
        log.info("云盒遥测回调接口");
        flightDataService.addCallback(entity);
        return OperationEnum.OPERATION_SUCCESS;
    }

}
