86 lines
2.9 KiB
C#
86 lines
2.9 KiB
C#
using System.Data;
|
|
using JNPF.Common.Core.Manager;
|
|
using JNPF.Common.Filter;
|
|
using JNPF.Common.Security;
|
|
using JNPF.DependencyInjection;
|
|
using JNPF.DynamicApiController;
|
|
using JNPF.Extras.Thirdparty.JSEngine;
|
|
using JNPF.JsonSerialization;
|
|
using JNPF.Logging.Attributes;
|
|
using JNPF.Systems.Entitys.Permission;
|
|
using JNPF.Systems.Entitys.System;
|
|
using JNPF.TaskScheduler;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Cors;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using SqlSugar;
|
|
|
|
namespace JNPF.Systems.Common;
|
|
|
|
/// <summary>
|
|
/// 测试接口.
|
|
/// </summary>
|
|
[ApiDescriptionSettings(Name = "Test", Order = 306)]
|
|
[Route("api")]
|
|
public class TestService : IDynamicApiController, ITransient
|
|
{
|
|
private readonly ISqlSugarRepository<UserEntity> _repository;
|
|
private readonly SqlSugarScope _sugar;
|
|
private readonly IDataBaseManager _databaseService;
|
|
|
|
public TestService(ISqlSugarRepository<UserEntity> repository, IDataBaseManager databaseService)
|
|
{
|
|
_repository = repository;
|
|
_sugar = (SqlSugarScope)repository.AsSugarClient();
|
|
_databaseService = databaseService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 用于健康检查应用程序
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpGet("heart-beat")]
|
|
[AllowAnonymous]
|
|
[IgnoreLog]
|
|
[DisableCors]
|
|
public async Task<dynamic> Heartbeat()
|
|
{
|
|
return await Task.FromResult<dynamic>(new { reply = "应用程序运行正常" });
|
|
}
|
|
|
|
[HttpGet("test")]
|
|
[AllowAnonymous]
|
|
[IgnoreLog]
|
|
[DisableCors]
|
|
public async Task<dynamic> test()
|
|
{
|
|
try
|
|
{
|
|
//var aaaaa= JsEngineUtil.AggreFunction("COUNT('1','1','1')").ToString();
|
|
//var xx = App.HttpContext.Request.Host.ToString();
|
|
//var sql = "SELECT TOP 1 [F_PARENTID],[F_PROCESSID],[F_ENCODE],[F_FULLNAME],[F_FLOWURGENT],[F_FLOWID],[F_FLOWCODE],[F_FLOWNAME],[F_FLOWTYPE],[F_FLOWCATEGORY],[F_FLOWFORM],[F_FLOWFORMCONTENTJSON],[F_FLOWTEMPLATEJSON],[F_FLOWVERSION],[F_STARTTIME],[F_ENDTIME],[F_THISSTEP],[F_THISSTEPID],[F_GRADE],[F_STATUS],[F_COMPLETION],[F_DESCRIPTION],[F_SORTCODE],[F_ISASYNC],[F_ISBATCH],[F_TASKNODEID],[F_TEMPLATEID],[F_REJECTDATAID],[F_DELEGATEUSER],[F_CREATORTIME],[F_CREATORUSERID],[F_ENABLEDMARK],[F_LastModifyTime],[F_LastModifyUserId],[F_DeleteMark],[F_DeleteTime],[F_DeleteUserId],[F_Id] FROM [FLOW_TASK] WHERE (( [F_DeleteMark] IS NULL ) AND ( [F_Id] = N'367536153122855173' ))";
|
|
//var darta = _sqlSugarRepository.AsSugarClient().Ado.SqlQuery<dynamic>(sql);
|
|
var data = await _repository.GetFirstAsync(a => true);
|
|
var json = App.GetService<IJsonSerializerProvider>();
|
|
return data;
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
|
|
public void xx(UserEntity user)
|
|
{
|
|
user.Account = "2312321";
|
|
|
|
}
|
|
|
|
public void xx1(UserEntity user)
|
|
{
|
|
user.Account = "2312321";
|
|
|
|
}
|
|
|
|
}
|