| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.other.api.domain.TNotice; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | } |
| | | |
| | | @ApiOperation(tags = {"后台-内容设置-公告管理"},value = "删除") |
| | | @PostMapping(value = "/deleteById/{id}") |
| | | public AjaxResult deleteById(@PathVariable Integer id) { |
| | | noticeService.removeById(id); |
| | | @DeleteMapping(value = "/deleteById") |
| | | public AjaxResult deleteById(String ids) { |
| | | String[] split = ids.split(","); |
| | | for (String id : split) { |
| | | noticeService.removeById(id); |
| | | } |
| | | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(tags = {"后台-内容设置-公告管理"},value = "查询") |
| | | @PostMapping(value = "/pageList") |
| | | public AjaxResult<Page<TNotice>> authPageList(@RequestBody NoticeQueryDto query) { |
| | | if (query.getStatus()==null){ |
| | | |
| | | return AjaxResult.success(noticeService.lambdaQuery() |
| | | .like(query.getContent()!=null&&query.getContent()!="",TNotice::getContent,query.getContent()) |
| | | .page(Page.of(query.getPageCurr(),query.getPageSize()))); |
| | | |
| | | } |
| | | |
| | | if (query.getStatus()==0){ |
| | | return AjaxResult.success(noticeService.lambdaQuery() |
| | | .le(TNotice::getStartTime, LocalDateTime.now()) |
| | |
| | | .page(Page.of(query.getPageCurr(),query.getPageSize()))); |
| | | }else{ |
| | | return AjaxResult.success(noticeService.lambdaQuery() |
| | | .like(query.getContent() != null && query.getContent() != "", TNotice::getContent, query.getContent()) |
| | | .page(Page.of(query.getPageCurr(), query.getPageSize()))); |
| | | .like(query.getContent()!=null&&query.getContent()!="",TNotice::getContent,query.getContent()) |
| | | .page(Page.of(query.getPageCurr(),query.getPageSize()))); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | @ApiOperation(tags = {"小程序-首页-公告管理"},value = "查询") |
| | | @GetMapping(value = "/list") |
| | | public AjaxResult<List<TNotice>> list() { |
| | | return AjaxResult.success(noticeService.list(Wrappers.lambdaQuery(TNotice.class) |
| | | .ge(TNotice::getStartTime, LocalDateTime.now()) |
| | | .le(TNotice::getEndTime,LocalDateTime.now()))); |
| | | |
| | | } |
| | | |
| | | } |
| | | |