You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: record.go
    path of file: ./repos/erda/internal/tools/monitor/core/alert/alert-apis/adapt
    
    the code of the file until where you have to start completion: // Copyright (c) 2021 Terminus, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance wit
    
func (a *Adapt) queryAlertHistory(groupID string, start, end int64, limit uint) ([]*pb.AlertHistory, error) {
	if a.eventStorage == nil {
		return nil, nil
	}

	sel := &storage.Selector{
		Start: start * int64(time.Millisecond),
		End:   end * int64(time.Millisecond),
		Filters: []*storage.Filter{
			{
				Key:   "relations.res_id",
				Op:    storage.EQ,
				Value: groupID,
			},
		},
	}

	list, err := a.eventStorage.QueryPaged(context.Background(), sel, 1, int(limit))
	if err != nil {
		return nil, err
	}

	var results []*pb.AlertHistory
	for _, item := range list {
		results = append(results, &pb.AlertHistory{
			AlertState: item.Tags["trigger"],
			GroupId:    item.Relations["res_id"],
			Timestamp:  item.Timestamp / int64(time.Millisecond),
			Title:      item.Tags["alert_title"],
			Content:    item.Content,
			DisplayUrl: item.Tags["display_url"],
		})
	}

	return results, nil
}