package com.muyu.system.domain.model;

import com.muyu.common.core.web.model.QueryModel;
import com.muyu.system.domain.rep.SysMenuListReq;
import com.muyu.system.domain.rep.SysNoticeListReq;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * 参数配置 分页 模型
 */

@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class SysNoticePageQueryModel extends QueryModel<SysNoticePageQueryModel> {
    /**
     * 公告标题
     */
    private String noticeTitle;

    /**
     * 公告类型（1通知 2公告）
     */
    private String noticeType;
    /**
     * 创建者
     */
    private String createBy;

    public static SysNoticePageQueryModel reqBuild(SysNoticeListReq sysNoticeListReq) {
        SysNoticePageQueryModel sysNoticePageQueryModel = SysNoticePageQueryModel.builder()
                .noticeTitle(sysNoticeListReq.getNoticeTitle())
                .noticeType(sysNoticeListReq.getNoticeType())
                .createBy(sysNoticeListReq.getCreateBy())
                .build();
        sysNoticePageQueryModel.domainBuild(sysNoticeListReq);
        return sysNoticePageQueryModel;
    }
}
