63 lines
1.6 KiB
C#
63 lines
1.6 KiB
C#
![]() |
using Newtonsoft.Json;
|
|||
|
using Newtonsoft.Json.Linq;
|
|||
|
using SWS.CAD.Models;
|
|||
|
using SWS.CAD.Models.NoEntity;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.IO;
|
|||
|
using System.Linq;
|
|||
|
using System.Net.Http;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using System.Web;
|
|||
|
using System.Windows.Forms;
|
|||
|
|
|||
|
namespace SWS.CAD.Services
|
|||
|
{
|
|||
|
public class TemplateFileService : HttpService
|
|||
|
{
|
|||
|
public TemplateFileService() : base()
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 查询模板文件目录树
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public async Task<List<TreeModel>> GetTemplateCatalogue()
|
|||
|
{
|
|||
|
var res = await this.GetAsync<List<TreeModel>>($"TemplateFileApi/GetTemplateCatalogue?projectId={GlobalObject.curProject.ProjectId}");
|
|||
|
//OnRefresh();
|
|||
|
if (res.code == 200)
|
|||
|
{
|
|||
|
|
|||
|
return res.data;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return null;//ERROR INFO
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 查询模板文件实体
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
public async Task<ec_template_file> GetTemplateFile(string templateFileID)
|
|||
|
{
|
|||
|
var res = await this.GetAsync<ec_template_file>($"TemplateFileApi/GetEntity?projectId={GlobalObject.curProject.ProjectId}&templateFileID={templateFileID}");
|
|||
|
|
|||
|
if (res.code == 200)
|
|||
|
{
|
|||
|
|
|||
|
return res.data;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return null;//ERROR INFO
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|