Newer
Older
smartwell_demos / src / main / java / com / casic / controller / ThirdDataController.java
chaizhuang on 29 Aug 2023 967 bytes 中石化thingsboard,联调bug
package com.casic.controller;

import com.alibaba.fastjson.JSON;
import com.casic.service.ThirdDataService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/push")
@Slf4j
public class ThirdDataController {

    private final ThirdDataService thirdDataService;

    public ThirdDataController(ThirdDataService thirdDataService) {
        this.thirdDataService = thirdDataService;
    }

    /**
     * 硫化氢订阅接口
     *
     * @param h2sDataMap
     * @return
     */
    @RequestMapping("/h2s-data")
    public Object h2sData(@RequestBody Map<String, String> h2sDataMap) {
        System.out.println(JSON.toJSON(h2sDataMap));
        return thirdDataService.h2sData(h2sDataMap);
    }



}