package cn.novalon.gym.manage.db.entity.query;

import cn.novalon.gym.manage.notify.core.query.SysUserMessageQuery;
import cn.novalon.gym.manage.db.dao.QueryField;

/**
 * 用户消息查询条件对象
 * 
 * @author 张翔
 * @date 2026-03-13
 */
public class SysUserMessageQueryCriteria {

    @QueryField(propName = "userId", type = QueryField.Type.EQUAL)
    private Long userId;

    @QueryField(propName = "isRead", type = QueryField.Type.EQUAL)
    private String isRead;

    @QueryField(blurry = "title,content", type = QueryField.Type.INNER_LIKE)
    private String keyword;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getIsRead() {
        return isRead;
    }

    public void setIsRead(String isRead) {
        this.isRead = isRead;
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    /**
     * 从领域查询对象转换
     * 
     * @param query 领域查询对象
     */
    public void convert(SysUserMessageQuery query) {
        if (query == null) {
            return;
        }
        this.userId = query.getUserId();
        this.isRead = query.getIsRead();
        this.keyword = query.getKeyword();
    }
}
