Browse Source

feat: CbCameraNode

master
fajiao 2 years ago
parent
commit
0ddf1a66f3
  1. 15
      Cis.Application/Cb/Common/CbInfo.cs
  2. 40
      Cis.Application/Cb/Entity/CbCameraNode.cs
  3. 34
      Cis.Application/Cb/Service/CbCameraNodeService.cs
  4. 57
      Cis.Application/Cis.Application.xml
  5. 2
      Cis.Core/Cis.Core.csproj
  6. 2
      Cis.Web.Core/Startup.cs
  7. 34
      Cis.Web.Entry/Program.cs

15
Cis.Application/Cb/Common/CbInfo.cs

@ -12,6 +12,11 @@ public class CbInfo
/// </summary> /// </summary>
public const string GroupName = "CameraBase"; public const string GroupName = "CameraBase";
/// <summary>
/// CbCameraNode Api 分组排序
/// </summary>
public const int CbCameraNodeGroupOrder = 100;
/// <summary> /// <summary>
/// CbCamera Api 分组排序 /// CbCamera Api 分组排序
/// </summary> /// </summary>
@ -35,6 +40,16 @@ public class CbInfo
#region Table Info #region Table Info
/// <summary>
/// CbCameraNode 表名
/// </summary>
public const string CbCameraNodeTbName = "cb_camera_node";
/// <summary>
/// CbCameraNode 表描述
/// </summary>
public const string CbCameraNodeTbDesc = "相机节点表";
/// <summary> /// <summary>
/// CbCamera 表名 /// CbCamera 表名
/// </summary> /// </summary>

40
Cis.Application/Cb/Entity/CbCameraNode.cs

@ -0,0 +1,40 @@
namespace Cis.Application.Cb;
/// <summary>
/// 相机节点表
/// </summary>
[SugarTable(CbInfo.CbCameraNodeTbName, CbInfo.CbCameraNodeTbDesc)]
[Tenant(CbInfo.DbName)]
public class CbCameraNode : EntityBase
{
/// <summary>
/// 组标识
/// </summary>
[SugarColumn(ColumnDescription = "组标识")]
public bool IsGroup { get; set; }
/// <summary>
/// 名称
/// </summary>
[SugarColumn(ColumnDescription = "名称", Length = 64)]
[Required, MaxLength(64)]
public string Name { get; set; }
/// <summary>
/// 相机 Id
/// </summary>
[SugarColumn(ColumnDescription = "相机Id")]
public long CbCameraId { get; set; }
/// <summary>
/// 父节点 Id
/// </summary>
[SugarColumn(ColumnDescription = "父节点Id")]
public long ParentId { get; set; }
/// <summary>
/// 子节点列表
/// </summary>
[SugarColumn(IsIgnore = true)]
public List<CbCameraNode> Child { get; set; }
}

34
Cis.Application/Cb/Service/CbCameraNodeService.cs

@ -0,0 +1,34 @@
using Cis.Core.Common;
using Newtonsoft.Json.Linq;
namespace Cis.Application.Cb;
/// <summary>
/// 相机节点服务
/// </summary>
[ApiDescriptionSettings(CbInfo.GroupName, Order = CbInfo.CbCameraNodeGroupOrder)]
public class CbCameraNodeService : ServiceBase<CbCameraNode>, ITransient
{
public CbCameraNodeService(SqlSugarRepository<CbCameraNode> baseRep) : base(baseRep)
{
}
/// <summary>
/// 获取树
/// </summary>
/// <param name="queryJson">equal:ParentId(default:0);</param>
/// <returns></returns>
[HttpGet]
public virtual async Task<List<CbCameraNode>> GetTree(string queryJson = "")
{
JObject queryObj = queryJson.ToJObject();
queryObj.TryAdd("ParentId", 0);
long parentId = (long)queryObj.GetValue("ParentId");
var tree = await _baseRep.AsQueryable()
.OrderBy(it => it.CreateTime)
.ToTreeAsync(it => it.Child, it => it.ParentId, parentId);
return tree;
}
}

57
Cis.Application/Cis.Application.xml

@ -14,6 +14,11 @@
Api 分组名 Api 分组名
</summary> </summary>
</member> </member>
<member name="F:Cis.Application.Cb.CbInfo.CbCameraNodeGroupOrder">
<summary>
CbCameraNode Api 分组排序
</summary>
</member>
<member name="F:Cis.Application.Cb.CbInfo.CbCameraGroupOrder"> <member name="F:Cis.Application.Cb.CbInfo.CbCameraGroupOrder">
<summary> <summary>
CbCamera Api 分组排序 CbCamera Api 分组排序
@ -29,6 +34,16 @@
数据库标识 数据库标识
</summary> </summary>
</member> </member>
<member name="F:Cis.Application.Cb.CbInfo.CbCameraNodeTbName">
<summary>
CbCameraNode 表名
</summary>
</member>
<member name="F:Cis.Application.Cb.CbInfo.CbCameraNodeTbDesc">
<summary>
CbCameraNode 表描述
</summary>
</member>
<member name="F:Cis.Application.Cb.CbInfo.CbCameraTbName"> <member name="F:Cis.Application.Cb.CbInfo.CbCameraTbName">
<summary> <summary>
CbCamera 表名 CbCamera 表名
@ -99,6 +114,36 @@
相机参数 Id 相机参数 Id
</summary> </summary>
</member> </member>
<member name="T:Cis.Application.Cb.CbCameraNode">
<summary>
相机节点表
</summary>
</member>
<member name="P:Cis.Application.Cb.CbCameraNode.IsGroup">
<summary>
组标识
</summary>
</member>
<member name="P:Cis.Application.Cb.CbCameraNode.Name">
<summary>
名称
</summary>
</member>
<member name="P:Cis.Application.Cb.CbCameraNode.CbCameraId">
<summary>
相机 Id
</summary>
</member>
<member name="P:Cis.Application.Cb.CbCameraNode.ParentId">
<summary>
父节点 Id
</summary>
</member>
<member name="P:Cis.Application.Cb.CbCameraNode.Child">
<summary>
子节点列表
</summary>
</member>
<member name="T:Cis.Application.Cb.CbCameraParams"> <member name="T:Cis.Application.Cb.CbCameraParams">
<summary> <summary>
相机参数表 相机参数表
@ -139,6 +184,18 @@
zoom变化函数 zoom变化函数
</summary> </summary>
</member> </member>
<member name="T:Cis.Application.Cb.CbCameraNodeService">
<summary>
相机节点服务
</summary>
</member>
<member name="M:Cis.Application.Cb.CbCameraNodeService.GetTree(System.String)">
<summary>
获取树
</summary>
<param name="queryJson">equal:ParentId(default:0);</param>
<returns></returns>
</member>
<member name="T:Cis.Application.Cb.CbCameraParamsService"> <member name="T:Cis.Application.Cb.CbCameraParamsService">
<summary> <summary>
相机参数服务 相机参数服务

2
Cis.Core/Cis.Core.csproj

@ -34,6 +34,6 @@
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" /> <PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
</ItemGroup> </ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties /></VisualStudio></ProjectExtensions> <ProjectExtensions><VisualStudio><UserProperties coreconfig_1json__JsonSchema="https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json" /></VisualStudio></ProjectExtensions>
</Project> </Project>

2
Cis.Web.Core/Startup.cs

@ -66,7 +66,7 @@ public class Startup : AppStartup
// 日志记录 // 日志记录
if (App.GetConfig<bool>("Logging:File:Enabled")) // 日志写入文件 if (App.GetConfig<bool>("Logging:File:Enabled")) // 日志写入文件
{ {
Array.ForEach(new[] { LogLevel.Information, LogLevel.Warning, LogLevel.Error }, logLevel => Array.ForEach(new[] { LogLevel.Information, LogLevel.Warning, LogLevel.Error, LogLevel.Critical }, logLevel =>
{ {
services.AddFileLogging(options => services.AddFileLogging(options =>
{ {

34
Cis.Web.Entry/Program.cs

@ -1,23 +1,15 @@
using Furion.Logging;
// 处理未捕获的异常
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
// 启动 webServer // 启动 webServer
Serve.Run(RunOptions.Default.AddWebComponent<WebComponent>().WithArgs(args)); Serve.Run(RunOptions.Default.WithArgs(args));
void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
Log.Error(sender?.ToString(), e);
}
public class WebComponent : IWebComponent //Serve.Run(RunOptions.Default.AddWebComponent<WebComponent>().WithArgs(args));
{ //public class WebComponent : IWebComponent
public void Load(WebApplicationBuilder builder, ComponentContext componentContext) //{
{ // public void Load(WebApplicationBuilder builder, ComponentContext componentContext)
// 日志过滤 // {
builder.Logging.AddFilter((provider, category, logLevel) => // // ÈÕÖ¾¹ýÂË
{ // builder.Logging.AddFilter((provider, category, logLevel) =>
return !new[] { "Microsoft.Hosting", "Microsoft.AspNetCore" }.Any(u => category.StartsWith(u)) && logLevel >= LogLevel.Information; // {
}); // return !new[] { "Microsoft.Hosting", "Microsoft.AspNetCore" }.Any(u => category.StartsWith(u)) && logLevel >= LogLevel.Information;
} // });
} // }
//}
Loading…
Cancel
Save