package com.zsc.edu.gateway.modules.notice.query;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zsc.edu.gateway.modules.notice.entity.Message;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.util.StringUtils;

import java.util.Set;

/**
 * @author zhuang
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MessageQuery {
    Set<Long> messageIds;

    public LambdaQueryWrapper<Message> wrapper() {
        LambdaQueryWrapper<Message> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(StringUtils.hasText((CharSequence) this.messageIds), Message::getId, this.messageIds);
        return queryWrapper;
    }
}
