添加项目文件。

This commit is contained in:
SpecialX
2025-05-23 19:03:00 +08:00
parent 6fa7679fd3
commit d36fef2bbb
185 changed files with 13413 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
using Entities.DTO;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Net;
using TechHelper.Services;
namespace TechHelper.Server.Controllers
{
[Route("api/class")]
[ApiController]
public class ClassController : ControllerBase
{
private IClassService _classService;
public ClassController(IClassService classService)
{
_classService = classService;
}
[HttpPost("userRegiste")]
public async Task<IActionResult> UserRegisterToClass(
[FromBody] UserRegistrationToClassDto toClass)
{
var result = await _classService.UserRegister(toClass);
if(!result.Status) return BadRequest(result.Message);
return Ok();
}
[HttpPost("Create")]
public async Task<IActionResult> Create(
[FromBody] ClassDto classDto)
{
var result = await _classService.AddAsync(classDto);
if (!result.Status) return BadRequest(result.Message);
return Ok();
}
}
}