Files
dukang/server/dukang-api/src/integrations/oss/oss.interface.ts
T
2026-07-01 20:21:51 +08:00

31 lines
719 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
export interface OssUploadTokenInput {
bizType: string;
mediaType: string;
fileName: string;
}
export interface OssUploadTokenResult {
bucket: string;
region: string;
ossKey: string;
url: string;
mock: boolean;
expireAt: string;
mediaType: string;
bizType: string;
/** OSS PostObject 直传 hostmock 时为空 */
host?: string;
/** Base64 policymock 时为空 */
policy?: string;
/** HMAC-SHA1 签名,mock 时为空 */
signature?: string;
/** RAM AccessKeyIdmock 时为空 */
accessKeyId?: string;
}
export interface IOssProvider {
isEnabled(): boolean;
getUploadToken(input: OssUploadTokenInput): OssUploadTokenResult;
buildPublicUrl(ossKey: string): string;
}