重构项目结构,移除Assignment相关功能,优化Submission模块
Some checks failed
TechAct / explore-gitea-actions (push) Failing after 12s

This commit is contained in:
SpecialX
2025-10-09 18:57:28 +08:00
parent 403b34a098
commit ac900159ba
289 changed files with 11948 additions and 20150 deletions

View File

@@ -1,12 +1,10 @@
using TechHelper.Context;
using TechHelper.Services;
using Entities.DTO;
using Microsoft.AspNetCore.Http;
using Entities.DTO;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using TechHelper.Features;
using Microsoft.AspNetCore.WebUtilities;
using Entities.Contracts;
using TechHelper.Services.Beta;
namespace TechHelper.Controllers
{
@@ -19,9 +17,9 @@ namespace TechHelper.Controllers
public class AccountController : ControllerBase
{
private readonly UserManager<User> _userManager;
private readonly IUserRegistrationService _userRegistrationService;
private IAuthenticationService _authenticationService;
private readonly IEmailSender _emailSender;
private readonly IUserSerivces _userSerivces;
/// <summary>
/// 初始化账户控制器
@@ -31,13 +29,13 @@ namespace TechHelper.Controllers
/// <param name="emailSender">邮件发送服务</param>
/// <param name="authenticationService">认证服务</param>
public AccountController(UserManager<User> userManager,
IUserRegistrationService userRegistrationService,
IEmailSender emailSender,
IUserSerivces userSerivces,
IAuthenticationService authenticationService)
{
_userManager = userManager;
this._userRegistrationService = userRegistrationService;
_emailSender = emailSender;
_userSerivces = userSerivces;
_authenticationService = authenticationService;
}
@@ -98,7 +96,7 @@ namespace TechHelper.Controllers
if (!ModelState.IsValid)
return BadRequest(new ApiResponse(false, ModelState));
var response = await _userRegistrationService.RegisterNewUserAsync(userForRegistrationDto);
var response = await _userSerivces.RegisterNewUserAsync(userForRegistrationDto);
if (response.Status)
{
@@ -184,6 +182,17 @@ namespace TechHelper.Controllers
});
}
[HttpPost("initadmin")]
public async Task<IActionResult> InitAdmin([FromBody] UserForAdmin admin)
{
var result = await _userSerivces.InitAdminUser(admin);
if(result.Status)
{
return Ok(result.Message);
}
return BadRequest(result.Message);
}
/// <summary>
/// 生成两步验证的OTP令牌
/// </summary>