package com.glxp.api.controller.system; import cn.hutool.core.bean.BeanUtil; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.github.pagehelper.PageInfo; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.entity.system.SysMsgTodoEntity; import com.glxp.api.req.system.SysMsgTodoQuery; import com.glxp.api.res.PageSimpleResponse; import com.glxp.api.service.system.SysMsgTodoService; import com.glxp.api.vo.system.SysMsgTodoVo; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import java.util.List; @RestController @RequiredArgsConstructor public class SysMsgTodoController { private final SysMsgTodoService sysMsgTodoService; @PostMapping("/spms/sysMsgTodo/page") public BaseResponse page(@RequestBody SysMsgTodoQuery query) { List msgTodoVos = sysMsgTodoService.pageOfVo(query); PageInfo page = new PageInfo<>(msgTodoVos); PageSimpleResponse simpleResponse = new PageSimpleResponse<>(); simpleResponse.setTotal(page.getTotal()); simpleResponse.setList(BeanUtil.copyToList(msgTodoVos, SysMsgTodoVo.class)); return ResultVOUtils.success(simpleResponse); } }