small cleanup in clubs
This commit is contained in:
parent
fe7445eefb
commit
7399e8bac1
2 changed files with 5 additions and 8 deletions
|
@ -1,4 +1,3 @@
|
||||||
#nullable disable
|
|
||||||
using LinqToDB;
|
using LinqToDB;
|
||||||
using LinqToDB.EntityFrameworkCore;
|
using LinqToDB.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
@ -99,9 +98,9 @@ public class ClubService : IEService, IClubService
|
||||||
return member;
|
return member;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<SetClubIconResult> SetClubIconAsync(ulong ownerUserId, string url)
|
public async Task<SetClubIconResult> SetClubIconAsync(ulong ownerUserId, string? url)
|
||||||
{
|
{
|
||||||
if (url is not null)
|
if (!string.IsNullOrWhiteSpace(url))
|
||||||
{
|
{
|
||||||
using var http = _httpFactory.CreateClient();
|
using var http = _httpFactory.CreateClient();
|
||||||
using var temp = await http.GetAsync(url, HttpCompletionOption.ResponseHeadersRead);
|
using var temp = await http.GetAsync(url, HttpCompletionOption.ResponseHeadersRead);
|
||||||
|
@ -174,7 +173,7 @@ public class ClubService : IEService, IClubService
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ClubAcceptResult AcceptApplication(ulong clubOwnerUserId, string userName, out DiscordUser discordUser)
|
public ClubAcceptResult AcceptApplication(ulong clubOwnerUserId, string userName, out DiscordUser? discordUser)
|
||||||
{
|
{
|
||||||
discordUser = null;
|
discordUser = null;
|
||||||
using var uow = _db.GetDbContext();
|
using var uow = _db.GetDbContext();
|
||||||
|
@ -200,7 +199,7 @@ public class ClubService : IEService, IClubService
|
||||||
return ClubAcceptResult.Accepted;
|
return ClubAcceptResult.Accepted;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClubDenyResult RejectApplication(ulong clubOwnerUserId, string userName, out DiscordUser discordUser)
|
public ClubDenyResult RejectApplication(ulong clubOwnerUserId, string userName, out DiscordUser? discordUser)
|
||||||
{
|
{
|
||||||
discordUser = null;
|
discordUser = null;
|
||||||
using var uow = _db.GetDbContext();
|
using var uow = _db.GetDbContext();
|
||||||
|
@ -241,7 +240,7 @@ public class ClubService : IEService, IClubService
|
||||||
return ClubLeaveResult.Success;
|
return ClubLeaveResult.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool SetDescription(ulong userId, string desc)
|
public bool SetDescription(ulong userId, string? desc)
|
||||||
{
|
{
|
||||||
using var uow = _db.GetDbContext();
|
using var uow = _db.GetDbContext();
|
||||||
var club = uow.Set<ClubInfo>().GetByOwner(userId);
|
var club = uow.Set<ClubInfo>().GetByOwner(userId);
|
||||||
|
|
|
@ -12,8 +12,6 @@ public interface IClubService
|
||||||
Task<SetClubIconResult> SetClubIconAsync(ulong ownerUserId, string? url);
|
Task<SetClubIconResult> SetClubIconAsync(ulong ownerUserId, string? url);
|
||||||
bool GetClubByName(string clubName, out ClubInfo club);
|
bool GetClubByName(string clubName, out ClubInfo club);
|
||||||
ClubApplyResult ApplyToClub(IUser user, ClubInfo club);
|
ClubApplyResult ApplyToClub(IUser user, ClubInfo club);
|
||||||
ClubAcceptResult AcceptApplication(ulong clubOwnerUserId, string userName, out DiscordUser discordUser);
|
|
||||||
ClubDenyResult RejectApplication(ulong clubOwnerUserId, string userName, out DiscordUser discordUser);
|
|
||||||
ClubInfo? GetClubWithBansAndApplications(ulong ownerUserId);
|
ClubInfo? GetClubWithBansAndApplications(ulong ownerUserId);
|
||||||
ClubLeaveResult LeaveClub(IUser user);
|
ClubLeaveResult LeaveClub(IUser user);
|
||||||
bool SetDescription(ulong userId, string? desc);
|
bool SetDescription(ulong userId, string? desc);
|
||||||
|
|
Loading…
Reference in a new issue