package com.tuoheng.admin.service.warning;

import com.tuoheng.admin.entity.domain.Warning;
import com.tuoheng.admin.entity.query.WarningQuery;
import com.tuoheng.admin.entity.request.warning.QueryWarningListRequest;
import com.tuoheng.admin.entity.request.warning.WarningConfirmRequest;
import com.tuoheng.admin.mapper.WarningMapper;
import com.tuoheng.admin.service.warning.confirm.WarningConfirmService;
import com.tuoheng.admin.service.warning.details.WarningDetailsService;
import com.tuoheng.admin.service.warning.edit.WarningStatusService;
import com.tuoheng.admin.service.warning.ignore.WarningIgnoreService;
import com.tuoheng.admin.service.warning.notice.WarningNoticeService;
import com.tuoheng.admin.service.warning.query.QueryWarningByIdService;
import com.tuoheng.admin.service.warning.query.QueryWarningListService;
import com.tuoheng.admin.service.warning.query.QueryWarningPageListService;
import com.tuoheng.common.common.BaseServiceImpl;
import com.tuoheng.common.utils.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 预警Service业务层处理
 *
 * @author wanjing
 * @team tuoheng
 * @date 2023-02-06
 */
@Service
@Slf4j
public class WarningServiceImpl extends BaseServiceImpl<WarningMapper, Warning> implements IWarningService {

    @Autowired
    private QueryWarningListService queryWarningListService;

    @Autowired
    private QueryWarningByIdService queryWarningByIdService;

    @Autowired
    private QueryWarningPageListService queryWarningPageListService;

    @Autowired
    private WarningConfirmService warningConfirmService;

    @Autowired
    private WarningIgnoreService warningIgnoreService;

    @Autowired
    private WarningDetailsService warningDetailsService;

    @Autowired
    private WarningNoticeService warningNoticeService;

    @Autowired
    private WarningStatusService warningStatusService;



    /**
     * 查询预警列表
     *
     * @param request 预警
     * @return 预警
     */
    @Override
    public JsonResult getList(QueryWarningListRequest request) {
        return queryWarningListService.getList(request);
    }

    /**
     * 查询预警
     *
     * @param id 预警主键
     * @return 预警
     */
    @Override
    public JsonResult getOneById(Integer id) {
        return queryWarningByIdService.getOneById(id);
    }

    @Override
    public JsonResult index(WarningQuery query) {
        return queryWarningPageListService.index(query);
    }

    @Override
    public JsonResult confirm(WarningConfirmRequest request) {
        return warningConfirmService.confirm(request);
    }

    @Override
    public JsonResult ignore(Integer id) {
        return warningIgnoreService.ignore(id);
    }

    @Override
    public JsonResult details(Integer id) {
        return warningDetailsService.details(id);
    }

    @Override
    public JsonResult notice() {
        return warningNoticeService.notice();
    }

    @Override
    public JsonResult editStatusById(Integer id) {
        return warningStatusService.editStatusById(id);
    }


}
