Loading go-apps/meep-loc-serv/server/loc-serv.go +6 −4 Original line number Diff line number Diff line Loading @@ -1648,6 +1648,12 @@ func updateUserInfo(address string, zoneId string, accessPointId string, longitu userInfo.ZoneId = zoneId userInfo.AccessPointId = accessPointId seconds := time.Now().Unix() var timeStamp TimeStamp timeStamp.Seconds = int32(seconds) userInfo.Timestamp = &timeStamp // Update position if longitude == nil || latitude == nil { userInfo.LocationInfo = nil Loading @@ -1662,10 +1668,6 @@ func updateUserInfo(address string, zoneId string, accessPointId string, longitu userInfo.LocationInfo.Latitude = nil userInfo.LocationInfo.Latitude = append(userInfo.LocationInfo.Latitude, *latitude) seconds := time.Now().Unix() var timeStamp TimeStamp timeStamp.Seconds = int32(seconds) userInfo.LocationInfo.Timestamp = &timeStamp } Loading go-apps/meep-loc-serv/server/loc-serv_test.go +8 −2 Original line number Diff line number Diff line Loading @@ -1500,7 +1500,8 @@ func TestUserInfo(t *testing.T) { expectedResourceURL := expectedListResourceURL + "?address=ue1" //expectedListResourceURL := "" //expectedResourceURL := "" expectedUserInfo := UserInfo{"zone1-poa-cell1", "ue1", "", "", nil, expectedResourceURL, nil, "zone1"} var timestamp TimeStamp expectedUserInfo := UserInfo{"zone1-poa-cell1", "ue1", "", "", nil, expectedResourceURL, ×tamp, "zone1"} expectedUserList := UserList{expectedListResourceURL, nil} expectedUserList.User = append(expectedUserList.User, expectedUserInfo) Loading Loading @@ -1559,7 +1560,12 @@ func testUserInfo(t *testing.T, userId string, expectedResponse string) { if err != nil { t.Fatalf("Failed to get expected response") } //need to remove the resourec url since it was not given in the expected response //need to remove the timestamp since it was not given in the expected response if len(respBody.UserList.User) != 0 { var timestamp TimeStamp respBody.UserList.User[0].Timestamp = ×tamp } receivedResponseStr, err := json.Marshal(respBody.UserList) if err != nil { t.Fatalf(err.Error()) Loading Loading
go-apps/meep-loc-serv/server/loc-serv.go +6 −4 Original line number Diff line number Diff line Loading @@ -1648,6 +1648,12 @@ func updateUserInfo(address string, zoneId string, accessPointId string, longitu userInfo.ZoneId = zoneId userInfo.AccessPointId = accessPointId seconds := time.Now().Unix() var timeStamp TimeStamp timeStamp.Seconds = int32(seconds) userInfo.Timestamp = &timeStamp // Update position if longitude == nil || latitude == nil { userInfo.LocationInfo = nil Loading @@ -1662,10 +1668,6 @@ func updateUserInfo(address string, zoneId string, accessPointId string, longitu userInfo.LocationInfo.Latitude = nil userInfo.LocationInfo.Latitude = append(userInfo.LocationInfo.Latitude, *latitude) seconds := time.Now().Unix() var timeStamp TimeStamp timeStamp.Seconds = int32(seconds) userInfo.LocationInfo.Timestamp = &timeStamp } Loading
go-apps/meep-loc-serv/server/loc-serv_test.go +8 −2 Original line number Diff line number Diff line Loading @@ -1500,7 +1500,8 @@ func TestUserInfo(t *testing.T) { expectedResourceURL := expectedListResourceURL + "?address=ue1" //expectedListResourceURL := "" //expectedResourceURL := "" expectedUserInfo := UserInfo{"zone1-poa-cell1", "ue1", "", "", nil, expectedResourceURL, nil, "zone1"} var timestamp TimeStamp expectedUserInfo := UserInfo{"zone1-poa-cell1", "ue1", "", "", nil, expectedResourceURL, ×tamp, "zone1"} expectedUserList := UserList{expectedListResourceURL, nil} expectedUserList.User = append(expectedUserList.User, expectedUserInfo) Loading Loading @@ -1559,7 +1560,12 @@ func testUserInfo(t *testing.T, userId string, expectedResponse string) { if err != nil { t.Fatalf("Failed to get expected response") } //need to remove the resourec url since it was not given in the expected response //need to remove the timestamp since it was not given in the expected response if len(respBody.UserList.User) != 0 { var timestamp TimeStamp respBody.UserList.User[0].Timestamp = ×tamp } receivedResponseStr, err := json.Marshal(respBody.UserList) if err != nil { t.Fatalf(err.Error()) Loading