-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
715 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using GB28181.XML; | ||
using GBWeb.Attribute; | ||
using GBWeb.Models; | ||
using Microsoft.AspNetCore.Mvc; | ||
using SipServer.Models.JT; | ||
|
||
namespace GBWeb.Controllers | ||
{ | ||
/// <summary> | ||
/// JT1078转GB28181接口 | ||
/// </summary> | ||
[Route("api/[controller]/[action]")] | ||
[ApiController, AuthApi] | ||
public class JT2GBController : ControllerBase | ||
{ | ||
/// <summary> | ||
/// JT1078车机上线/心跳通知(批量) | ||
/// </summary> | ||
/// <param name="lst"></param> | ||
/// <returns></returns> | ||
[HttpPost] | ||
public async Task<ApiResult> Online(List<JTItem> lst) | ||
{ | ||
try | ||
{ | ||
await Program.sipServer.JT2GB.AddJTItems(lst); | ||
|
||
return new ApiResult(200); | ||
} | ||
catch | ||
{ | ||
return new ApiResult(500) { message = "err" }; | ||
} | ||
} | ||
/// <summary> | ||
/// JT1078车机下线通知(批量) | ||
/// </summary> | ||
/// <param name="lst"></param> | ||
/// <returns></returns> | ||
[HttpPost] | ||
public async Task<ApiResult> Offline(List<JTKey> lst) | ||
{ | ||
try | ||
{ | ||
await Program.sipServer.JT2GB.RemoveJTItems(lst); | ||
|
||
return new ApiResult(200); | ||
} | ||
catch | ||
{ | ||
return new ApiResult(500) { message = "err" }; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,42 @@ | ||
using GB28181.Client; | ||
using GB28181.XML; | ||
using SipServer.JT2GB; | ||
using SipServer.Models; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace SipServer.Cascade | ||
{ | ||
|
||
/// <summary> | ||
/// 级联通道项 | ||
/// </summary> | ||
public class CascadeChannelItem : ChannelItem | ||
{ | ||
/// <summary> | ||
/// 级联KEY GUID | ||
/// </summary> | ||
public string SuperiorId; | ||
/// <summary> | ||
/// 设备ID | ||
/// </summary> | ||
public string DeviceId; | ||
/// <summary> | ||
/// 真实通道ID 如果上报自定义了会包含在CatalogItem.DeviceID里 | ||
/// </summary> | ||
public string ChannelId; | ||
/// <summary> | ||
/// 设备对象 | ||
/// </summary> | ||
public GBChannel GBChannel; | ||
/// <summary> | ||
/// 1078对象 不为null时表示此通道为1078转28181模式 | ||
/// </summary> | ||
public JT2GBChannel J2GChannel; | ||
|
||
public CascadeChannelItem(string SuperiorId, string DeviceId, string ChannelId, Catalog.Item CatalogItem) : base(CatalogItem) | ||
public CascadeChannelItem(string superiorId, string deviceId, string channelId, Catalog.Item catalogItem, JT2GBChannel j2gChannel) : base(catalogItem) | ||
{ | ||
this.SuperiorId = SuperiorId; | ||
this.ChannelId = ChannelId; | ||
this.DeviceId = DeviceId; | ||
this.SuperiorId = superiorId; | ||
this.ChannelId = channelId; | ||
this.DeviceId = deviceId; | ||
this.J2GChannel = j2gChannel; | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.