Add an endpoint to call the lof of jumps by page.

This commit is contained in:
Sébastien André
2022-05-08 16:42:04 +02:00
parent 0745943c5b
commit 9e18b7708a
16 changed files with 142 additions and 7 deletions

View File

@@ -48,6 +48,11 @@ namespace skydiveLogs_api.Infrastructure
return _col.FindById(new BsonValue(id));
}
public int GetCount()
{
throw new System.NotImplementedException();
}
public bool Update(Aircraft aircraft)
{
return _col.Update(aircraft);

View File

@@ -48,6 +48,11 @@ namespace skydiveLogs_api.Infrastructure
return _col.FindById(new BsonValue(id));
}
public int GetCount()
{
throw new System.NotImplementedException();
}
public bool Update(DropZone updatedDz)
{
return _col.Update(updatedDz);

View File

@@ -59,6 +59,11 @@ namespace skydiveLogs_api.Infrastructure
throw new System.NotImplementedException();
}
public int GetCount()
{
throw new System.NotImplementedException();
}
public bool Update(FavoriteDropZone updated)
{
throw new System.NotImplementedException();

View File

@@ -55,6 +55,11 @@ namespace skydiveLogs_api.Infrastructure
return _col.FindById(new BsonValue(id));
}
public int GetCount()
{
throw new System.NotImplementedException();
}
public bool Update(Gear updatedGear)
{
return _col.Update(updatedGear);

View File

@@ -56,11 +56,35 @@ namespace skydiveLogs_api.Infrastructure
throw new System.NotImplementedException();
}
public IEnumerable<Jump> GetBetweenIndex(User user, int beginIndex, int endIndex)
{
return _col.Include(x => x.Aircraft)
.Include(x => x.DropZone)
.Include(x => x.Gear)
.Include(x => x.JumpType)
.Query()
.OrderByDescending(j => j.JumpDate)
.Where(j => j.User.Id == user.Id)
.Limit(endIndex - beginIndex)
.Offset(beginIndex)
.ToList();
}
public Jump GetById(int id)
{
return _col.FindById(new BsonValue(id));
}
public int GetCount(User user)
{
return _col.Count(j => j.User.Id == user.Id);
}
public int GetCount()
{
throw new System.NotImplementedException();
}
public bool Update(Jump updatedJump)
{
return _col.Update(updatedJump);

View File

@@ -48,6 +48,11 @@ namespace skydiveLogs_api.Infrastructure
return _col.FindById(new BsonValue(id));
}
public int GetCount()
{
throw new System.NotImplementedException();
}
public bool Update(JumpType updatedJumpType)
{
return _col.Update(updatedJumpType);

View File

@@ -55,6 +55,11 @@ namespace skydiveLogs_api.Infrastructure
return _col.FindById(new BsonValue(id));
}
public int GetCount()
{
throw new System.NotImplementedException();
}
public bool Update(UserImage image)
{
return _col.Update(image);

View File

@@ -53,6 +53,11 @@ namespace skydiveLogs_api.Infrastructure
return _col.FindOne(u => u.Login == login && u.Password == password);
}
public int GetCount()
{
throw new System.NotImplementedException();
}
public bool Update(User updated)
{
throw new NotImplementedException();

View File

@@ -55,6 +55,11 @@ namespace skydiveLogs_api.Infrastructure
throw new System.NotImplementedException();
}
public int GetCount()
{
throw new System.NotImplementedException();
}
public bool Update(UserStats stats)
{
//col.UpdateMany(x => new Customer { Name