| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- export namespace handlers {
-
- export class ImageResult {
- goods_art_no: string;
- image_path: string;
- category: string;
- description: string;
- price: string;
- image_base64: string;
-
- static createFrom(source: any = {}) {
- return new ImageResult(source);
- }
-
- constructor(source: any = {}) {
- if ('string' === typeof source) source = JSON.parse(source);
- this.goods_art_no = source["goods_art_no"];
- this.image_path = source["image_path"];
- this.category = source["category"];
- this.description = source["description"];
- this.price = source["price"];
- this.image_base64 = source["image_base64"];
- }
- }
- export class PhotoRecordList {
- goods_art_no: string;
- action_time: string;
- items: string[];
-
- static createFrom(source: any = {}) {
- return new PhotoRecordList(source);
- }
-
- constructor(source: any = {}) {
- if ('string' === typeof source) source = JSON.parse(source);
- this.goods_art_no = source["goods_art_no"];
- this.action_time = source["action_time"];
- this.items = source["items"];
- }
- }
- export class PhotoRecordResponse {
- list: PhotoRecordList[];
- current_page: number;
- size: number;
- total_count: number;
- total_pages: number;
- has_prev: boolean;
- has_next: boolean;
-
- static createFrom(source: any = {}) {
- return new PhotoRecordResponse(source);
- }
-
- constructor(source: any = {}) {
- if ('string' === typeof source) source = JSON.parse(source);
- this.list = this.convertValues(source["list"], PhotoRecordList);
- this.current_page = source["current_page"];
- this.size = source["size"];
- this.total_count = source["total_count"];
- this.total_pages = source["total_pages"];
- this.has_prev = source["has_prev"];
- this.has_next = source["has_next"];
- }
-
- convertValues(a: any, classs: any, asMap: boolean = false): any {
- if (!a) {
- return a;
- }
- if (a.slice && a.map) {
- 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;
- }
- }
- }
|