Example #1
0
//Fetch all datas for the given day and given user
//return a json stream with calls on success otherwise http status 500
func (c Daily) PeerDatas(day string, user string) revel.Result {
	revel.TRACE.Printf("[Daily PEERDATAS] Get incomming call for the given date [%s].\r\n", day)
	results := bson.M{}
	inCalls := mongo.GetPeerInCallsForUser(day, user, c.MongoDatabase)
	revel.TRACE.Printf("[Daily PEERSDATAS] Get outgoing call for the given date [%s].\r\n", day)
	outCalls := mongo.GetPeerOutCallsForUser(day, user, c.MongoDatabase)
	hourlyInCalls := mongo.GetPeerInCallsByHoursAndPeer(day, user, c.MongoDatabase)
	hourlyOutCalls := mongo.GetPeerOutCallsByHoursAndPeer(day, user, c.MongoDatabase)
	results["inCalls"] = inCalls
	results["outCalls"] = outCalls
	results["hourlyInCalls"] = hourlyInCalls
	results["hourlyOutCalls"] = hourlyOutCalls
	revel.TRACE.Printf("[Daily PEERDATAS] Send to the client response of %d records.\r\n", len(results))
	return c.RenderJson(results)
}
Example #2
0
//Fetch all incomming calls for given day and user
//return a json stream with calls on success otherwise http status 500
func (c Daily) IncommingCallsByDayUser(day string, user string) revel.Result {
	revel.TRACE.Printf("[Daily] Get incomming call by day for the date [%s] and caller [%s].\r\n", day, user)
	results := mongo.GetPeerInCallsForUser(day, user, c.MongoDatabase)
	revel.TRACE.Printf("[Daily] send to the client response of %d records.\r\n", len(results))
	return c.RenderJson(results)
}