1
This commit is contained in:
@@ -4,6 +4,6 @@
|
||||
"ip": "localhost",
|
||||
"port": 6379,
|
||||
"password": "05jWEoJa8v",
|
||||
"RedisConnectionString": "{0}:{1},password={2}, poolsize=500,ssl=false,defaultDatabase=6"
|
||||
"RedisConnectionString": "{0}:{1},password={2}, poolsize=500,ssl=false,defaultDatabase=7"
|
||||
}
|
||||
}
|
||||
65
system/Tnb.Systems/Common/SampleService.cs
Normal file
65
system/Tnb.Systems/Common/SampleService.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Aspose.Cells;
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.VisualDev;
|
||||
using JNPF.VisualDev.Entitys.Dto.VisualDevModelData;
|
||||
using JNPF.VisualDev.Entitys;
|
||||
using JNPF.VisualDev.Interfaces;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.Util;
|
||||
using SqlSugar;
|
||||
using JNPF.Systems.Entitys.Permission;
|
||||
using Mapster;
|
||||
using JNPF.Common.Filter;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace Tnb.BasicData
|
||||
{
|
||||
/// <summary>
|
||||
/// 应急管理局:安全生产监管
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Name = "Test", Order = 306)]
|
||||
[Route("api")]
|
||||
[OverideVisualDev(ModelId)]
|
||||
public partial class SampleService : IOverideVisualDevService, IDynamicApiController, ITransient
|
||||
{
|
||||
//要重写默认接口的功能Id,关联的是在线开发-功能设计里功能
|
||||
private const string ModelId = "377972195550300357";
|
||||
private readonly ISqlSugarRepository<UserEntity> _repository;
|
||||
private readonly IUserManager _userManager;
|
||||
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
|
||||
|
||||
public SampleService(
|
||||
IUserManager userManager,
|
||||
ISqlSugarRepository<UserEntity> repository)
|
||||
{
|
||||
_userManager = userManager;
|
||||
_repository = repository;
|
||||
//要重写的默认接口
|
||||
OverideFuncs.GetListAsync = GetList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取数据列表.
|
||||
/// </summary>
|
||||
/// <param name="input">分页查询条件.</param>
|
||||
/// <returns></returns>
|
||||
private async Task<dynamic> GetList(VisualDevModelListQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
var ls = await db.Queryable<UserEntity>().Where(a => a.DeleteMark == null).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
return new PageResult<UserEntity>
|
||||
{
|
||||
pagination = ls.pagination.Adapt<JNPF.Common.Filter.PageResult>(),
|
||||
list = ls.list.ToList()
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -318,15 +318,7 @@ public class DbLinkService : IDbLinkService, IDynamicApiController, ITransient
|
||||
[NonAction]
|
||||
public async Task<DbLinkEntity> GetInfo(string id)
|
||||
{
|
||||
//modified by ly on 20230417
|
||||
var model = await _repository.AsSugarClient().CopyNew().Queryable<DbLinkEntity>().FirstAsync(m => m.Id == id && m.DeleteMark == null);
|
||||
//await _memCache.GetOrCreateAsync($"DbLink_{id}", async entry =>
|
||||
//{
|
||||
// //entry.AbsoluteExpiration = DateTime.Now.AddMinutes(60);
|
||||
// //entry.SlidingExpiration = TimeSpan.FromSeconds(-1);
|
||||
// return await _repository.AsSugarClient().CopyNew().Queryable<DbLinkEntity>().FirstAsync(m => m.Id == id && m.DeleteMark == null);
|
||||
//});
|
||||
return model;
|
||||
return await _repository.AsSugarClient().CopyNew().Queryable<DbLinkEntity>().FirstAsync(m => m.Id == id && m.DeleteMark == null);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
@@ -1513,7 +1513,7 @@ public class CodeGenService : IDynamicApiController, ITransient
|
||||
IsFixed = frondEndGenConfig.IsFixed,
|
||||
}, builderAction: builder =>
|
||||
{
|
||||
builder.AddUsing("Tnb.VisualDev.Engine.Model.CodeGen");
|
||||
builder.AddUsing("JNPF.VisualDev.Engine.Model.CodeGen");
|
||||
builder.AddAssemblyReferenceByName("Tnb.VisualDev.Engine");
|
||||
});
|
||||
var dirPath = new DirectoryInfo(targetPathList[i]).Parent.FullName;
|
||||
|
||||
Reference in New Issue
Block a user