-
Notifications
You must be signed in to change notification settings - Fork 371
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
github Commit ---------------- -Youtube account adding isssue -Phone number code with country name implemented -Schedule modal ui issue fixed -added new content studio module -added trending content features in same module -added most shared features in same module -Automate Rss Feeds Issue fixed -add Quick topics implementation in conetnt studio -add Trending Content ui and functionality and new implementation
- Loading branch information
1 parent
4597842
commit e5599a7
Showing
231 changed files
with
12,179 additions
and
1,096 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 106 additions & 0 deletions
106
src/Api.Socioboard/Controllers/AdvanceSearchController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.Extensions.Logging; | ||
using Microsoft.AspNetCore.Hosting; | ||
using Api.Socioboard.Model; | ||
using MongoDB.Driver; | ||
using Microsoft.AspNetCore.Cors; | ||
using Domain.Socioboard.Models.Mongo; | ||
|
||
// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860 | ||
|
||
namespace Api.Socioboard.Controllers | ||
{ | ||
[EnableCors("AllowAll")] | ||
[Route("api/[controller]")] | ||
public class AdvanceSearchController : Controller | ||
{ | ||
public AdvanceSearchController(ILogger<AdvanceSearchController> logger, Microsoft.Extensions.Options.IOptions<Helper.AppSettings> settings, IHostingEnvironment env) | ||
{ | ||
_logger = logger; | ||
_appSettings = settings.Value; | ||
_redisCache = new Helper.Cache(_appSettings.RedisConfiguration); | ||
_env = env; | ||
} | ||
private readonly ILogger _logger; | ||
private Helper.AppSettings _appSettings; | ||
private Helper.Cache _redisCache; | ||
private readonly IHostingEnvironment _env; | ||
|
||
|
||
|
||
[HttpGet("GetYTAdvanceSearchData")] | ||
public IActionResult GetYTAdvanceSearchData(Domain.Socioboard.Enum.NetworkType network, int skip, int count) | ||
{ | ||
DatabaseRepository dbr = new DatabaseRepository(_logger, _env); | ||
MongoRepository mongorepo = new MongoRepository("AdvanceSerachData", _appSettings); | ||
if (skip + count < 100) | ||
{ | ||
return Ok(Repositories.ContentStudioRepository.YuTubeAdvanceSerachData(network, _redisCache, _appSettings).Skip(skip).Take(count)); | ||
} | ||
else | ||
{ | ||
var builder = Builders<Domain.Socioboard.Models.Mongo.AdvanceSerachData>.Sort; | ||
var sort = builder.Descending(t => t.totalShareCount); | ||
var result = mongorepo.FindWithRange<Domain.Socioboard.Models.Mongo.AdvanceSerachData>(t => t.networkType.Equals(network), sort, skip, count); | ||
var task = Task.Run(async () => | ||
{ | ||
return await result; | ||
}); | ||
IList<Domain.Socioboard.Models.Mongo.AdvanceSerachData> lstTwitterFeeds = task.Result; | ||
return Ok(lstTwitterFeeds); | ||
} | ||
} | ||
|
||
|
||
[HttpGet("GetSortByData")] | ||
public IActionResult GetSortByData(string sortType, int skip, int count) | ||
{ | ||
DatabaseRepository dbr = new DatabaseRepository(_logger, _env); | ||
MongoRepository mongorepo = new MongoRepository("AdvanceSerachData", _appSettings); | ||
if (skip + count < 200) | ||
{ | ||
return Ok(Repositories.ContentStudioRepository.GetSortBy(sortType, _redisCache, _appSettings).Skip(skip).Take(count)); | ||
} | ||
else | ||
{ | ||
var builder = Builders<Domain.Socioboard.Models.Mongo.AdvanceSerachData>.Sort; | ||
var sort = builder.Descending(t => t.totalShareCount); | ||
var result = mongorepo.FindWithRange<Domain.Socioboard.Models.Mongo.AdvanceSerachData>(t => t.twtShareCount != 0, sort, skip, count); | ||
var task = Task.Run(async () => | ||
{ | ||
return await result; | ||
}); | ||
IList<Domain.Socioboard.Models.Mongo.AdvanceSerachData> lstTwitterFeeds = task.Result; | ||
return Ok(lstTwitterFeeds); | ||
} | ||
} | ||
|
||
|
||
[HttpGet("QuickTopics")] | ||
public IActionResult QuickTopics(Domain.Socioboard.Enum.NetworkType networkType, int skip, int count) | ||
{ | ||
DatabaseRepository dbr = new DatabaseRepository(_logger, _env); | ||
MongoRepository mongorepo = new MongoRepository("AdvanceSerachData", _appSettings); | ||
if (skip + count < 100) | ||
{ | ||
return Ok(Repositories.ContentStudioRepository.QuickTopicRepository(networkType, _redisCache, _appSettings).Skip(skip).Take(count)); | ||
} | ||
else | ||
{ | ||
var builder = Builders<Domain.Socioboard.Models.Mongo.AdvanceSerachData>.Sort; | ||
var sort = builder.Descending(t => t.totalShareCount); | ||
var result = mongorepo.FindWithRange<Domain.Socioboard.Models.Mongo.AdvanceSerachData>(t => t.twtShareCount != 0, sort, skip, count); | ||
var task = Task.Run(async () => | ||
{ | ||
return await result; | ||
}); | ||
IList<Domain.Socioboard.Models.Mongo.AdvanceSerachData> lstTwitterFeeds = task.Result; | ||
return Ok(lstTwitterFeeds); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Cors; | ||
using Microsoft.Extensions.Logging; | ||
using Domain.Socioboard.Interfaces.Services; | ||
using Microsoft.AspNetCore.Hosting; | ||
using Api.Socioboard.Model; | ||
|
||
// For more information on enabling Web API for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860 | ||
|
||
namespace Api.Socioboard.Controllers | ||
{ | ||
[EnableCors("AllowAll")] | ||
[Route("api/[controller]")] | ||
public class ContentStudioController : Controller | ||
{ | ||
// GET: api/values | ||
public ContentStudioController(ILogger<UserController> logger, IEmailSender emailSender, IHostingEnvironment appEnv, Microsoft.Extensions.Options.IOptions<Helper.AppSettings> settings) | ||
{ | ||
_logger = logger; | ||
_emailSender = emailSender; | ||
_appEnv = appEnv; | ||
_appSettings = settings.Value; | ||
_redisCache = new Helper.Cache(_appSettings.RedisConfiguration); | ||
} | ||
private readonly ILogger _logger; | ||
private readonly IEmailSender _emailSender; | ||
private readonly IHostingEnvironment _appEnv; | ||
private Helper.AppSettings _appSettings; | ||
private Helper.Cache _redisCache; | ||
|
||
[HttpGet("GetAdvanceSearchData")] | ||
public IActionResult GetAdvanceSearchData(string keywords) | ||
{ | ||
DatabaseRepository dbr = new DatabaseRepository(_logger, _appEnv); | ||
return Ok(Repositories.ContentStudioRepository.GetAdvanceSearchdata(keywords, _redisCache, _appSettings)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.