54 lines
1.7 KiB
Java
54 lines
1.7 KiB
Java
package com.gunshi.project.hsz.controller;
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.gunshi.core.result.R;
|
|
import com.gunshi.db.dto.DateTimeRangeSo;
|
|
import com.gunshi.project.hsz.entity.so.MessageCenterPageSo;
|
|
import com.gunshi.project.hsz.model.MessageCenter;
|
|
import com.gunshi.project.hsz.service.MessageCenterService;
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import java.util.List;
|
|
|
|
/**
|
|
* 描述: 消息中心
|
|
* author: xusan
|
|
* date: 2024-09-19 10:39:29
|
|
*/
|
|
@Tag(name = "消息中心")
|
|
@RestController
|
|
@RequestMapping(value="/messageCenter")
|
|
public class MessageCenterController {
|
|
|
|
@Autowired
|
|
private MessageCenterService service;
|
|
|
|
@Operation(summary = "分页查询")
|
|
@PostMapping("/list/page")
|
|
public R<Page<MessageCenter>> listPage(@Validated @RequestBody MessageCenterPageSo page) {
|
|
return R.ok(service.listPage(page));
|
|
}
|
|
|
|
@Operation(summary = "已读")
|
|
@PostMapping("/update")
|
|
public R<MessageCenter> update(@Validated @RequestBody MessageCenter dto) {
|
|
boolean result = service.updateById(dto);
|
|
return R.ok(result ? dto : null);
|
|
}
|
|
|
|
@Operation(summary = "全部标注已读")
|
|
@GetMapping("/all/read")
|
|
public R<Boolean> allRead() {
|
|
return R.ok(service.allRead());
|
|
}
|
|
|
|
@Operation(summary = "APP-消息中心")
|
|
@PostMapping("/list")
|
|
public R<List<MessageCenter>> listMes(@Validated @RequestBody DateTimeRangeSo dateTimeRangeSo) {
|
|
return R.ok(service.listMes(dateTimeRangeSo));
|
|
}
|
|
} |