IConnectorSocialMedia.csβ’2.36 kB
ο»Ώusing Api.DigitalPages.Interfaces.Models;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Api.DigitalPages.Interfaces.Connector
{
public interface IConnectorSocialMedia
{
/// <summary>
/// Retorna o modelo de uma thread com base no json
/// </summary>
/// <param name="json"></param>
/// <param name="baseThread"></param>
/// <returns></returns>
Task<ISocialMediaThread> From(string json, ISocialMediaThread baseThread = null);
/// <summary>
/// Retorna o modelo de um post com base no json.
/// </summary>
/// <param name="json"></param>
/// <param name="basePost"></param>
/// <returns></returns>
Task<ISocialMediaPost> From(string json, ISocialMediaPost basePost = null);
Task<List<ISocialMediaThread>> Get(ThreadOptions options);
Task<IPagedResult<ISocialMediaThread>> Get(ThreadOptions options, int page, int pageSize);
Task<ISocialMediaThread> Get(Guid threadUid, ThreadOptions options = null);
Task<int> Update(List<ISocialMediaThread> threads);
Task<ISocialMediaThread> Update(ISocialMediaThread thread);
Task<ISocialMediaPost> Update(ISocialMediaPost post);
Task<int> Insert(List<ISocialMediaThread> threads, IUser author);
Task<int> Delete(List<ISocialMediaThread> threads);
Task<bool> Delete(ISocialMediaPost post);
Task<List<ISocialMediaPost>> Get(PostOptions options);
Task<IPagedResult<ISocialMediaPost>> Get(PostOptions options, int page, int pageSize, SortType sortType);
Task<ISocialMediaPost> Get(Guid postUid, PostOptions options = null);
Task<int> Update(List<ISocialMediaPost> posts);
Task<int> Insert(List<ISocialMediaPost> posts, ISocialMediaThread thread, IUser author);
Task<int> Delete(List<ISocialMediaPost> posts);
}
public class ThreadOptions
{
public List<Guid> FilterContexts { get; set; }
public List<ObjectType> FilterTypes { get; set; }
public bool IncludePosts { get; set; }
}
public class PostOptions
{
public List<Guid> FilterThreads { get; set; }
public List<Guid> FilterUsers { get; set; }
public bool FilterOnlyActive { get; set; }
}
}