You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

134 lines
4.2 KiB
C#

2 months ago
using SlnMesnac.RfidUpload.Model;
using SlnMesnac.RfidUpload.Model.apiParam;
using System;
using System.Collections.Generic;
using System.Text;
using TouchSocket.Rpc;
using TouchSocket.WebApi;
#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
* (c) 2024 WenJY
* CLR4.0.30319.42000
* T14-GEN3-7895
* SlnMesnac.RfidUpload.TouchSocket
* f4ca948d-1fdb-4241-8251-2858f027de04
*
* WenJY
*
* 2024-07-02 15:42:57
* V1.0.0
*
*
*--------------------------------------------------------------------
*
*
*
*
* V1.0.0
*--------------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
namespace SlnMesnac.RfidUpload.TouchSocket
{
public partial class ApiServer : RpcServer
{
private static ApiServer instance;
private ApiServer() { }
public static ApiServer GetInstance()
{
if (instance == null)
{
lock (typeof(ApiServer))
{
if (instance == null)
{
instance = new ApiServer();
}
}
}
return instance;
}
public delegate void RefreshScanInfoInCenterStart();
/// <summary>
/// 入库开始事件刷新
/// </summary>
public event RefreshScanInfoInCenterStart RefreshScanInfoInCenterStartEvent;
public delegate void RefreshScanInfoInCenterStop();
/// <summary>
/// 入库结束事件刷新
/// </summary>
public event RefreshScanInfoInCenterStop RefreshScanInfoInCenterStopEvent;
public delegate void RefreshScanInfoOutCenterStart();
/// <summary>
/// 出库开始事件刷新
/// </summary>
public event RefreshScanInfoOutCenterStart RefreshScanInfoOutCenterStartEvent;
public delegate void RefreshScanInfoOutCenterStop();
/// <summary>
/// 出库结束事件刷新
/// </summary>
public event RefreshScanInfoOutCenterStop RefreshScanInfoOutCenterStopEvent;
/// <summary>
/// 入库开始
/// </summary>
/// <param name="messageHeader"></param>
/// <param name="containerRegisterQuery"></param>
/// <returns></returns>
[EnableCors("cors")]
[WebApi(HttpMethodType.POST)]
public ApiResult getScanInfoInCenterStart(string messageHeader,InStoreParam containerRegisterQuery)
{
RefreshScanInfoInCenterStartEvent?.Invoke();
return ApiResult.Success();
}
/// <summary>
/// 入库结束
/// </summary>
/// <param name="messageHeader"></param>
/// <param name="containerRegisterQuery"></param>
/// <returns></returns>
[EnableCors("cors")]
[WebApi(HttpMethodType.POST)]
public ApiResult getScanInfoInCenterStop(string messageHeader, InStoreParam containerRegisterQuery)
{
RefreshScanInfoInCenterStopEvent?.Invoke();
return ApiResult.Success();
}
/// <summary>
/// 出库开始
/// </summary>
/// <param name="messageHeader"></param>
/// <param name="containerRegisterQuery"></param>
/// <returns></returns>
[WebApi(HttpMethodType.POST)]
public ApiResult getScanInfoOutCenterStart(string messageHeader, OutStoreParam containerRegisterQuery)
{
RefreshScanInfoOutCenterStartEvent?.Invoke();
return ApiResult.Success();
}
/// <summary>
/// 出库结束
/// </summary>
/// <param name="messageHeader"></param>
/// <param name="containerRegisterQuery"></param>
/// <returns></returns>
[WebApi(HttpMethodType.POST)]
public ApiResult getScanInfoOutCenterStop(string messageHeader, OutStoreParam containerRegisterQuery)
{
RefreshScanInfoOutCenterStopEvent?.Invoke();
return ApiResult.Success();
}
}
}