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

import cn.novalon.manage.sys.core.query.SysExceptionLogQuery;
import cn.novalon.manage.db.dao.QueryField;

/**
 * 异常日志查询条件对象
 * 
 * @author 张翔
 * @date 2026-03-13
 */
public class SysExceptionLogQueryCriteria {

    @QueryField(propName = "username", type = QueryField.Type.INNER_LIKE)
    private String username;

    @QueryField(propName = "title", type = QueryField.Type.INNER_LIKE)
    private String title;

    @QueryField(propName = "exceptionName", type = QueryField.Type.INNER_LIKE)
    private String exceptionName;

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

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getExceptionName() {
        return exceptionName;
    }

    public void setExceptionName(String exceptionName) {
        this.exceptionName = exceptionName;
    }

    public String getKeyword() {
        return keyword;
    }

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

    /**
     * 从领域查询对象转换
     * 
     * @param query 领域查询对象
     */
    public void convert(SysExceptionLogQuery query) {
        if (query == null) {
            return;
        }
        this.username = query.getUsername();
        this.title = query.getTitle();
        this.exceptionName = query.getExceptionName();
        this.keyword = query.getKeyword();
    }
}
