mirror of
https://github.com/SoDOff-Project/sodoff.git
synced 2025-10-11 16:28:50 -07:00
45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
using System.Reflection;
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using sodoff.Model;
|
|
using sodoff.Schema;
|
|
using sodoff.Services;
|
|
using sodoff.Util;
|
|
|
|
namespace sodoff.Controllers.Common;
|
|
public class ItemStoreController : Controller {
|
|
|
|
private readonly DBContext ctx;
|
|
private StoreService storeService;
|
|
public ItemStoreController(DBContext ctx, StoreService storeService) {
|
|
this.ctx = ctx;
|
|
this.storeService = storeService;
|
|
}
|
|
|
|
[HttpPost]
|
|
[Produces("application/xml")]
|
|
[Route("ItemStoreWebService.asmx/GetStore")]
|
|
public IActionResult GetStore([FromForm] string getStoreRequest) {
|
|
GetStoreRequest request = XmlUtil.DeserializeXml<GetStoreRequest>(getStoreRequest);
|
|
|
|
ItemsInStoreData[] stores = new ItemsInStoreData[request.StoreIDs.Length];
|
|
for (int i = 0; i < request.StoreIDs.Length; i++) {
|
|
stores[i] = storeService.GetStore(request.StoreIDs[i]);
|
|
}
|
|
|
|
GetStoreResponse response = new GetStoreResponse {
|
|
Stores = stores
|
|
};
|
|
|
|
return Ok(response);
|
|
}
|
|
|
|
[HttpPost]
|
|
//[Produces("application/xml")]
|
|
[Route("ItemStoreWebService.asmx/GetRankAttributeData")]
|
|
public IActionResult GetRankAttributeData() {
|
|
// TODO
|
|
return Ok(XmlUtil.ReadResourceXmlString("rankattrib"));
|
|
}
|
|
}
|