package com.yzt.airconditionersystem.controller;

import com.yzt.airconditionersystem.bean.Device;
import com.yzt.airconditionersystem.result.Result;
import com.yzt.airconditionersystem.service.DeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 空调信息
 * @author TzZach
 * @since 2022-05-20 17:13
 */
@Controller
public class DeviceController {

    @Autowired
    private DeviceService deviceService;

    @GetMapping("/device/detail")
    @ResponseBody
    public Result deviceDetail(@RequestParam("id") String id) {
        Device device = deviceService.getById(id);
        return Result.success(device);
    }

}
