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

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

/**
 * 登录日志查询条件对象
 * 
 * @author 张翔
 * @date 2026-03-13
 */
public class SysLoginLogQueryCriteria {

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

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

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

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

    public String getUsername() {
        return username;
    }

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

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getKeyword() {
        return keyword;
    }

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

    /**
     * 从领域查询对象转换
     * 
     * @param query 领域查询对象
     */
    public void convert(SysLoginLogQuery query) {
        if (query == null) {
            return;
        }
        this.username = query.getUsername();
        this.ip = query.getIp();
        this.status = query.getStatus();
        this.keyword = query.getKeyword();
    }
}
