ow
This commit is contained in:
1 parent
9b01c4a57a
commit
6417562c4f
37 files changed
+2767
-202
No files matched your search
@@ -331,6 +331,226 @@ this.familyTreeService= familyTreeService;
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "FamilyTree", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic GetExchangeFactor()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = familyTreeService.GetExchangeFactor();
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ExportFamilyTreeCompositionData
|
||||
{
|
||||
public string treeId { get; set; }
|
||||
public string scope { get; set; }
|
||||
public string anchorPersonId { get; set; }
|
||||
|
||||
}
|
||||
[PermissionOperate(name: "FamilyTree", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic ExportFamilyTree(ExportFamilyTreeCompositionData compositionData)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = familyTreeService.ExportFamilyTree(compositionData.treeId,compositionData.scope,compositionData.anchorPersonId);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class SaveExchangeFileCompositionData
|
||||
{
|
||||
public string fileName { get; set; }
|
||||
public string contentBase64 { get; set; }
|
||||
|
||||
}
|
||||
[PermissionOperate(name: "FamilyTree", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic SaveExchangeFile(SaveExchangeFileCompositionData compositionData)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = familyTreeService.SaveExchangeFile(compositionData.fileName,compositionData.contentBase64);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "FamilyTree", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic ListExchangeFiles(string treeId)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = familyTreeService.ListExchangeFiles(treeId);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "FamilyTree", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic ReadExchangeFile(string fileName)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = familyTreeService.ReadExchangeFile(fileName);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ImportFamilyTreeCompositionData
|
||||
{
|
||||
public string targetTreeId { get; set; }
|
||||
public FamilyTreeExchangeData data { get; set; }
|
||||
|
||||
}
|
||||
[PermissionOperate(name: "FamilyTree", operate: "Update")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic ImportFamilyTree(ImportFamilyTreeCompositionData compositionData)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = familyTreeService.ImportFamilyTree(compositionData.targetTreeId,compositionData.data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ImportSubTreeCompositionData
|
||||
{
|
||||
public string targetTreeId { get; set; }
|
||||
public string anchorPersonId { get; set; }
|
||||
public FamilyTreeExchangeData data { get; set; }
|
||||
|
||||
}
|
||||
[PermissionOperate(name: "FamilyTree", operate: "Update")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic ImportSubTree(ImportSubTreeCompositionData compositionData)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = familyTreeService.ImportSubTree(compositionData.targetTreeId,compositionData.anchorPersonId,compositionData.data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "FamilyTree", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic ListBackups(string treeId)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = familyTreeService.ListBackups(treeId);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class RestoreBackupCompositionData
|
||||
{
|
||||
public string targetTreeId { get; set; }
|
||||
public string backupFileName { get; set; }
|
||||
|
||||
}
|
||||
[PermissionOperate(name: "FamilyTree", operate: "Update")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic RestoreBackup(RestoreBackupCompositionData compositionData)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = familyTreeService.RestoreBackup(compositionData.targetTreeId,compositionData.backupFileName);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user