101 lines
3.5 KiB
C#
101 lines
3.5 KiB
C#
using DefaultNamespace;
|
||
using MotionFramework;
|
||
using System.Collections.Generic;
|
||
using UnityEngine;
|
||
|
||
namespace Zion.ERP.Inventory
|
||
{
|
||
/// <summary>
|
||
/// API接口配置类
|
||
/// 支持配置化管理和动态参数替换
|
||
/// </summary>
|
||
public static class ApiUrls
|
||
{
|
||
/// <summary>
|
||
/// 获取API接口URL(使用配置系统)
|
||
/// </summary>
|
||
/// <param name="endpointName">接口名称</param>
|
||
/// <param name="dynamicParams">动态参数</param>
|
||
/// <returns>完整的URL</returns>
|
||
public static string GetApiUrl(string endpointName, Dictionary<string, string> dynamicParams = null)
|
||
{
|
||
var configManager = MotionEngine.GetModule<ApiConfigManager>();
|
||
if (configManager != null && configManager.IsInitialized)
|
||
{
|
||
return configManager.GetApiUrl(endpointName, dynamicParams);
|
||
}
|
||
|
||
return "";
|
||
}
|
||
|
||
/// <summary>
|
||
/// 获取API接口配置
|
||
/// </summary>
|
||
/// <param name="endpointName">接口名称</param>
|
||
/// <returns>API接口配置</returns>
|
||
public static ApiEndpoint GetEndpoint(string endpointName)
|
||
{
|
||
try
|
||
{
|
||
var configManager = MotionEngine.GetModule<ApiConfigManager>();
|
||
return configManager?.GetEndpoint(endpointName);
|
||
}
|
||
catch (System.Exception ex)
|
||
{
|
||
Debug.LogError($"获取API配置失败:{ex.Message}");
|
||
return null;
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 中转库存相关API接口
|
||
/// 保持向后兼容性
|
||
/// </summary>
|
||
public static class TransitInventory
|
||
{
|
||
/// <summary>
|
||
/// 异常合同执行情况数据反馈_1行
|
||
/// </summary>
|
||
public static string GetErrorFeedbackContractExecutionData => GetApiUrl("GetErrorFeedbackContractExecutionData");
|
||
|
||
/// <summary>
|
||
/// 正确合同执行情况数据反馈_8行
|
||
/// </summary>
|
||
public static string GetOKFeedbackContractExecutionData => GetApiUrl("GetOKFeedbackContractExecutionData");
|
||
|
||
/// <summary>
|
||
/// 新注册仓库的主数据运维流程答题卡
|
||
/// </summary>
|
||
public static string GetWarehouseRegMasterOpsDataCard => GetApiUrl("GetWarehouseRegMasterOpsDataCard");
|
||
|
||
/// <summary>
|
||
/// 获取任务书和流程
|
||
/// </summary>
|
||
public static string GetProSimulationExaminationQueryById => GetApiUrl("GetProSimulationExaminationQueryById");
|
||
|
||
/// <summary>
|
||
/// 上传考试信息
|
||
/// </summary>
|
||
public static string AddSubmitDetail => GetApiUrl("AddSubmitDetail");
|
||
|
||
/// <summary>
|
||
/// 上传文件
|
||
/// </summary>
|
||
public static string UploadFileAndParam => GetApiUrl("UploadFileAndParam");
|
||
|
||
/// <summary>
|
||
/// 获取学习试题
|
||
/// </summary>
|
||
public static string GetLearningTest => GetApiUrl("GetLearningTest");
|
||
/// <summary>
|
||
/// 获取学习试题
|
||
/// </summary>
|
||
public static string GetLearningTestIsView => GetApiUrl("GetLearningTestIsView");
|
||
|
||
/// <summary>
|
||
/// 获取三维课程
|
||
/// </summary>
|
||
public static string Get3DCourse => GetApiUrl("Get3DCourse");
|
||
}
|
||
}
|
||
} |