操控平台后端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.5 KiB

// 大名科技(天津)有限公司版权所有 电话:18020030720 QQ:515096995
//
// 此源代码遵循位于源代码树根目录中的 LICENSE 文件的许可证
using System.ComponentModel;
using Bodk.Device.Storage;
using Bodk.Device.Storage.EventArgs;
using Bodk.Device.Storage.Summary;
using Furion.DependencyInjection;
using Furion.DynamicApiController;
using Microsoft.AspNetCore.Mvc;
namespace Admin.Bodk.Device.Services;
[ApiDescriptionSettings(Order = 2)]
public class StorageService(IStorage storage) : IDynamicApiController, ISingleton
{
[DisplayName("获取存储设备摘要")]
public StorageSummary GetSummary()
{
return storage.GetSummary();
}
[DisplayName("获取指定模块的摘要")]
public TypeDescription GetModuleSummary(int moduleId)
{
return storage.GetModuleSummary(moduleId);
}
[DisplayName("获取属性值")]
public object GetGetPropertyValue(int moduleId, string propertyName)
{
return storage.GetPropertyValue(moduleId, propertyName);
}
[DisplayName("设置属性值")]
public void SetPropertyValue(int moduleId, string propertyName, object value)
{
storage.SetPropertyValue(moduleId, propertyName, value);
}
[DisplayName("开始监控")]
public void Start()
{
storage.Start();
}
[DisplayName("执行方法")]
public void InvokeMethod(int moduleId, string methodName, object?[]? parameters)
{
storage.InvokeMethod(moduleId, methodName, parameters).Wait();
}
}