зеркало из https://github.com/microsoft/mouselog.git
Add addWebsite().
This commit is contained in:
Родитель
bb29a1da35
Коммит
f8eed96554
|
@ -63,6 +63,8 @@ func ReadTraces(fileId string) {
|
|||
//path = util.GetTsvDataPath(fileId)
|
||||
websiteId := fileId
|
||||
|
||||
addWebsite(websiteId)
|
||||
|
||||
sessions := []*trace.Session{}
|
||||
sessionMap := map[string]*trace.Session{}
|
||||
impressions := []*trace.Impression{}
|
||||
|
|
|
@ -5,6 +5,20 @@ package batch
|
|||
|
||||
import "github.com/microsoft/mouselog/trace"
|
||||
|
||||
func addWebsite(websiteId string) {
|
||||
w := &trace.Website{
|
||||
Id: websiteId,
|
||||
Name: websiteId,
|
||||
Url: "",
|
||||
TrackConfig: "{}",
|
||||
State: "active",
|
||||
}
|
||||
|
||||
if trace.GetWebsite(websiteId) == nil {
|
||||
trace.AddWebsite(w)
|
||||
}
|
||||
}
|
||||
|
||||
func addSession(sessions *[]*trace.Session, sessionMap *map[string]*trace.Session, id string, websiteId string, createdTime string, userAgent string, clientIp string) {
|
||||
s := &trace.Session{Id: id, WebsiteId: websiteId, CreatedTime: createdTime, UserAgent: userAgent, ClientIp: clientIp}
|
||||
if _, ok := (*sessionMap)[id]; !ok {
|
||||
|
|
Загрузка…
Ссылка в новой задаче