package com.sptg.gateway.controller.device;


import com.sptg.common.core.beans.ResultBean;
import com.sptg.common.core.beans.ResultEnum;
import com.sptg.device.api.entity.DeviceRemoteInfo;
import com.sptg.device.api.feigns.DeviceRemoteInfoFeign;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
@AllArgsConstructor
public class DeviceRemoteInfoController {

    private final DeviceRemoteInfoFeign deviceRemoteInfoFeign;

    @GetMapping(value = "/deviceRemoteInfo/getEntityBySerialNumber/{serialNumber}")
    public ResultBean<DeviceRemoteInfo> getEntityBySerialNumber(@PathVariable(value = "serialNumber") String serialNumber){
        return new ResultBean<>(ResultEnum.SUCCESS,this.deviceRemoteInfoFeign.getBySerialNumber(serialNumber));
    }
}
