package com.zd.laboratory.controller;

import com.zd.common.core.domain.R;
import com.zd.common.core.web.controller.BaseController;
import com.zd.laboratory.domain.LabCheckMachineMsg;
import com.zd.laboratory.domain.vo.LabCheckMachineMsgVo;
import com.zd.laboratory.service.ILabCheckMachineMsgService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 一体机安全检查通知消息Controller
 *
 * @author liubo
 * @date 2022-01-04
 */
@RestController
@Api(tags = "【一体机安全检查通知消息】")
@RequestMapping("/checkMachineMsg")
public class LabCheckMachineMsgController extends BaseController {
    @Autowired
    private ILabCheckMachineMsgService labCheckMachineMsgService;

    /**
     * 查询一体机安全检查通知消息列表
     * @return
     */
    @GetMapping("/list")
    @ApiOperation(value = "查询一体机安全检查通知消息列表")
    public R<List<LabCheckMachineMsgVo>> list(LabCheckMachineMsg labCheckMachineMsg) {
        // 2.6 弃用
        //List<LabCheckMachineMsg> list = labCheckMachineMsgService.selectLabCheckMachineMsgList(labCheckMachineMsg);

        List<LabCheckMachineMsgVo> list = labCheckMachineMsgService.selectCheckMsg(labCheckMachineMsg);
        return R.ok(list);
    }

    /**
     * 获取一体机安全检查通知消息详细信息
     * 实际未使用
     */
    @ApiOperation(value = "获取一体机安全检查通知消息详细信息")
    @GetMapping(value = "/{id}")
    public R<LabCheckMachineMsg> getInfo(@PathVariable("id") Long id) {
        return R.ok(labCheckMachineMsgService.selectLabCheckMachineMsgById(id));
    }

}
