mirror of
https://github.com/SoDOff-Project/sodoff.git
synced 2025-10-11 16:28:50 -07:00
38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using System.Reflection;
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using sodoff.Model;
|
|
using sodoff.Util;
|
|
|
|
namespace sodoff.Controllers.Common;
|
|
public class ItemStoreController : Controller {
|
|
|
|
private readonly DBContext ctx;
|
|
public ItemStoreController(DBContext ctx) {
|
|
this.ctx = ctx;
|
|
}
|
|
|
|
[HttpPost]
|
|
//[Produces("application/xml")]
|
|
[Route("ItemStoreWebService.asmx/GetStore")]
|
|
public IActionResult GetStore() {
|
|
// TODO, this may be implemented enough, but may not be
|
|
var assembly = Assembly.GetExecutingAssembly();
|
|
string resourceName = assembly.GetManifestResourceNames().Single(str => str.EndsWith("store.xml"));
|
|
|
|
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
|
|
using (StreamReader reader = new StreamReader(stream)) {
|
|
string result = reader.ReadToEnd();
|
|
return Ok(result);
|
|
}
|
|
}
|
|
|
|
[HttpPost]
|
|
//[Produces("application/xml")]
|
|
[Route("ItemStoreWebService.asmx/GetRankAttributeData")]
|
|
public IActionResult GetRankAttributeData() {
|
|
// TODO
|
|
return Ok(XmlUtil.ReadResourceXmlString("rankattrib"));
|
|
}
|
|
}
|