diff --git a/MilimoeWebAPI/Controllers/APIController.cs b/MilimoeWebAPI/Controllers/APIController.cs index c77de34..9147274 100644 --- a/MilimoeWebAPI/Controllers/APIController.cs +++ b/MilimoeWebAPI/Controllers/APIController.cs @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using Milimoe.FunGame.Core.Api.Transmittal; +using Milimoe.FunGame.WebAPI.Models; namespace Milimoe.FunGame.WebAPI.Controllers { @@ -12,8 +13,14 @@ namespace Milimoe.FunGame.WebAPI.Controllers public class APIController(SQLHelper sql, ILogger logger) : ControllerBase { [HttpPost("scadd")] - public string SCAdd(long uid, long group, double sc, int year = 0, int month = 0, string content = "") + public string SCAdd([FromBody] SCDTO dto) { + long uid = dto.UID; + long group = dto.Group; + double sc = dto.SC; + int year = dto.Year; + int month = dto.Month; + string content = dto.Content; string result = ""; if (year == 0) year = DateTime.Today.Year; if (month == 0) month = DateTime.Today.Month; diff --git a/MilimoeWebAPI/MilimoeWebAPI.csproj b/MilimoeWebAPI/MilimoeWebAPI.csproj index bd232d1..d24abb2 100644 --- a/MilimoeWebAPI/MilimoeWebAPI.csproj +++ b/MilimoeWebAPI/MilimoeWebAPI.csproj @@ -29,7 +29,6 @@ - diff --git a/MilimoeWebAPI/Models/SCDTO.cs b/MilimoeWebAPI/Models/SCDTO.cs new file mode 100644 index 0000000..98b975f --- /dev/null +++ b/MilimoeWebAPI/Models/SCDTO.cs @@ -0,0 +1,12 @@ +namespace Milimoe.FunGame.WebAPI.Models +{ + public class SCDTO + { + public long UID { get; set; } + public long Group { get; set; } + public double SC { get; set; } + public int Year { get; set; } = 0; + public int Month { get; set; } = 0; + public string Content { get; set; } = ""; + } +}