1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- export namespace desktop {
-
- export class ApiResp {
- data?: models.RespData;
-
- static createFrom(source: any = {}) {
- return new ApiResp(source);
- }
-
- constructor(source: any = {}) {
- if ('string' === typeof source) source = JSON.parse(source);
- this.data = this.convertValues(source["data"], models.RespData);
- }
-
- 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;
- }
- }
- }
- export namespace models {
-
- export class RespData {
- code: number;
- msg: string;
- data: any;
-
- static createFrom(source: any = {}) {
- return new RespData(source);
- }
-
- constructor(source: any = {}) {
- if ('string' === typeof source) source = JSON.parse(source);
- this.code = source["code"];
- this.msg = source["msg"];
- this.data = source["data"];
- }
- }
- }
|