Newer
Older
gas_receiver_zq / src / main / java / com / casic / controller / DeviceController.java
chaizhuang on 26 Sep 2022 952 bytes 章丘数据第一次接入
package com.casic.controller;

import com.casic.model.*;
import com.casic.service.DeviceService;
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;


@RestController
@RequestMapping("/device")
public class DeviceController {


    private final DeviceService deviceService;

    public DeviceController(DeviceService deviceService) {
        this.deviceService = deviceService;
    }

    @RequestMapping("/helloWord")
    public ResponseData helloWord() {
        return deviceService.testMysql();
    }

    @PostMapping("/online")
    public ResponseData DeviceOnline(@RequestBody DeviceOnlineParam onlineParam) {
        return deviceService.onlineStatusByImei(onlineParam.getEventType(),onlineParam.getImei());
    }

}