1 changed files with 55 additions and 0 deletions
@ -0,0 +1,55 @@ |
|||||||
|
package com.cloud.kicc.commonbiz.controller.app; |
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil; |
||||||
|
import cn.hutool.core.util.StrUtil; |
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||||
|
import com.cloud.kicc.common.core.api.R; |
||||||
|
import com.cloud.kicc.common.core.constant.AppConstants; |
||||||
|
import com.cloud.kicc.common.security.util.SecurityUtils; |
||||||
|
import com.cloud.kicc.commonbiz.api.entity.PushChatMessage; |
||||||
|
import com.cloud.kicc.commonbiz.service.IPushChatMessageService; |
||||||
|
import io.swagger.annotations.Api; |
||||||
|
import io.swagger.annotations.ApiOperation; |
||||||
|
import lombok.RequiredArgsConstructor; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
import javax.validation.Valid; |
||||||
|
import java.util.Arrays; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* chat message controller |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: wangxiang4 |
||||||
|
* @since: 2023/6/6 |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
@RequestMapping(AppConstants.APP_COMMON + "/appPushChatMessage") |
||||||
|
@RequiredArgsConstructor |
||||||
|
@Api(tags = "push chat message management") |
||||||
|
public class AppPushChatMessageController { |
||||||
|
|
||||||
|
private final IPushChatMessageService iPushChatMessageService; |
||||||
|
|
||||||
|
private LambdaQueryWrapper<PushChatMessage> getQueryWrapper(PushChatMessage pushChatMessage) { |
||||||
|
return new LambdaQueryWrapper<PushChatMessage>() |
||||||
|
.eq(PushChatMessage::getUserId, SecurityUtils.getUser().getId()) |
||||||
|
.eq(ObjectUtil.isNotEmpty(pushChatMessage.getStatus()), PushChatMessage::getStatus, pushChatMessage.getStatus()) |
||||||
|
.like(StrUtil.isNotBlank(pushChatMessage.getTitle()), PushChatMessage::getTitle, pushChatMessage.getTitle()) |
||||||
|
.eq(StrUtil.isNotBlank(pushChatMessage.getAlias()), PushChatMessage::getAlias, pushChatMessage.getAlias()) |
||||||
|
.orderByAsc(PushChatMessage::getCreateTime); |
||||||
|
} |
||||||
|
|
||||||
|
@GetMapping("/list") |
||||||
|
@ApiOperation(value = "page break query") |
||||||
|
public R list(Page page, PushChatMessage pushChatMessage) { |
||||||
|
IPage<PushChatMessage> result = iPushChatMessageService.page(page, getQueryWrapper(pushChatMessage)); |
||||||
|
return R.ok(result.getRecords(), result.getTotal()); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
Loading…
Reference in new issue