Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
xugenyuan
2024-07-31 13:46:28 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
56dbb306a6ca9f103c7ce80bbe2698f5f962a4bc
56dbb306
1 parent
a4e8fa03
ref |> 新增OSSUploadManager
Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
1 deletions
sight_harmony/features/wdHwAbility/Index.ets
sight_harmony/features/wdHwAbility/oh-package.json5
sight_harmony/features/wdHwAbility/src/main/ets/aliOSS/OSSUploadManager.ets
sight_harmony/features/wdHwAbility/Index.ets
View file @
56dbb30
...
...
@@ -4,3 +4,5 @@ export { HWLocationUtils } from './src/main/ets/location/HWLocationUtils'
// export { WDPushNotificationManager } from "./src/main/ets/notification/WDPushNotificationManager"
export { GetuiPush } from "./src/main/ets/getuiPush/GetuiPush"
export { OSSUploadManager,OSSConfigSceneType,OSSFileType,OSSUploadResult } from "./src/main/ets/aliOSS/OSSUploadManager"
\ No newline at end of file
...
...
sight_harmony/features/wdHwAbility/oh-package.json5
View file @
56dbb30
...
...
@@ -14,6 +14,7 @@
"wdBean"
:
"file:../../features/wdBean"
,
"wdRouter"
:
"file:../../commons/wdRouter"
,
"wdTracking"
:
"file:../../features/wdTracking"
,
"wdNetwork"
:
"file:../../commons/wdNetwork"
"wdNetwork"
:
"file:../../commons/wdNetwork"
,
"wdossclient"
:
"file:../../WdOssClientSdk/wdossclient"
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdHwAbility/src/main/ets/aliOSS/OSSUploadManager.ets
0 → 100644
View file @
56dbb30
import { WDOssClient } from 'wdossclient'
export enum OSSConfigSceneType {
feedback = 1,
}
export enum OSSFileType {
image = 0,
video = 1,
}
export class OSSUploadResult {
ossFile?: string
}
export class OSSUploadManager {
private accessKeyId?:string
private accessKeySecret?:string
private sessionToken?:string
static uploadFile(fileUri: string, scene: OSSConfigSceneType, fileType: OSSFileType) : Promise<OSSUploadResult> {
return new Promise((success, fail) => {
success({})
})
}
upload(fileUri: string, endpoint:string, bucketName:string, objectName:string) : boolean {
if (!this.accessKeyId || !this.accessKeySecret || !this.sessionToken) {
return false
}
return WDOssClient.UploadFile(endpoint, this.accessKeyId, this.accessKeySecret, this.sessionToken, bucketName, objectName, fileUri)
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment