Skip to content

Commit

Permalink
Socioboard 3.0
Browse files Browse the repository at this point in the history
Github Commit
-----------------
-Can find current plan detail
-Can leave accout any time
-As per plan you shold get limited features
-Changed pricing details
-Can follow and like us on twiter and facebook
-New design options
-Can show only 3 profiles on dashboard
-Changed all plans
-Feeds filter feature implemented
-Facebook feeds filter ui issue for text visibility fixed
-Filter changed feeds not opening ux issue fixed
-Pininterest profile name web title issue fixed
-pinterest bug fixes
-Url shortner feature implemented
-Fixed the bug for social signin
-Made changes in google plus data services for content feeds
-facebook page feeds data services for like comment count
-changes in twitter feeds
-Twitterfeeds data services for like comment count
-Add new feature Re-socio in twitter and facebook
-Worked on facebook page add isssue
-Add like n comment share details in G+
-Solved youtube feeds error issue
-Solved smart search issue
  • Loading branch information
socioboard committed Jul 3, 2017
1 parent fa96a88 commit b070aa2
Show file tree
Hide file tree
Showing 173 changed files with 5,022 additions and 1,894 deletions.
Binary file modified .vs/Socioboard/v14/.suo
Binary file not shown.
16 changes: 16 additions & 0 deletions src/Api.Socioboard/Controllers/FacebookController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,22 @@ public IActionResult GetAllFacebookProfiles(long groupId)
return Ok(lstFbAcc);
}

[HttpGet("GetFacebookProfilesOnly")]
public IActionResult GetFacebookProfilesOnly(long groupId)
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _env);
List<Domain.Socioboard.Models.Groupprofiles> lstGrpProfiles = Repositories.GroupProfilesRepository.getAllGroupProfiles(groupId, _redisCache, dbr);
List<Domain.Socioboard.Models.Facebookaccounts> lstFbAcc = new List<Facebookaccounts>();
foreach (var item in lstGrpProfiles.Where(t => t.profileType == Domain.Socioboard.Enum.SocialProfileType.Facebook))
{
Domain.Socioboard.Models.Facebookaccounts fbAcc = Repositories.FacebookRepository.getFacebookAccount(item.profileId, _redisCache, dbr);
if (fbAcc != null)
{
lstFbAcc.Add(fbAcc);
}
}
return Ok(lstFbAcc);
}

[HttpPost("GetFacebookPages")]
public IActionResult GetFacebookPages(string accesstoken, long groupId)
Expand Down
98 changes: 79 additions & 19 deletions src/Api.Socioboard/Controllers/GoogleController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,33 +117,67 @@ public IActionResult GoogleLogin(string code,Domain.Socioboard.Enum.SBAccountTyp

DatabaseRepository dbr = new DatabaseRepository(_logger, _appEnv);
IList<User> lstUser = dbr.Find<User>(t => t.EmailId.Equals(EmailId));
IList<Googleplusaccounts> lstgacc = dbr.Find<Googleplusaccounts>(t => t.EmailId.Equals(EmailId));
IList<User> userTable = dbr.Find<User>(t => t.Id == lstgacc.First().UserId);
if (lstUser != null && lstUser.Count() > 0)
{
if (lstUser.First().ActivationStatus == Domain.Socioboard.Enum.SBUserActivationStatus.Active)
if (lstUser.FirstOrDefault().SocialLoginEnableGo == true)
{
DateTime d1 = DateTime.UtcNow;
//User userTable = dbr.Single<User>(t => t.EmailId == EmailId);
//userTable.LastLoginTime = d1;
lstUser.First().LastLoginTime = d1;
dbr.Update<User>(lstUser.First());
_redisCache.Set<User>(lstUser.First().EmailId, lstUser.First());
return Ok(lstUser.First());
if (lstUser.First().ActivationStatus == Domain.Socioboard.Enum.SBUserActivationStatus.Active)
{
DateTime d1 = DateTime.UtcNow;
//User userTable = dbr.Single<User>(t => t.EmailId == EmailId);
//userTable.LastLoginTime = d1;
lstUser.First().LastLoginTime = d1;
dbr.Update<User>(lstUser.First());
_redisCache.Set<User>(lstUser.First().EmailId, lstUser.First());
return Ok(lstUser.First());
}
else if (lstUser.First().ActivationStatus == Domain.Socioboard.Enum.SBUserActivationStatus.Disable)
{
return Ok("Your account is disabled. Please contact socioboard support for more assistance");
}
else
{
return Ok("Something went wrong please try after sometime");
}
}
else if (lstUser.First().ActivationStatus == Domain.Socioboard.Enum.SBUserActivationStatus.Disable)
else
{
return Ok("Your account is disabled. Please contact socioboard support for more assistance");
return Ok(" Oh! it's look like social signin with google has disabled");
}
}
else if (lstgacc != null && lstgacc.Count() > 0 && lstUser.Count() == 0 )
{
if(lstgacc.First().IsActive == true)
{
if (userTable.First().SocialLoginEnableGo == true)
{
DateTime d1 = DateTime.UtcNow;
//IList<User> userTable = dbr.Find<User>(t => t.Id == lstgacc.First().UserId);
userTable.First().LastLoginTime = d1;
dbr.Update<User>(userTable.First());
_redisCache.Set<User>(userTable.First().EmailId, userTable.First());
return Ok(userTable.First());
}
else
{
return Ok("it's look like you have disable your social signin option for gplus acc.");
}

}
else
{
return Ok("Something went wrong please try after sometime");
return Ok("Google account added by other user");
}

}
else
{
Domain.Socioboard.Models.Googleplusaccounts gplusAcc = Api.Socioboard.Repositories.GplusRepository.getGPlusAccount(Convert.ToString(userinfo["id"]), _redisCache, dbr);
if (gplusAcc != null && gplusAcc.IsActive == true)
{
return Ok("GPlus account added by other user.");
return BadRequest("GPlus account added by other user.");
}


Expand Down Expand Up @@ -227,6 +261,32 @@ public IActionResult GoogleLogin(string code,Domain.Socioboard.Enum.SBAccountTyp



}

[HttpPost("EnableDisableGoogleSignIn")]
public IActionResult EnableDisableGoogleSignIn(long userId, bool checkEnable)
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _appEnv);
User user = dbr.Single<User>(t => t.Id == userId);
user.SocialLoginEnableGo = checkEnable;
int res = dbr.Update<User>(user);

if (res == 1)
{
if (checkEnable)
{
return Ok("Cool! Social SignIn has Enable for your Goole Account ");
}
else
{
return Ok("You have Successfully Disabled Social SignIn for Your Google Account");
}

}
else
{
return BadRequest("Error while enabling Social Signin, pls try after some time.");
}
}

[HttpPost("GoogleLoginPhone")]
Expand Down Expand Up @@ -298,7 +358,7 @@ public IActionResult GoogleLoginPhone(string refreshToken,string accessToken, Do
Domain.Socioboard.Models.Googleplusaccounts gplusAcc = Api.Socioboard.Repositories.GplusRepository.getGPlusAccount(Convert.ToString(userinfo["id"]), _redisCache, dbr);
if (gplusAcc != null && gplusAcc.IsActive == true)
{
return Ok("GPlus account added by other user.");
return BadRequest("GPlus account added by other user.");
}


Expand Down Expand Up @@ -416,9 +476,9 @@ public IActionResult AddGoogleAccountPhone(string refreshToken, string accessTok
{
if (gplusAcc.UserId == userId)
{
return Ok("GPlus account already added by you.");
return BadRequest("GPlus account already added by you.");
}
return Ok("GPlus account added by other user.");
return BadRequest("GPlus account added by other user.");
}
Groups ngrp = dbr.Find<Domain.Socioboard.Models.Groups>(t => t.adminId == userId && t.id == groupId).FirstOrDefault();
if (ngrp == null)
Expand All @@ -433,7 +493,7 @@ public IActionResult AddGoogleAccountPhone(string refreshToken, string accessTok
}
else
{
return Ok("Issues while adding account");
return BadRequest("Issues while adding account");
}
}

Expand Down Expand Up @@ -483,9 +543,9 @@ public IActionResult AddGoogleAccount(string code, long groupId, long userId)
{
if (gplusAcc.UserId == userId)
{
return Ok("GPlus account already added by you.");
return BadRequest("GPlus account already added by you.");
}
return Ok("GPlus account added by other user.");
return BadRequest("GPlus account added by other user.");
}
Groups ngrp = dbr.Find<Domain.Socioboard.Models.Groups>(t => t.adminId == userId && t.id == groupId).FirstOrDefault();
if (ngrp == null)
Expand All @@ -500,7 +560,7 @@ public IActionResult AddGoogleAccount(string code, long groupId, long userId)
}
else
{
return Ok("Issues while adding account");
return BadRequest("Issues while adding account");
}
}

Expand Down
11 changes: 9 additions & 2 deletions src/Api.Socioboard/Controllers/GroupProfilesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ public IActionResult GetAllGroupProfiles(long groupId)
return Ok(GroupProfilesRepository.getAllGroupProfiles(groupId, _redisCache, dbr));
}

[HttpGet("GetAllGroupProfilesDeatails")]
public IActionResult GetAllGroupProfilesDeatails(long groupId)
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _appEnv);
return Ok(GroupProfilesRepository.getAllGroupProfilesdetail(groupId, _redisCache, dbr));
}

[HttpPost("DeleteProfile")]
public IActionResult DeleteProfile(long groupId, long userId, string profileId)
{
Expand All @@ -63,7 +70,7 @@ public IActionResult AddSelectedProfiles(long groupId, long userId)
string selectedProfiles = Request.Form["selectedProfiles"];
string[] Profiles = selectedProfiles.Split(',');
DatabaseRepository dbr = new DatabaseRepository(_logger, _appEnv);
List<Domain.Socioboard.Models.Groupprofiles> lstGrpProfiles = Repositories.GroupProfilesRepository.getGroupProfiles(groupId, _redisCache, dbr);
List<Domain.Socioboard.Models.Groupprofiles> lstGrpProfiles = Repositories.GroupProfilesRepository.getAllGroupProfiles(groupId, _redisCache, dbr);
lstGrpProfiles = lstGrpProfiles.Where(t => !Profiles.Contains(t.profileId)).ToList();
foreach (var item in lstGrpProfiles)
{
Expand Down Expand Up @@ -228,7 +235,7 @@ public IActionResult AddProfileToGroup(string profileId, long groupId, long user
}
if (profileType == Domain.Socioboard.Enum.SocialProfileType.Pinterest)
{
Domain.Socioboard.Models.PinterestAccount pinAcc = Repositories.PinterestRepository.getPinterestAccount(profileId, _redisCache, dbr);
Domain.Socioboard.Models.PinterestAccount pinAcc = dbr.Find<Domain.Socioboard.Models.PinterestAccount>(t => t.username.Equals(profileId)).FirstOrDefault();
if (pinAcc == null)
{
return BadRequest("Invalid profileId");
Expand Down
32 changes: 32 additions & 0 deletions src/Api.Socioboard/Controllers/GroupsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Cors;
using Domain.Socioboard.Models;
using System.Collections.Generic;
using System.Linq;

// For more information on enabling Web API for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860

Expand Down Expand Up @@ -78,5 +80,35 @@ public IActionResult GetUserGroups(long userId)
DatabaseRepository dbr = new DatabaseRepository(_logger,_appEnv);
return Ok(GroupsRepository.getAllGroupsofUser(userId, _redisCache, dbr));
}

[HttpGet("GetUserGroupsCount")]
public IActionResult GetUserGroupsCount(long userId)
{
DatabaseRepository dbr = new DatabaseRepository(_logger, _appEnv);
return Ok(GroupsRepository.getAllGroupsofUserCount(userId, _redisCache, dbr));
}

[HttpPost("AddSelectedGroups")]
public IActionResult AddSelectedGroups(long userId)
{
string selectedGroups = Request.Form["selectedGroups"];
string[] Profiles = selectedGroups.Split(',');
DatabaseRepository dbr = new DatabaseRepository(_logger, _appEnv);
List<Domain.Socioboard.Models.Groups> lstGrp = Repositories.GroupsRepository.getGroups(userId, _redisCache, dbr);
lstGrp = lstGrp.Where(t => !Profiles.Contains(t.groupName)).ToList();
foreach (Domain.Socioboard.Models.Groups item in lstGrp)
{
if(item.groupName=="Socioboard")
{
return BadRequest("You cann't delete default group choose other one");
}
else
{
GroupsRepository.DeleteProfile(userId, item.id, _redisCache, dbr, _appSettings);
}

}
return Ok();
}
}
}
6 changes: 3 additions & 3 deletions src/Api.Socioboard/Controllers/LinkedInController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public IActionResult AddLinkedInAccount(string Code, long groupId, long userId)
{
if (linaccount.UserId == userId)
{
return Ok("LinkedIn account already added by you.");
return BadRequest("LinkedIn account already added by you.");
}
return Ok("LinkedIn account added by other user.");
return BadRequest("LinkedIn account added by other user.");
}
else
{
Expand All @@ -77,7 +77,7 @@ public IActionResult AddLinkedInAccount(string Code, long groupId, long userId)
}
else
{
return Ok("Error while Adding Account");
return BadRequest("Error while Adding Account");
}
}
}
Expand Down
29 changes: 4 additions & 25 deletions src/Api.Socioboard/Controllers/MediaController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public MediaController(ILogger<FacebookController> logger, Microsoft.Extensions.
private Helper.AppSettings _appSettings;
private Helper.Cache _redisCache;
private readonly IHostingEnvironment _appEnv;


public static ImageFormat GetImageFormat(string extension)
{
Expand All @@ -53,7 +53,7 @@ public static ImageFormat GetImageFormat(string extension)
}




[HttpGet("Get")]
public IActionResult Get(string id)
Expand All @@ -72,7 +72,7 @@ public IActionResult Get(string id)
//If requested file is an image than load file to memory
if (GetImageFormat(extension) != null)
{
return Ok(new FileStream(filePath, FileMode.Open));
return Ok( new FileStream(filePath, FileMode.Open));

//ms = CopyFileToMemory(filePath);
}
Expand All @@ -82,31 +82,10 @@ public IActionResult Get(string id)
}
}


return BadRequest();
}

[HttpGet("Getfilepath")]
public IActionResult Getfilepath(string id)
{
string filePath = _appEnv.WebRootPath + string.Concat("/upload/", id);
string extension = Path.GetExtension(id);
if (System.IO.File.Exists(filePath))
{
if (!string.IsNullOrWhiteSpace(extension))
{
extension = extension.Substring(extension.IndexOf(".") + 1);
}

//If requested file is an image than load file to memory
if (GetImageFormat(extension) != null)
{
return Ok(filePath);
}
}
return Ok();
}




Expand Down
Loading

0 comments on commit b070aa2

Please sign in to comment.