55 lines
1.4 KiB
C#
55 lines
1.4 KiB
C#
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using SWS.Commons;
|
|
using SWS.Model;
|
|
|
|
namespace SWS.Service
|
|
{
|
|
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
|
|
}
|
|
}
|
|
}
|
|
}
|