School Commit Init
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace District_3_App.Enitities
|
||||
{
|
||||
public class Highlight
|
||||
{
|
||||
private Guid highlightId;
|
||||
private Guid userId;
|
||||
private List<Guid> postsIds;
|
||||
private string name;
|
||||
private string coverFilePath;
|
||||
|
||||
public Highlight()
|
||||
{
|
||||
}
|
||||
public Highlight(string newName, string newCover)
|
||||
{
|
||||
this.highlightId = Guid.NewGuid();
|
||||
this.postsIds = new List<Guid>();
|
||||
this.name = newName;
|
||||
this.coverFilePath = newCover;
|
||||
}
|
||||
public Guid GetHighlightId()
|
||||
{
|
||||
return highlightId;
|
||||
}
|
||||
public List<Guid> GetPosts()
|
||||
{
|
||||
return postsIds;
|
||||
}
|
||||
public string GetName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public string GetCover()
|
||||
{
|
||||
return coverFilePath;
|
||||
}
|
||||
public bool AddPostToHighlight(Guid postId)
|
||||
{
|
||||
this.postsIds.Add(postId);
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool RemovePostFromHighlight(Guid postId)
|
||||
{
|
||||
this.postsIds.Remove(postId);
|
||||
return true;
|
||||
}
|
||||
public void SetName(string newName)
|
||||
{
|
||||
this.name = newName;
|
||||
}
|
||||
public void SetCover(string coverFilePath)
|
||||
{
|
||||
this.coverFilePath = coverFilePath;
|
||||
}
|
||||
public void SetListPosts(List<Guid> postsIds)
|
||||
{
|
||||
this.postsIds = postsIds;
|
||||
}
|
||||
public void SetGuid(Guid guid)
|
||||
{
|
||||
this.highlightId = guid;
|
||||
}
|
||||
|
||||
public void SetListPosts(List<string> list)
|
||||
{
|
||||
List<Guid> guids = new List<Guid>();
|
||||
foreach (var post in list)
|
||||
{
|
||||
guids.Add(Guid.Parse(post));
|
||||
}
|
||||
this.SetListPosts(guids);
|
||||
}
|
||||
public void SetUserId(Guid userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
public Guid GetUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace District_3_App.Enitities.Mocks
|
||||
{
|
||||
public class MockPhotoPost : MockPost
|
||||
{
|
||||
private string description;
|
||||
private string filePath;
|
||||
|
||||
public MockPhotoPost(object user, Dictionary<int, List<object>> reactions, List<object> mentionedUsers, string title, string description, string photo)
|
||||
: base(user, reactions, mentionedUsers, title)
|
||||
{
|
||||
this.description = description;
|
||||
this.filePath = photo;
|
||||
}
|
||||
|
||||
public string GetPhoto()
|
||||
{
|
||||
return filePath;
|
||||
}
|
||||
|
||||
public string GetDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace District_3_App.Enitities.Mocks
|
||||
{
|
||||
public class MockPost
|
||||
{
|
||||
private Guid postId;
|
||||
private object user;
|
||||
private Dictionary<int, List<object>> reactions;
|
||||
private List<object> mentionedUsers;
|
||||
private string title;
|
||||
|
||||
public MockPost(object user, Dictionary<int, List<object>> reactions, List<object> mentionedUsers, string title)
|
||||
{
|
||||
this.postId = Guid.NewGuid();
|
||||
this.user = user;
|
||||
this.reactions = reactions;
|
||||
this.mentionedUsers = mentionedUsers;
|
||||
this.title = title;
|
||||
}
|
||||
public Guid GetPostId()
|
||||
{
|
||||
return postId;
|
||||
}
|
||||
public void SetPostId(Guid postId)
|
||||
{
|
||||
this.postId = postId;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user