using Dilon.Core; using Furion.DependencyInjection; using Furion.DynamicApiController; using Furion.Snowflake; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using SqlSugar; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace Dilon.Application { /// /// 业务服务及集成SqlSugar用法事例 /// public class TestService : ITestService, IDynamicApiController, ITransient { //private readonly ISqlSugarRepository _testRep; //private readonly SqlSugarClient _db; // SqlSugar对象 public TestService(/*ISqlSugarRepository sqlSugarRep*/) { //_testRep = sqlSugarRep; //_db = (SqlSugarClient)_testRep.Context; } /// /// 测试方法 /// /// [HttpPost("/test")] public string GetDescription() { return "Admin.NET"; } ///// ///// 增加数据 ///// ///// //[HttpPost("/test/add")] //public async Task AddTestAsync() //{ // var test = new Test() // { // Id = IDGenerator.NextId(), // Name = "Admin.NET", // Age = 1, // CreateTime = DateTimeOffset.Now // }; // await _testRep.InsertAsync(test); // // _db.Insertable(test).ExecuteCommand(); //} ///// ///// 查询所有 ///// ///// //[HttpPost("/test/page")] //public async Task> GetTestListAsync() //{ // return await _testRep.Entities.ToListAsync(); //} ///// ///// 查询系统用户 ///// ///// //[HttpPost("/test/userPage")] //public async Task GetUserListAsync() //{ // return await _db.Queryable().ToListAsync(); //} } }