sys_msg_todo相关

dev2.0
wj 1 year ago
parent b5467f4dcf
commit e88a9046d3

@ -0,0 +1,38 @@
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.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.entity.system.SysMsgTodoEntity;
import com.glxp.api.entity.system.SysRemindMsgEntity;
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;
@RestController
@RequiredArgsConstructor
public class SysMsgTodoController {
private final SysMsgTodoService sysMsgTodoService;
@PostMapping("/spms/sysMsgTodo/page")
public BaseResponse page(@RequestBody SysMsgTodoQuery query) {
Page<SysMsgTodoEntity> page = new Page<>(query.getPage(), query.getLimit());
page = sysMsgTodoService.page(page,
Wrappers.lambdaQuery(SysMsgTodoEntity.class)
.orderByDesc(SysMsgTodoEntity::getCreateTime)
);
PageSimpleResponse<SysMsgTodoVo> simpleResponse = new PageSimpleResponse<>();
simpleResponse.setTotal(page.getTotal());
simpleResponse.setList(BeanUtil.copyToList(page.getRecords(), SysMsgTodoVo.class));
return ResultVOUtils.success(simpleResponse);
}
}

@ -0,0 +1,8 @@
package com.glxp.api.req.system;
import com.glxp.api.util.page.ListPageRequest;
import lombok.Data;
@Data
public class SysMsgTodoQuery extends ListPageRequest {
}

@ -0,0 +1,25 @@
package com.glxp.api.vo.system;
import com.glxp.api.entity.system.SysMsgTodoEntity;
import lombok.Data;
@Data
public class SysMsgTodoVo extends SysMsgTodoEntity {
String msgTypeName;
String pushStatusName;
public String getMsgTypeName() {
if (super.getMsgType() != null) {
return super.getMsgType().getDesc();
}
return msgTypeName;
}
public String getPushStatusName() {
if (super.getPushStatus() != null) {
return super.getPushStatus().getDesc();
}
return pushStatusName;
}
}
Loading…
Cancel
Save