添加 dto
This commit is contained in:
parent
67e907e6c8
commit
cdf3fad718
@ -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<APIController> 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;
|
||||
|
||||
@ -29,7 +29,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Models\" />
|
||||
<Folder Include="Services\" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
12
MilimoeWebAPI/Models/SCDTO.cs
Normal file
12
MilimoeWebAPI/Models/SCDTO.cs
Normal file
@ -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; } = "";
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user