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

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zsc.edu.gateway.modules.message.entity.Notice;
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 NoticeQuery {
    Set<Long> noticeIds;

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