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

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

/**
 * 操作日志查询条件对象
 * 
 * @author 张翔
 * @date 2026-03-13
 */
public class OperationLogQueryCriteria {

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

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

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

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

    public String getUsername() {
        return username;
    }

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

    public String getOperation() {
        return operation;
    }

    public void setOperation(String operation) {
        this.operation = operation;
    }

    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(OperationLogQuery query) {
        if (query == null) {
            return;
        }
        this.username = query.getUsername();
        this.operation = query.getOperation();
        this.status = query.getStatus();
        this.keyword = query.getKeyword();
    }
}
