- 在HttpServer中实现了新的API端点:/api/project/open和/api/model/shrinkwrap - 添加了ShrinkwrapModel和OpenProject命令的处理逻辑 - 在PdmsManager中实现了ShrinkwrapModel和OpenProject方法,支持相应请求的处理 - 更新了项目文件以包含新的命令和模型请求类 此更新增强了插件的功能,允许用户通过API进行模型缩减和项目打开操作。
42 lines
934 B
C#
42 lines
934 B
C#
using System;
|
|
using TellmePdmsPluging.Core;
|
|
using TellmePdmsPluging.Models;
|
|
|
|
namespace TellmePdmsPluging.Commands
|
|
{
|
|
public class OpenProjectCommand : ICommand
|
|
{
|
|
public OpenProjectCommand(OpenProjectRequest request)
|
|
{
|
|
Request = request ?? new OpenProjectRequest();
|
|
CommandId = Guid.NewGuid().ToString("N");
|
|
}
|
|
|
|
public string CommandId { get; }
|
|
|
|
public string CommandType
|
|
{
|
|
get { return "OpenProject"; }
|
|
}
|
|
|
|
public bool CanCancel
|
|
{
|
|
get { return false; }
|
|
}
|
|
|
|
public OpenProjectRequest Request { get; }
|
|
|
|
public object Execute()
|
|
{
|
|
Request.ApplyDefaults();
|
|
return PdmsManager.Instance.OpenProject(Request);
|
|
}
|
|
|
|
public void Cancel()
|
|
{
|
|
throw new NotSupportedException("OpenProjectCommand 不支持取消");
|
|
}
|
|
}
|
|
}
|
|
|