TestService.cs 960 B

1234567891011121314151617181920212223242526272829303132333435
  1. using Admin.NET.Application.Const;
  2. using Admin.NET.Application.Entity;
  3. using Admin.NET.Core;
  4. using Furion.DependencyInjection;
  5. using Furion.DynamicApiController;
  6. using Microsoft.AspNetCore.Mvc;
  7. using System.Collections.Generic;
  8. using System.Threading.Tasks;
  9. namespace Admin.NET.Application.Serice
  10. {
  11. /// <summary>
  12. /// 自己业务服务
  13. /// </summary>
  14. [ApiDescriptionSettings(TestConst.GroupName, Name = "XXX模块", Order = 200)]
  15. public class TestService : IDynamicApiController, ITransient
  16. {
  17. private readonly SqlSugarRepository<Test> _testRep;
  18. public TestService(SqlSugarRepository<Test> testRep)
  19. {
  20. _testRep = testRep;
  21. }
  22. /// <summary>
  23. /// 获取列表
  24. /// </summary>
  25. /// <returns></returns>
  26. [HttpGet("/test/list")]
  27. public async Task<List<Test>> GetTestList()
  28. {
  29. return await _testRep.GetListAsync();
  30. }
  31. }
  32. }