package com.xunmei.core.access.controller;

import com.xunmei.common.core.web.page.TableDataInfo;
import com.xunmei.core.access.domain.CoreMonitoringTaskMonitorInfo;
import com.xunmei.core.access.dto.CoreMonitoringTaskRegistrationMonitorDTO;
import com.xunmei.core.access.service.ICoreMonitoringTaskMonitorInfoService;
import com.xunmei.core.access.service.ICoreMonitoringTaskRegistrationMonitorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.xunmei.common.log.annotation.Log;
import com.xunmei.common.log.enums.BusinessType;
import com.xunmei.common.security.annotation.RequiresPermissions;
import com.xunmei.common.core.web.controller.BaseController;
import com.xunmei.common.core.web.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;


/**
 * 调阅任务登记检查情况Controller
 *
 * @author xunmei
 * @date 2023-08-29
 */
@Api(tags = {"CoreMonitoringTaskMonitorInfo"})
@RestController
@RequestMapping("/info")
public class CoreMonitoringTaskMonitorInfoController extends BaseController {
    @Autowired
    private ICoreMonitoringTaskMonitorInfoService coreMonitoringTaskMonitorInfoService;
    @Autowired
    private ICoreMonitoringTaskRegistrationMonitorService coreMonitoringTaskRegistrationMonitorService;

/*    *//**
     * 查询调阅任务登记检查情况列表
     *//*
    @ApiOperation(value = "查询CoreMonitoringTaskMonitorInfo列表")
    @RequiresPermissions("system:info:list")
    @GetMapping("/list")
    public TableDataInfo<CoreMonitoringTaskMonitorInfo> list(CoreMonitoringTaskMonitorInfo coreMonitoringTaskMonitorInfo) {
        return null;
    }*/


    /**
     * 获取调阅任务登记检查情况详细信息
     */
    @ApiOperation(value = "获取CoreMonitoringTaskMonitorInfo详细信息")
    @RequiresPermissions("system:info:query")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        //传入监控id，因为一个监控对应一个项目
        return success(coreMonitoringTaskRegistrationMonitorService.selectMonitorById(id));
    }

    /**
     * 新增调阅任务登记检查情况
     */
    @ApiOperation(value = "新增CoreMonitoringTaskMonitorInfo")
    @RequiresPermissions("system:info:add")
    @Log(title = "调阅任务登记检查情况", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody CoreMonitoringTaskRegistrationMonitorDTO coreMonitoringTaskRegistrationMonitorDTO) {
        return toAjax(coreMonitoringTaskMonitorInfoService.insertCoreMonitoringTaskMonitorInfo(coreMonitoringTaskRegistrationMonitorDTO));
    }

    /**
     * 修改调阅任务登记检查情况
     */
    @ApiOperation(value = "修改CoreMonitoringTaskMonitorInfo")
    @RequiresPermissions("system:info:edit")
    @Log(title = "调阅任务登记检查情况", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody CoreMonitoringTaskRegistrationMonitorDTO coreMonitoringTaskMonitorInfo) {
        return toAjax(coreMonitoringTaskMonitorInfoService.updateCoreMonitoringTaskMonitorInfo(coreMonitoringTaskMonitorInfo));
    }

/*    *//**
     * 删除调阅任务登记检查情况
     *//*
    @ApiOperation(value = "删除CoreMonitoringTaskMonitorInfo")
    @RequiresPermissions("system:info:remove")
    @Log(title = "调阅任务登记检查情况", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(coreMonitoringTaskMonitorInfoService.deleteCoreMonitoringTaskMonitorInfoByIds(ids));
    }*/
}
