package com.goldenwater.web.controller.hzz;

import com.goldenwater.common.core.controller.BaseController;
import com.goldenwater.common.core.page.TableDataInfo;
import com.goldenwater.hzz.domain.EventDTO;
import com.goldenwater.hzz.service.EventClearService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/hzz/eventclear")
public class EventClearController extends BaseController {
    @Autowired
    private EventClearService service;

    @GetMapping("/list")
    public TableDataInfo list(@RequestParam(required = false) String adCode, @RequestParam(required = false) String evType, @RequestParam(required = false) String keyWord, @RequestParam(required = false) String objectType, @RequestParam(defaultValue = "1") int pageNum, @RequestParam(defaultValue = "10") int pageSize) {
        return getDataTable(service.findListByAdCode(adCode, evType, keyWord, objectType, pageNum, pageSize));
    }

    @PostMapping("/search")
    public TableDataInfo search(@RequestBody EventDTO params, @RequestParam(defaultValue = "1") int pageNum, @RequestParam(defaultValue = "10") int pageSize) {
        return getDataTable(service.findList(params, pageNum, pageSize));
    }
}
