| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- using Business.Core.Utilities;
- using Business.Test;
- using Microsoft.AspNetCore.Mvc;
- using System.Collections.Generic;
- using System.Linq;
- using System.Reflection;
- using System.Threading.Tasks;
- namespace Business.Controllers
- {
- [Area("business")]
- [Route("api/business/test")]
- public class TestController: BusinessController
- {
- private readonly ITestAppService _testAppService;
- public TestController(ITestAppService testAppService)
- {
- _testAppService = testAppService;
- }
- [HttpGet]
- public async Task<string> GetAsync(string str)
- {
- return await _testAppService.TestApi(str);
- }
- [HttpGet]
- [Route("classes")]
- public List<string> GetClasses()
- {
- var theList = Assembly.GetExecutingAssembly().GetTypes()
- .Where(t => t.Namespace == "Business.Models.Test")
- .ToList();
- foreach (var the in theList)
- {
- var type = the.GetProperties();
- }
- return null;
- }
- [HttpGet]
- [Route("user-count")]
- public Task<long> GetUserCount()
- {
- NLogHelper.Default.WriteLog("TestController", "默认logger","");
- new NLogHelper("TestController").WriteLog("TestController", "自定义logger","");
- return _testAppService.GetUserCount();
- }
- //[HttpGet]
- //[Route("menu-tree")]
- //public Task<dynamic> GetMenuTree()
- //{
- // return _testAppService.GetMenuTree();
- //}
- }
- }
|