TellmePdmsPluging/Commands/ShrinkwrapModelCommand.cs
sladro 8f5bcc0c98 添加模型缩减和项目打开功能的API支持
- 在HttpServer中实现了新的API端点:/api/project/open和/api/model/shrinkwrap
- 添加了ShrinkwrapModel和OpenProject命令的处理逻辑
- 在PdmsManager中实现了ShrinkwrapModel和OpenProject方法,支持相应请求的处理
- 更新了项目文件以包含新的命令和模型请求类

此更新增强了插件的功能,允许用户通过API进行模型缩减和项目打开操作。
2026-02-05 08:22:42 +08:00

40 lines
965 B
C#

using TellmePdmsPluging.Core;
using TellmePdmsPluging.Models;
namespace TellmePdmsPluging.Commands
{
public class ShrinkwrapModelCommand : ICommand
{
public ShrinkwrapModelCommand(ShrinkwrapModelRequest request)
{
Request = request ?? new ShrinkwrapModelRequest();
CommandId = System.Guid.NewGuid().ToString("N");
}
public string CommandId { get; }
public string CommandType
{
get { return "ShrinkwrapModel"; }
}
public bool CanCancel
{
get { return false; }
}
public ShrinkwrapModelRequest Request { get; }
public object Execute()
{
Request.ApplyDefaults();
return PdmsManager.Instance.ShrinkwrapModel(Request);
}
public void Cancel()
{
throw new System.NotSupportedException("ShrinkwrapModelCommand 不支持取消");
}
}
}