| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- using System.Collections.Generic;
- using Microsoft.AspNetCore.Mvc;
- using Microsoft.Extensions.Logging;
- using MySystem.MainModels;
- using System.Linq;
- using Library;
- using LitJson;
- using System.Threading.Tasks;
- using System;
- namespace MySystem.Controllers
- {
- public class HomeController : Controller
- {
- private readonly ILogger<HomeController> _logger;
- public HomeController(ILogger<HomeController> logger)
- {
- _logger = logger;
- }
- public IActionResult Index()
- {
- return View();
- }
- public IActionResult Error()
- {
- string isapi = Request.Headers["Api"].ToString();
- if (isapi != "1")
- {
- if (Response.StatusCode == 500)
- {
- return Redirect("/public/errpage/pc/500.html");
- }
- else if (Response.StatusCode == 502)
- {
- return Redirect("/public/errpage/pc/502.html");
- }
- else if (Response.StatusCode == 404)
- {
- return Redirect("/public/errpage/pc/404.html");
- }
- }
- return View();
- }
- public string setFee(string merNo, string sn, decimal fee, int addRate = 0)
- {
- string content = PublicImportDataService.Instance.SetFee(merNo, sn, fee, addRate);
- JsonData obj = JsonMapper.ToObject(content);
- if (obj["code"].ToString() == "000000")
- {
- content += "|" + PublicImportDataService.Instance.Decrypt(obj["data"].ToString());
- }
- return content;
- }
- public string test()
- {
- List<string> list = new List<string>();
- foreach(string sub in list)
- {
- string url = "https://logic-executor-api.kexiaoshuang.com/noauth/prize/pushbyone?n=QUEUE_KXS_MACHINE_PRIZE_CONFIG_DIVISION&m=" + sub + "&ids=3";
- string content = function.GetWebRequest(url);
- }
- return "ok";
- }
- public ActionResult LogSelect()
- {
- return View();
- }
- public async Task<IList<IDictionary<string, string>>> LogSelectResult(string condi)
- {
- string[] condiList = condi.Split('|');
- string logstore = "connect-log";
- string topic = condiList[0];
- string keyword = condiList[1];
- string month = condiList[2];
- if(topic.EndsWith("推送消息"))
- {
- logstore = "spserver";
- }
- IList<IDictionary<string, string>> logs = await SLS.GetLogs(logstore, topic, "* and content: " + keyword, DateTimeOffset.Now.AddMonths(-int.Parse(month)));
- return logs;
- }
- }
- }
|