EDMIService: Update client and fix wrnog extension at import
This commit is contained in:
44
Modules.EDMIAPI/Modules/ZooFlow/GetFileObject.vb
Normal file
44
Modules.EDMIAPI/Modules/ZooFlow/GetFileObject.vb
Normal file
@@ -0,0 +1,44 @@
|
||||
Imports DigitalData.Modules.EDMI.API.EDMIServiceReference
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Namespace Modules.Zooflow
|
||||
Public Class GetFileObject
|
||||
Private ReadOnly LogConfig As LogConfig
|
||||
Private ReadOnly Logger As Logger
|
||||
Private ReadOnly Channel As IEDMIServiceChannel
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pChannel As IEDMIServiceChannel)
|
||||
LogConfig = pLogConfig
|
||||
Logger = pLogConfig.GetLogger()
|
||||
Channel = pChannel
|
||||
End Sub
|
||||
|
||||
Public Async Function RunAsync(pObjectId As Long) As Task(Of FileObject)
|
||||
Try
|
||||
Dim oResult = Await Channel.GetFileObjectAsync(New GetFileObjectRequest With {.ObjectId = pObjectId})
|
||||
If oResult.OK Then
|
||||
Return oResult.FileObject
|
||||
Else
|
||||
Return Nothing
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function Run(pObjectId As Long) As FileObject
|
||||
Try
|
||||
Dim oResult = Channel.GetFileObject(New GetFileObjectRequest With {.ObjectId = pObjectId})
|
||||
If oResult.OK Then
|
||||
Return oResult.FileObject
|
||||
Else
|
||||
Return Nothing
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
Reference in New Issue
Block a user