package com.zjrs.zwnw.dbgl.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.mohrss.leaf.core.framework.persistens.PageResult;
import org.mohrss.leaf.core.framework.web.controller.AjaxResponse;
import com.zjrs.zwnw.dbgl.bpo.XbbmglBPO;
import com.zjrs.zwnw.dbgl.dto.DbrwglDbrwQueryDTO;
import com.zjrs.zwnw.portal.bpo.CommonBPO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import jakarta.annotation.Resource;
import jakarta.validation.Valid;

@Api("协办部门管理")
@RestController
@RequestMapping("/api/dbrwgl/xbbmgl")
public class XbbmglController {

    private static final Logger logger = LoggerFactory.getLogger(XbbmglController.class);

    @Resource
    private XbbmglBPO xbbmglBPO;
    @Resource
    private CommonBPO commBPO;

    @ApiOperation(value = "督办协办部门管理列表", notes = "督办协办部门管理列表")
    @PostMapping(value = "/getXbbmglList")
    public AjaxResponse getDbrwgzList(@RequestBody @Valid DbrwglDbrwQueryDTO dto){
        AjaxResponse ajaxResponse = new AjaxResponse();
        Integer pagenum = Math.toIntExact(dto.getPagenum());
        Integer pagesize = Math.toIntExact(dto.getPagesize());
        PageResult pageResult = xbbmglBPO.getDbrwList(dto, pagenum, pagesize);
        ajaxResponse.setData("data", pageResult);
        ajaxResponse.setData("pagesize", pagesize);
        ajaxResponse.setData("pagenum", pagenum);
        return ajaxResponse;
    }

}
