修复一些问题
This commit is contained in:
parent
971d011469
commit
002aa92d0b
40
Directory.Packages.props
Normal file
40
Directory.Packages.props
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||||
|
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
|
||||||
|
<NoWarn>$(NoWarn);NU1507</NoWarn>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageVersion Include="ChatGPT.Net" Version="2.0.0" />
|
||||||
|
<PackageVersion Include="EPPlus" Version="7.5.1" />
|
||||||
|
<PackageVersion Include="Flandre.Adapters.OneBot.Extensions" Version="2.0.0-rc.3" />
|
||||||
|
<PackageVersion Include="Flandre.Core" Version="1.0.0-rc.4" />
|
||||||
|
<PackageVersion Include="IGeekFan.AspNetCore.Knife4jUI" Version="0.0.16" />
|
||||||
|
<PackageVersion Include="MailKit" Version="4.3.0" />
|
||||||
|
<PackageVersion Include="Masuit.Tools.Abstractions" Version="2024.5.8" />
|
||||||
|
<PackageVersion Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.22.0" />
|
||||||
|
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.0" />
|
||||||
|
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.0" />
|
||||||
|
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="9.0.1" />
|
||||||
|
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="8.8.0" />
|
||||||
|
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="8.2.0" />
|
||||||
|
<PackageVersion Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
|
||||||
|
<PackageVersion Include="Mirai.Net" Version="2.5.1" />
|
||||||
|
<PackageVersion Include="MrHuo.OAuth.Core" Version="1.1.1" />
|
||||||
|
<PackageVersion Include="MrHuo.OAuth.Github" Version="1.1.1" />
|
||||||
|
<PackageVersion Include="MrHuo.OAuth.Microsoft" Version="1.1.1" />
|
||||||
|
<PackageVersion Include="NLog" Version="5.2.4" />
|
||||||
|
<PackageVersion Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.0" />
|
||||||
|
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
|
||||||
|
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
|
||||||
|
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
|
||||||
|
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
|
||||||
|
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.9.0" />
|
||||||
|
<PackageVersion Include="RestSharp" Version="106.12.0" />
|
||||||
|
<PackageVersion Include="Scalar.AspNetCore" Version="2.0.4" />
|
||||||
|
<PackageVersion Include="SkiaSharp" Version="2.88.8" />
|
||||||
|
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.5.0" />
|
||||||
|
<PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="8.1.0" />
|
||||||
|
<PackageVersion Include="Zack.EventBus" Version="1.1.3" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
@ -1,22 +1,18 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<IsAspireSharedProject>true</IsAspireSharedProject>
|
<IsAspireSharedProject>true</IsAspireSharedProject>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Http.Resilience" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.8.0" />
|
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" />
|
||||||
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="8.2.0" />
|
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" />
|
||||||
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
|
<PackageReference Include="OpenTelemetry.Extensions.Hosting" />
|
||||||
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
|
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" />
|
||||||
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
|
<PackageReference Include="OpenTelemetry.Instrumentation.Http" />
|
||||||
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
|
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" />
|
||||||
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.9.0" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
</Project>
|
|
@ -15,6 +15,9 @@ using Flandre.Core.Common;
|
|||||||
|
|
||||||
namespace asg_form.Controllers
|
namespace asg_form.Controllers
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
public class TaskDB
|
public class TaskDB
|
||||||
{
|
{
|
||||||
public long id { get; set; }
|
public long id { get; set; }
|
||||||
|
@ -12,6 +12,9 @@ namespace asg_form.Controllers
|
|||||||
public string user_name { get; set; }
|
public string user_name { get; set; }
|
||||||
//.....
|
//.....
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
public class BlackController : ControllerBase
|
public class BlackController : ControllerBase
|
||||||
{
|
{
|
||||||
[Route("api/v1/blackTable")]
|
[Route("api/v1/blackTable")]
|
||||||
|
@ -29,6 +29,8 @@ namespace asg_form.Controllers.Budget
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
public class BgCountController : ControllerBase
|
public class BgCountController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly RoleManager<Role> roleManager;
|
private readonly RoleManager<Role> roleManager;
|
||||||
|
@ -7,6 +7,9 @@ using System.Security.Claims;
|
|||||||
|
|
||||||
namespace asg_form.Controllers
|
namespace asg_form.Controllers
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
public class Champion : ControllerBase
|
public class Champion : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly RoleManager<Role> roleManager;
|
private readonly RoleManager<Role> roleManager;
|
||||||
|
@ -15,6 +15,9 @@ using static asg_form.Controllers.schedule;
|
|||||||
|
|
||||||
namespace asg_form.Controllers
|
namespace asg_form.Controllers
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
public class Com : ControllerBase
|
public class Com : ControllerBase
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -90,7 +93,17 @@ namespace asg_form.Controllers
|
|||||||
}
|
}
|
||||||
return BadRequest(new error_mb { code = 400, message = $"你是{user.officium},你不是解说,无法操作" });
|
return BadRequest(new error_mb { code = 400, message = $"你是{user.officium},你不是解说,无法操作" });
|
||||||
}
|
}
|
||||||
|
public static long cut_value(long value)
|
||||||
|
{
|
||||||
|
long _value = value;
|
||||||
|
value = value - 5;
|
||||||
|
if (value < 0)
|
||||||
|
{
|
||||||
|
throw new ArgumentException("你已经没钱啦!");
|
||||||
|
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
public static int[] ConvertStringToIntArray(string input)
|
public static int[] ConvertStringToIntArray(string input)
|
||||||
{
|
{
|
||||||
var cleanedInput = input.Trim('[', ']').Replace("'", "");
|
var cleanedInput = input.Trim('[', ']').Replace("'", "");
|
||||||
@ -101,6 +114,38 @@ namespace asg_form.Controllers
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//写一个api,获取选班数前十的名单
|
||||||
|
[Route("api/v1/com/Integral/ranking")]
|
||||||
|
[HttpPost]
|
||||||
|
[Authorize]
|
||||||
|
[ResponseCache(Duration = 500)]
|
||||||
|
public async Task<ActionResult<object>> ranking()
|
||||||
|
{
|
||||||
|
using(TestDbContext testDb = new TestDbContext()) {
|
||||||
|
var user = await userManager.FindByNameAsync(this.User.Identity!.Name!);
|
||||||
|
if (user.officium != "Anchor")
|
||||||
|
{
|
||||||
|
return Ok(new error_mb { code = 401, message = $"你是{user.officium},你不是导播,无法操作" });
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//对testDb.team_Games.commentary中出现最多的十个解说名称进行排名
|
||||||
|
var ranking = testDb.team_Games.SelectMany(g => JsonConvert.DeserializeObject<List<com_json>>(g.commentary).Select(c => c.chinaname))
|
||||||
|
.GroupBy(c => c)
|
||||||
|
.OrderByDescending(g => g.Count())
|
||||||
|
.Take(10)
|
||||||
|
.Select(g => new { Name = g.Key, Count = g.Count() })
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
return ranking;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 导播选定场次
|
/// 导播选定场次
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -288,27 +333,17 @@ namespace asg_form.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Route("api/v1/com/Integral/ranking")]
|
[Route("api/v1/com/Integral/ranking1")]
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
[ResponseCache(Duration = 60)]
|
[ResponseCache(Duration = 60)]
|
||||||
public async Task<ActionResult<object>> ranking()
|
public async Task<ActionResult<object>> ranking1()
|
||||||
{
|
{
|
||||||
object user= await userManager.Users.OrderByDescending(a => a.Integral).Select(a=>new{a.Id,a.chinaname,a.Integral}).Take(10).ToListAsync();
|
object user= await userManager.Users.OrderByDescending(a => a.Integral).Select(a=>new{a.Id,a.chinaname,a.Integral}).Take(10).ToListAsync();
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long cut_value(long value)
|
|
||||||
{
|
|
||||||
long _value = value;
|
|
||||||
value = value - 5;
|
|
||||||
if (value < 0)
|
|
||||||
{
|
|
||||||
throw new ArgumentException("你已经没钱啦!");
|
|
||||||
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
[Route("api/v1/com/")]
|
[Route("api/v1/com/")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
@ -328,6 +363,7 @@ namespace asg_form.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,6 +7,9 @@ using static asg_form.Controllers.excel;
|
|||||||
|
|
||||||
namespace asg_form.Controllers
|
namespace asg_form.Controllers
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
public class Events : ControllerBase
|
public class Events : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly RoleManager<Role> roleManager;
|
private readonly RoleManager<Role> roleManager;
|
||||||
|
@ -17,6 +17,9 @@ using static System.Runtime.InteropServices.JavaScript.JSType;
|
|||||||
|
|
||||||
namespace asg_form.Controllers
|
namespace asg_form.Controllers
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
public class InviteReferee : ControllerBase
|
public class InviteReferee : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly RoleManager<Role> roleManager;
|
private readonly RoleManager<Role> roleManager;
|
||||||
|
@ -11,6 +11,9 @@ using System.Text;
|
|||||||
|
|
||||||
namespace asg_form.Controllers
|
namespace asg_form.Controllers
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
public class OAuthController : Controller
|
public class OAuthController : Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -7,6 +7,9 @@ using System.Security.Claims;
|
|||||||
|
|
||||||
namespace asg_form.Controllers.Store
|
namespace asg_form.Controllers.Store
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
public class Storehttp : ControllerBase
|
public class Storehttp : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly RoleManager<Role> roleManager;
|
private readonly RoleManager<Role> roleManager;
|
||||||
@ -72,7 +75,7 @@ namespace asg_form.Controllers.Store
|
|||||||
return Ok(storeinfo);
|
return Ok(storeinfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public long cut_value(long value,long money)
|
public static long cut_value(long value,long money)
|
||||||
{
|
{
|
||||||
long _value = value;
|
long _value = value;
|
||||||
value = value - money;
|
value = value - money;
|
||||||
|
@ -48,6 +48,9 @@ namespace asg_form.Controllers.Teamregistration
|
|||||||
public string reqRole { get; set; }
|
public string reqRole { get; set; }
|
||||||
public string introUrl { get; set; }
|
public string introUrl { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
public class RegisterController : ControllerBase
|
public class RegisterController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly RoleManager<Role> roleManager;
|
private readonly RoleManager<Role> roleManager;
|
||||||
|
@ -32,6 +32,8 @@ using System.Net;
|
|||||||
namespace asg_form.Controllers
|
namespace asg_form.Controllers
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
public class admin : ControllerBase
|
public class admin : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly RoleManager<Role> roleManager;
|
private readonly RoleManager<Role> roleManager;
|
||||||
|
@ -61,6 +61,9 @@ namespace asg_form.Controllers {
|
|||||||
public string flowConfig { get; set; }
|
public string flowConfig { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
public class auditAndFilingController : ControllerBase
|
public class auditAndFilingController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly RoleManager<Role> roleManager;
|
private readonly RoleManager<Role> roleManager;
|
||||||
|
@ -7,6 +7,9 @@ using static asg_form.Controllers.login;
|
|||||||
|
|
||||||
namespace asg_form.Controllers
|
namespace asg_form.Controllers
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
public class chatgpt : ControllerBase
|
public class chatgpt : ControllerBase
|
||||||
{
|
{
|
||||||
List<chatgptbot> allchatgpt=new List<chatgptbot>();
|
List<chatgptbot> allchatgpt=new List<chatgptbot>();
|
||||||
|
@ -9,6 +9,9 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace asg_form.Controllers
|
namespace asg_form.Controllers
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
public class comform : ControllerBase
|
public class comform : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly RoleManager<Role> roleManager;
|
private readonly RoleManager<Role> roleManager;
|
||||||
|
@ -12,6 +12,9 @@ using static System.Runtime.InteropServices.JavaScript.JSType;
|
|||||||
|
|
||||||
namespace asg_form.Controllers
|
namespace asg_form.Controllers
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
public class excel : ControllerBase
|
public class excel : ControllerBase
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -29,6 +29,8 @@ using System.Security.Claims;
|
|||||||
namespace asg_form.Controllers
|
namespace asg_form.Controllers
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
public class form_cs : ControllerBase
|
public class form_cs : ControllerBase
|
||||||
{
|
{
|
||||||
[Route("api/v3/form/all")]
|
[Route("api/v3/form/all")]
|
||||||
@ -173,32 +175,14 @@ namespace asg_form.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Route("[controller]")]
|
|
||||||
public class WeatherForecastController : ControllerBase
|
|
||||||
{
|
|
||||||
private static readonly string[] Summaries = new[]
|
|
||||||
{
|
|
||||||
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
private readonly ILogger<WeatherForecastController> _logger;
|
|
||||||
|
|
||||||
public WeatherForecastController(ILogger<WeatherForecastController> logger)
|
|
||||||
{
|
|
||||||
_logger = logger;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// [Route("api/updateform/")]
|
// [Route("api/updateform/")]
|
||||||
public class 提交表单 : ControllerBase
|
public class 提交表单 : ControllerBase
|
||||||
{
|
{
|
||||||
private static readonly string[] Summaries = new[]
|
|
||||||
{
|
|
||||||
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
|
|
||||||
};
|
|
||||||
|
|
||||||
public static void WriteFile(String str)
|
public static void WriteFile(String str)
|
||||||
{
|
{
|
||||||
@ -307,85 +291,6 @@ namespace asg_form.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 提交表单
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="for1">表单信息</param>
|
|
||||||
/// <param name="captoken">谷歌人机验证验证码</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[Route("api/v1/form/")]
|
|
||||||
[HttpPost]
|
|
||||||
public async Task<ActionResult<string>> PostAsync([FromBody] form_get for1,string captoken)
|
|
||||||
{
|
|
||||||
|
|
||||||
var client = new RestClient($"https://www.recaptcha.net/recaptcha/api/siteverify?secret=6LcdXUEmAAAAAJLICuxBgtMsDiMSCm5XpB0z-fzK&response={captoken}");
|
|
||||||
|
|
||||||
var request = new RestRequest(Method.POST);
|
|
||||||
IRestResponse response = client.Execute(request);
|
|
||||||
string tokenjson = response.Content;
|
|
||||||
JObject d = tokenjson.ToJObject();
|
|
||||||
string ok = d["success"].ToString();
|
|
||||||
|
|
||||||
|
|
||||||
if (ok == "True")
|
|
||||||
{
|
|
||||||
|
|
||||||
TestDbContext ctx = new TestDbContext();
|
|
||||||
if (ctx.Forms.Include(a=>a.events).Where(a=>a.events.name==for1.events_name).Any(e => e.team_name == for1.team_name))
|
|
||||||
{
|
|
||||||
return BadRequest(new error_mb { code = 400, message = "有重名队伍" });
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
base64toimg(for1.logo_base64, $@"{AppDomain.CurrentDomain.BaseDirectory}loge\{for1.events_name}\{for1.team_name}.png");
|
|
||||||
var events= await ctx.events.FirstAsync(ctx => ctx.name == for1.events_name);
|
|
||||||
|
|
||||||
|
|
||||||
form form1 = new form();
|
|
||||||
form1.logo_uri = $"https://124.223.35.239/loge/{for1.events_name}/{for1.team_name}.png";
|
|
||||||
form1.team_name = for1.team_name;
|
|
||||||
form1.team_password = for1.team_password;
|
|
||||||
form1.team_tel = for1.team_tel;
|
|
||||||
form1.events = events;
|
|
||||||
List<role> role = new List<role>();
|
|
||||||
foreach (role_get a in for1.role_get)
|
|
||||||
{
|
|
||||||
role.Add(new role { role_id = a.role_id, role_lin = a.role_lin, role_name = a.role_name,Common_Roles=a.Common_Roles,Historical_Ranks=a.Historical_Ranks,Id_Card=a.Id_Card,Game_Name=a.Game_Name,Phone_Number=a.Phone_Number,Id_Card_Name=a.Id_Card_Name });
|
|
||||||
}
|
|
||||||
form1.role = role;
|
|
||||||
|
|
||||||
ctx.Forms.Add(form1);
|
|
||||||
await ctx.SaveChangesAsync();
|
|
||||||
int nownumber = ctx.Forms.Count();
|
|
||||||
//ChatRoomHub chat = new ChatRoomHub();
|
|
||||||
// await chat.formok(nownumber, for1.team_name);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await hubContext.Clients.All.SendAsync("formok", $"队伍{for1.team_name}已经成功报名,剩余队伍名额:{ctx.Forms.Count()}/32");
|
|
||||||
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
logger.Info($"有新队伍报名!队伍名称:{for1.team_name} ");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return "ok!";
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
return BadRequest(new error_mb { code = 400, message = "人机验证未通过" });
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -482,29 +387,7 @@ namespace asg_form.Controllers
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void base64toimg(string base64,string path)
|
|
||||||
{
|
|
||||||
|
|
||||||
// 移除base64字符串开头的data URI标识部分(例如:data:image/png;base64)
|
|
||||||
if (base64.Contains(","))
|
|
||||||
base64 = base64.Split(',')[1];
|
|
||||||
|
|
||||||
byte[] imageBytes = Convert.FromBase64String(base64);
|
|
||||||
|
|
||||||
using (MemoryStream ms = new MemoryStream(imageBytes))
|
|
||||||
{
|
|
||||||
System.Drawing.Image image = System.Drawing.Image.FromStream(ms);
|
|
||||||
|
|
||||||
// 设置保存路径和文件名
|
|
||||||
string savePath = path;
|
|
||||||
|
|
||||||
// 根据文件扩展名决定图像格式
|
|
||||||
image.Save(savePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 上传队伍logo
|
/// 上传队伍logo
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -2,7 +2,5 @@
|
|||||||
|
|
||||||
namespace asg_form.Controllers.idvrole
|
namespace asg_form.Controllers.idvrole
|
||||||
{
|
{
|
||||||
//帮我写一个刚刚那个角色数据库的增删改查类
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,9 @@ using Manganese.Array;
|
|||||||
|
|
||||||
namespace asg_form.Controllers
|
namespace asg_form.Controllers
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
public class login : ControllerBase
|
public class login : ControllerBase
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -262,7 +265,7 @@ namespace asg_form.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 验证用户输入的验证码
|
// 验证用户输入的验证码
|
||||||
public bool ValidateCaptcha(string uid,string userInput)
|
public static bool ValidateCaptcha(string uid,string userInput)
|
||||||
{
|
{
|
||||||
using (var db = new TestDbContext())
|
using (var db = new TestDbContext())
|
||||||
{
|
{
|
||||||
@ -281,7 +284,7 @@ namespace asg_form.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void moveOutTimeData(string uid)
|
public static void moveOutTimeData(string uid)
|
||||||
{
|
{
|
||||||
using (var db = new TestDbContext())
|
using (var db = new TestDbContext())
|
||||||
{
|
{
|
||||||
|
@ -8,6 +8,9 @@ using static asg_form.Controllers.menuAssignController;
|
|||||||
|
|
||||||
namespace asg_form.Controllers
|
namespace asg_form.Controllers
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
public class menuAssignController : ControllerBase
|
public class menuAssignController : ControllerBase
|
||||||
{
|
{
|
||||||
public class menuDB
|
public class menuDB
|
||||||
|
@ -8,6 +8,9 @@ using System.Collections.Generic;
|
|||||||
|
|
||||||
namespace asg_form.Controllers
|
namespace asg_form.Controllers
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
public class 查询是否重名 : ControllerBase
|
public class 查询是否重名 : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly Logger _logger = LogManager.GetCurrentClassLogger();
|
private readonly Logger _logger = LogManager.GetCurrentClassLogger();
|
||||||
|
@ -10,6 +10,9 @@ using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
|
|||||||
|
|
||||||
namespace asg_form.Controllers
|
namespace asg_form.Controllers
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
public class news : ControllerBase
|
public class news : ControllerBase
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -14,6 +14,9 @@ using Mirai.Net.Data.Shared;
|
|||||||
|
|
||||||
namespace asg_form.Controllers
|
namespace asg_form.Controllers
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
public class schedule:ControllerBase
|
public class schedule:ControllerBase
|
||||||
{
|
{
|
||||||
private readonly RoleManager<Role> roleManager;
|
private readonly RoleManager<Role> roleManager;
|
||||||
@ -206,7 +209,7 @@ namespace asg_form.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
public byte[] GetPictureData(string imagePath)
|
public static byte[] GetPictureData(string imagePath)
|
||||||
{
|
{
|
||||||
FileStream fs = new FileStream(imagePath, FileMode.Open);
|
FileStream fs = new FileStream(imagePath, FileMode.Open);
|
||||||
byte[] byteData = new byte[fs.Length];
|
byte[] byteData = new byte[fs.Length];
|
||||||
|
@ -8,6 +8,9 @@ using static asg_form.blog;
|
|||||||
|
|
||||||
namespace asg_form.Controllers
|
namespace asg_form.Controllers
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
public class user_form : ControllerBase
|
public class user_form : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly RoleManager<Role> roleManager;
|
private readonly RoleManager<Role> roleManager;
|
||||||
|
@ -15,6 +15,9 @@ namespace asg_form.Controllers
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
public class WebsiteScreenshot
|
public class WebsiteScreenshot
|
||||||
{
|
{
|
||||||
public static async Task<byte[]> CaptureWebsiteAsync(string url)
|
public static async Task<byte[]> CaptureWebsiteAsync(string url)
|
||||||
|
@ -5,7 +5,6 @@ using Flandre.Adapters.OneBot.Extensions;
|
|||||||
using Flandre.Framework;
|
using Flandre.Framework;
|
||||||
using IGeekFan.AspNetCore.Knife4jUI;
|
using IGeekFan.AspNetCore.Knife4jUI;
|
||||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||||
using Microsoft.AspNetCore.Builder;
|
|
||||||
using Microsoft.AspNetCore.HttpOverrides;
|
using Microsoft.AspNetCore.HttpOverrides;
|
||||||
using Microsoft.AspNetCore.Identity;
|
using Microsoft.AspNetCore.Identity;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
@ -58,7 +57,7 @@ builder.Services.AddSwaggerGen(c =>
|
|||||||
var path = Path.Combine(AppContext.BaseDirectory, file);
|
var path = Path.Combine(AppContext.BaseDirectory, file);
|
||||||
c.IncludeXmlComments(path, true);
|
c.IncludeXmlComments(path, true);
|
||||||
c.OrderActionsBy(o => o.RelativePath);
|
c.OrderActionsBy(o => o.RelativePath);
|
||||||
|
|
||||||
var scheme = new OpenApiSecurityScheme()
|
var scheme = new OpenApiSecurityScheme()
|
||||||
{
|
{
|
||||||
Description = "Authorization header. \r\nExample: 'Bearer 12345abcdef'",
|
Description = "Authorization header. \r\nExample: 'Bearer 12345abcdef'",
|
||||||
@ -80,7 +79,7 @@ builder.Services.AddSwaggerGen(c =>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
string[] urls = new[] { "https://idvasg.cn", "https://nocdn.idvasg.cn", "http://localhost:8080" , "https://commentary.idvasg.cn", "https://admin.idvasg.cn", "https://www.idvasg.cn" };
|
string[] urls = new[] { "https://idvasg.cn", "https://nocdn.idvasg.cn", "http://localhost:8080", "https://commentary.idvasg.cn", "https://admin.idvasg.cn", "https://www.idvasg.cn" };
|
||||||
builder.Services.AddCors(options =>
|
builder.Services.AddCors(options =>
|
||||||
options.AddDefaultPolicy(builder => builder.WithOrigins(urls)
|
options.AddDefaultPolicy(builder => builder.WithOrigins(urls)
|
||||||
.AllowAnyMethod().AllowAnyHeader().AllowCredentials()));
|
.AllowAnyMethod().AllowAnyHeader().AllowCredentials()));
|
||||||
@ -159,12 +158,13 @@ var app = builder.Build();
|
|||||||
app.UseCors();
|
app.UseCors();
|
||||||
// Configure the HTTP request pipeline.
|
// Configure the HTTP request pipeline.
|
||||||
|
|
||||||
app.MapScalarApiReference(); // scalar/v1
|
app.UseSwagger();
|
||||||
app.MapOpenApi();
|
//app.UseSwaggerUI();
|
||||||
app.UseKnife4UI(c =>
|
app.MapScalarApiReference(options =>
|
||||||
{
|
{
|
||||||
c.RoutePrefix = string.Empty;
|
options.WithOpenApiRoutePattern("/swagger/v1/swagger.json");
|
||||||
c.SwaggerEndpoint($"/swagger/v1/swagger.json", "h.swagger.webapi v1");
|
// or
|
||||||
|
options.OpenApiRoutePattern = "/swagger/v1/swagger.json";
|
||||||
});
|
});
|
||||||
|
|
||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
@ -193,7 +193,7 @@ app.UseStaticFiles(new StaticFileOptions
|
|||||||
//发布时服务器注册静态资源
|
//发布时服务器注册静态资源
|
||||||
string fileUpload2 = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "doc");
|
string fileUpload2 = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "doc");
|
||||||
if (!Directory.Exists(fileUpload2))
|
if (!Directory.Exists(fileUpload2))
|
||||||
{ Directory.CreateDirectory(fileUpload2+"/rule"); }
|
{ Directory.CreateDirectory(fileUpload2 + "/rule"); }
|
||||||
app.UseStaticFiles(new StaticFileOptions
|
app.UseStaticFiles(new StaticFileOptions
|
||||||
{
|
{
|
||||||
FileProvider = new PhysicalFileProvider(fileUpload2),
|
FileProvider = new PhysicalFileProvider(fileUpload2),
|
||||||
@ -244,7 +244,7 @@ new Thread(o =>
|
|||||||
runbot.runbotr = app1.Bots.First();
|
runbot.runbotr = app1.Bots.First();
|
||||||
app1.Run();
|
app1.Run();
|
||||||
}
|
}
|
||||||
catch(Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
//输出详细全部信息
|
//输出详细全部信息
|
||||||
Console.WriteLine(ex.ToString());
|
Console.WriteLine(ex.ToString());
|
||||||
@ -252,7 +252,7 @@ new Thread(o =>
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net9.0</TargetFramework>
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
@ -14,67 +13,57 @@
|
|||||||
<EnableSdkContainerDebugging>True</EnableSdkContainerDebugging>
|
<EnableSdkContainerDebugging>True</EnableSdkContainerDebugging>
|
||||||
<ContainerBaseImage>mcr.microsoft.com/dotnet/aspnet:8.0</ContainerBaseImage>
|
<ContainerBaseImage>mcr.microsoft.com/dotnet/aspnet:8.0</ContainerBaseImage>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
<IsPublishable>True</IsPublishable>
|
<IsPublishable>True</IsPublishable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||||
<IsPublishable>True</IsPublishable>
|
<IsPublishable>True</IsPublishable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Remove="Controllers\PlayerC\**" />
|
<Compile Remove="Controllers\PlayerC\**" />
|
||||||
<Content Remove="Controllers\PlayerC\**" />
|
<Content Remove="Controllers\PlayerC\**" />
|
||||||
<EmbeddedResource Remove="Controllers\PlayerC\**" />
|
<EmbeddedResource Remove="Controllers\PlayerC\**" />
|
||||||
<None Remove="Controllers\PlayerC\**" />
|
<None Remove="Controllers\PlayerC\**" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="..\.editorconfig" Link=".editorconfig" />
|
<None Include="..\.editorconfig" Link=".editorconfig" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ChatGPT.Net" Version="2.0.0" />
|
<PackageReference Include="ChatGPT.Net" />
|
||||||
<PackageReference Include="EPPlus" Version="7.5.1" />
|
<PackageReference Include="EPPlus" />
|
||||||
<PackageReference Include="Flandre.Adapters.OneBot.Extensions" Version="2.0.0-rc.3" />
|
<PackageReference Include="Flandre.Adapters.OneBot.Extensions" />
|
||||||
<PackageReference Include="Flandre.Core" Version="1.0.0-rc.4" />
|
<PackageReference Include="Flandre.Core" />
|
||||||
<PackageReference Include="IGeekFan.AspNetCore.Knife4jUI" Version="0.0.16" />
|
<PackageReference Include="IGeekFan.AspNetCore.Knife4jUI" />
|
||||||
<PackageReference Include="MailKit" Version="4.3.0" />
|
<PackageReference Include="MailKit" />
|
||||||
<PackageReference Include="Masuit.Tools.Abstractions" Version="2024.5.8" />
|
<PackageReference Include="Masuit.Tools.Abstractions" />
|
||||||
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.22.0" />
|
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.1" />
|
<PackageReference Include="Microsoft.AspNetCore.OpenApi" />
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
|
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" />
|
||||||
<PackageReference Include="Mirai.Net" Version="2.5.1" />
|
<PackageReference Include="Mirai.Net" />
|
||||||
<PackageReference Include="MrHuo.OAuth.Core" Version="1.1.1" />
|
<PackageReference Include="MrHuo.OAuth.Core" />
|
||||||
<PackageReference Include="MrHuo.OAuth.Github" Version="1.1.1" />
|
<PackageReference Include="MrHuo.OAuth.Github" />
|
||||||
<PackageReference Include="MrHuo.OAuth.Microsoft" Version="1.1.1" />
|
<PackageReference Include="MrHuo.OAuth.Microsoft" />
|
||||||
<PackageReference Include="NLog" Version="5.2.4" />
|
<PackageReference Include="NLog" />
|
||||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.0" />
|
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" />
|
||||||
<PackageReference Include="RestSharp" Version="106.12.0" />
|
<PackageReference Include="RestSharp" />
|
||||||
<PackageReference Include="Scalar.AspNetCore" Version="2.0.4" />
|
<PackageReference Include="Scalar.AspNetCore" />
|
||||||
<PackageReference Include="SkiaSharp" Version="2.88.8" />
|
<PackageReference Include="SkiaSharp" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore" />
|
||||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="8.1.0" />
|
<PackageReference Include="System.IdentityModel.Tokens.Jwt" />
|
||||||
<PackageReference Include="Zack.EventBus" Version="1.1.3" />
|
<PackageReference Include="Zack.EventBus" />
|
||||||
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Controllers\Team\" />
|
<Folder Include="Controllers\Team\" />
|
||||||
<Folder Include="Model\" />
|
<Folder Include="Model\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ContainerPort Include="8081" />
|
<ContainerPort Include="8081" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Update="Dockerfile">
|
<None Update="Dockerfile">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
</Project>
|
|
Loading…
x
Reference in New Issue
Block a user