package com.sptg.device.biz.controller;

import com.sptg.common.core.beans.ResultBean;
import com.sptg.device.api.entity.Device;
import com.sptg.device.api.entity.MqConf;
import com.sptg.device.api.feigns.DeviceRegisterFeign;
import com.sptg.device.biz.service.DeviceRegisterServiceInterface;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * title: DeviceRegisterController
 * package: com.sptg.device.biz.controller
 * description:
 *
 *
 */
@RestController
@RequiredArgsConstructor
public class DeviceRegisterController implements DeviceRegisterFeign {

    private final DeviceRegisterServiceInterface deviceRegisterServiceInterface;

    @Override
    @PostMapping(value = "/device/register/getConnection")
    public ResultBean<Device> getConnection(@RequestBody Device device) {
        return this.deviceRegisterServiceInterface.getConnection(device);
    }

    @Override
    @PostMapping(value = "/device/dh/register/getConnection")
    public ResultBean<MqConf> getDHConnection() {
        return this.deviceRegisterServiceInterface.getDHConnection();
    }
}
