first commit

This commit is contained in:
2023-07-07 20:05:25 +08:00
commit 0322866b82
40 changed files with 6040 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import {controller} from '../models';
export function GetConfig():Promise<controller.ServerConfig>;
export function Quit():Promise<void>;
export function SetUpyunConfig(arg1:controller.UpyunConfig):Promise<void>;
export function UperCreateDirectory(arg1:string):Promise<void>;
export function UperDelete(arg1:string,arg2:boolean):Promise<void>;
export function UperList(arg1:string):Promise<Array<controller.FileInfo>>;
export function UperUpload(arg1:string):Promise<void>;

View File

@@ -0,0 +1,31 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export function GetConfig() {
return window['go']['controller']['Storage']['GetConfig']();
}
export function Quit() {
return window['go']['controller']['Storage']['Quit']();
}
export function SetUpyunConfig(arg1) {
return window['go']['controller']['Storage']['SetUpyunConfig'](arg1);
}
export function UperCreateDirectory(arg1) {
return window['go']['controller']['Storage']['UperCreateDirectory'](arg1);
}
export function UperDelete(arg1, arg2) {
return window['go']['controller']['Storage']['UperDelete'](arg1, arg2);
}
export function UperList(arg1) {
return window['go']['controller']['Storage']['UperList'](arg1);
}
export function UperUpload(arg1) {
return window['go']['controller']['Storage']['UperUpload'](arg1);
}

View File

@@ -0,0 +1,75 @@
export namespace controller {
export class FileInfo {
filename?: string;
prefix?: string;
created_at?: string;
size?: number;
is_dir?: boolean;
static createFrom(source: any = {}) {
return new FileInfo(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.filename = source["filename"];
this.prefix = source["prefix"];
this.created_at = source["created_at"];
this.size = source["size"];
this.is_dir = source["is_dir"];
}
}
export class UpyunConfig {
bucket: string;
operator: string;
password: string;
domain: string;
static createFrom(source: any = {}) {
return new UpyunConfig(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.bucket = source["bucket"];
this.operator = source["operator"];
this.password = source["password"];
this.domain = source["domain"];
}
}
export class ServerConfig {
environment: string;
upyun: UpyunConfig;
static createFrom(source: any = {}) {
return new ServerConfig(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.environment = source["environment"];
this.upyun = this.convertValues(source["upyun"], UpyunConfig);
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice) {
return (a as any[]).map(elem => this.convertValues(elem, classs));
} else if ("object" === typeof a) {
if (asMap) {
for (const key of Object.keys(a)) {
a[key] = new classs(a[key]);
}
return a;
}
return new classs(a);
}
return a;
}
}
}