初始化

This commit is contained in:
2025-11-20 14:07:55 +08:00
commit b9b1ff5ed4
318 changed files with 42662 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using ViewModels;
using WebAPIServer.Models;
namespace WebAPIServer.Controllers
{
[Route("api/[controller]/[action]")]
[ApiController]
public class CompanyController : ControllerBase
{
[HttpPost()]
[Authorize()]
public ReturnInfo GetCompanyInfo([FromBody] QueryAll_Or_Single S)
{
ReturnInfo returnInfo = new ReturnInfo();
try
{
using (var q=new UtsManageContext())
{
if (S.IsAll)
{
returnInfo.isok = true;
returnInfo.response = q.TblUtsManageCompanies.ToList();
}
else
{
returnInfo.isok = true;
var a = q.TblUtsManageUsers.SingleOrDefault(A => A.Id == S.ID);
if (a != null)
{
returnInfo.response = a;
}
}
}
}
catch (Exception ex)
{
returnInfo.isok = false;
returnInfo.message = ex.Message;
}
return returnInfo;
}
}
}