添加项目文件。

This commit is contained in:
2023-03-13 15:00:34 +08:00
parent 42bf06ca3e
commit 1d73df3235
1205 changed files with 185078 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
using JNPF.Common.Configuration;
using JNPF.DependencyInjection;
using JNPF.DynamicApiController;
using JNPF.Systems.Entitys.System;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
namespace JNPF.Apps;
/// <summary>
/// App版本信息
/// 版 本V3.3
/// 版 权拓通智联科技有限公司http://www.tuotong-tech.com
/// 日 期2022-04-07.
/// </summary>
[ApiDescriptionSettings(Tag = "App", Name = "Version", Order = 806)]
[Route("api/App/[controller]")]
public class AppVersion : IDynamicApiController, ITransient
{
/// <summary>
/// 服务基础仓储.
/// </summary>
private readonly ISqlSugarRepository<SysConfigEntity> _repository; // 系统设置
/// <summary>
/// 原始数据库.
/// </summary>
private readonly SqlSugarScope _db;
/// <summary>
/// 构造.
/// </summary>
/// <param name="sysConfigRepository"></param>
/// <param name="context"></param>
public AppVersion(
ISqlSugarRepository<SysConfigEntity> repository,
ISqlSugarClient context)
{
_repository = repository;
_db = (SqlSugarScope)context;
}
#region Get
/// <summary>
/// 版本信息.
/// </summary>
/// <returns></returns>
[HttpGet("")]
public async Task<dynamic> GetInfo()
{
SysConfigEntity? data = new SysConfigEntity();
if (KeyVariable.MultiTenancy)
{
data = await _db.Queryable<SysConfigEntity>().Where(x => x.Category.Equals("SysConfig") && x.Key == "sysVersion").FirstAsync();
}
else
{
data = await _repository.AsQueryable().Where(x => x.Category.Equals("SysConfig") && x.Key == "sysVersion").FirstAsync();
}
return new { sysVersion = data.Value };
}
#endregion
}