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#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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 保留所有权利。
* CLR版本4.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();
}
}
}