import * as MsClient from "cn.keytop.midend.microservice.Client"; 

/**
 * 使用示例：
 * import * as msDemo1MsClient from 'cn.keytop.stc.ms.MsDemo1'
 * 
 * const msDemo1MsClient = new msDemo1MsClient.MsDemo1()
 *  msDemo1MsClient.fun1('aaa','bbb','ccc')
 * .catch(error => {console.log(error)})
 * .then(value => {console.log(value)})
 *
 *
 * @author 微服务平台自动生成
 * @desc [null]接口定义
 * @date 2020-03-10 19:04:47
 **/
export class MsDemo1 {
  private msId: string = 'cn.keytop.stc.ms.ms-demo1';
  private version: string = '1.0.0';
  private authType: MsClient.AuthType = MsClient.AuthType.BASE;
  private serviceClient: MsClient.ServiceClient;

  constructor() {
     this.serviceClient = new MsClient.ServiceClientImpl()
   }

  async fun1(p1: number, p2: number, p3: number, p4: number, p5: number, p6: number, p7: number, p8: number, p9: boolean, p10: boolean, p11: string, p12: number, p13: number, p14: number): Promise<string> {
      let uri = '/base/fun1' 
      let sid = `${this.msId}.${uri}` 
      let tags = '' 
      let header = {} 
      let paramMap = {} 
      paramMap = { 'p1': p1,'p2': p2,'p3': p3,'p4': p4,'p5': p5,'p6': p6,'p7': p7,'p8': p8,'p9': p9,'p10': p10,'p11': p11,'p12': p12,'p13': p13,'p14': p14      } 
      return await this.serviceClient.call(MsClient.HttpMethodType.POST,sid, this.version, tags, header, paramMap, {}, this.authType,MsClient.RequestBodyType.WWW_FORM) 
  }

  async fun2test(modelA: Fun2test$Models.ModelA): Promise<string> {
      let uri = '/base/fun2' 
      let sid = `${this.msId}.${uri}` 
      let tags = '' 
      let header = {} 
      let paramMap = {} 
      paramMap = { ...modelA      } 
      return await this.serviceClient.call(MsClient.HttpMethodType.PUT,sid, this.version, tags, header, paramMap, {}, this.authType,MsClient.RequestBodyType.WWW_FORM) 
  }

  async fun3(f1: string): Promise<Fun3$Models.ApiResult> {
      let uri = '/base/fu3' 
      let sid = `${this.msId}.${uri}` 
      let tags = '' 
      let header = {} 
      let paramMap = {} 
      paramMap = { 'f1': f1      } 
      let response = await this.serviceClient.get(sid, this.version, tags, header, paramMap, this.authType) 
      if(!response){
          return response;
      }else{
    return  new Fun3$Models.ApiResult(response);
  }
  }

  async fun4(f1: Fun4$Models.ModelB): Promise<Array<Fun4$Models.ModelA>> {
      let uri = '/base/fu4' 
      let sid = `${this.msId}.${uri}` 
      let tags = '' 
      let header = {} 
      let paramMap = {} 
      let bodyObj = f1
      let response = await this.serviceClient.call(MsClient.HttpMethodType.POST,sid, this.version, tags, header, paramMap, bodyObj, this.authType,MsClient.RequestBodyType.RAW_JSON) 
      if(!response){
          return response;
      }else{
          let __ms_result = new Array<Fun4$Models.ModelA>();
          if(Array.isArray(response)){
              response.forEach((e)=>{
                  __ms_result.push(new Fun4$Models.ModelA(e));
              });
          }
    return __ms_result;
  }
  }

  async test1(param1: string): Promise<Test1$Models.ApiDemoResult> {
      let uri = '/test' 
      let sid = `${this.msId}.${uri}` 
      let tags = '' 
      let header = {} 
      let paramMap = {} 
      paramMap = { 'param1': param1      } 
      let response = await this.serviceClient.get(sid, this.version, tags, header, paramMap, this.authType) 
      if(!response){
          return response;
      }else{
    return  new Test1$Models.ApiDemoResult(response);
  }
  }

  async callDemo2(): Promise<CallDemo2$Models.CallResult> {
      let uri = '/callDemo2' 
      let sid = `${this.msId}.${uri}` 
      let tags = '' 
      let header = {} 
      let paramMap = {} 
      paramMap = {       } 
      let response = await this.serviceClient.get(sid, this.version, tags, header, paramMap, this.authType) 
      if(!response){
          return response;
      }else{
    return  new CallDemo2$Models.CallResult(response);
  }
  }

}

export namespace Fun1$Models { 
}

export namespace Fun2test$Models { 
   export class ModelAAA {
        f111?: string

   }

   export class ModelAA {
        f11?: string

   }

   export class ModelA {
        f1?: number
        modelAA?: ModelAA
        f0?: string

   }

}

export namespace Fun3$Models { 
   export class ModelBB1 {
       private _ms_response_data$$$; 

       constructor(value){ 
           this._ms_response_data$$$ = value; 

       } 
        get f111(): string {
           return this._ms_response_data$$$.f111;
        }
        set f111(value:string) {
           this._ms_response_data$$$.f111 = value 
        }

   }

   export class ModelBB2 {
       private _ms_response_data$$$; 

       constructor(value){ 
           this._ms_response_data$$$ = value; 

       } 

   }

   export class ModelB {
       private _ms_response_data$$$; 
       private _f1:ModelBB1; 
       private _f2:ModelBB2; 

       constructor(value){ 
           this._ms_response_data$$$ = value; 
           this._f1 = new ModelBB1(value.f1); 
           this._f2 = new ModelBB2(value.f2); 

       } 
        get f1(): ModelBB1 {
           return this._f1;
        }
        set f1(value:ModelBB1) {
           this._f1 = value 
        }
        get f2(): ModelBB2 {
           return this._f2;
        }
        set f2(value:ModelBB2) {
           this._f2 = value 
        }

   }

   export class ApiResult {
       private _ms_response_data$$$; 
       private _data:ModelB; 

       constructor(value){ 
           this._ms_response_data$$$ = value; 
           this._data = new ModelB(value.data); 

       } 
        get responseCode(): string {
           return this._ms_response_data$$$.responseCode;
        }
        set responseCode(value:string) {
           this._ms_response_data$$$.responseCode = value 
        }
        get errorInfo(): string {
           return this._ms_response_data$$$.errorInfo;
        }
        set errorInfo(value:string) {
           this._ms_response_data$$$.errorInfo = value 
        }
        get data(): ModelB {
           return this._data;
        }
        set data(value:ModelB) {
           this._data = value 
        }

   }

}

export namespace Fun4$Models { 
   export class ModelBB1 {
        f111?: string

   }

   export class ModelBB2 {

   }

   export class ModelB {
        f1?: ModelBB1
        f2?: ModelBB2

   }

   export class ModelAAA {
       private _ms_response_data$$$; 

       constructor(value){ 
           this._ms_response_data$$$ = value; 

       } 
        get f111(): string {
           return this._ms_response_data$$$.f111;
        }
        set f111(value:string) {
           this._ms_response_data$$$.f111 = value 
        }

   }

   export class ModelAA {
       private _ms_response_data$$$; 

       constructor(value){ 
           this._ms_response_data$$$ = value; 

       } 
        get f11(): string {
           return this._ms_response_data$$$.f11;
        }
        set f11(value:string) {
           this._ms_response_data$$$.f11 = value 
        }

   }

   export class ModelA {
       private _ms_response_data$$$; 
       private _modelAA:ModelAA; 

       constructor(value){ 
           this._ms_response_data$$$ = value; 
           this._modelAA = new ModelAA(value.modelAA); 

       } 
        get f1(): number {
           return this._ms_response_data$$$.f1;
        }
        set f1(value:number) {
           this._ms_response_data$$$.f1 = value 
        }
        get modelAA(): ModelAA {
           return this._modelAA;
        }
        set modelAA(value:ModelAA) {
           this._modelAA = value 
        }
        get f0(): string {
           return this._ms_response_data$$$.f0;
        }
        set f0(value:string) {
           this._ms_response_data$$$.f0 = value 
        }

   }

}

export namespace Test1$Models { 
   export class ApiDemoResult {
       private _ms_response_data$$$; 

       constructor(value){ 
           this._ms_response_data$$$ = value; 

       } 
        get code(): number {
           return this._ms_response_data$$$.code;
        }
        set code(value:number) {
           this._ms_response_data$$$.code = value 
        }
        get message(): string {
           return this._ms_response_data$$$.message;
        }
        set message(value:string) {
           this._ms_response_data$$$.message = value 
        }
        get data(): string {
           return this._ms_response_data$$$.data;
        }
        set data(value:string) {
           this._ms_response_data$$$.data = value 
        }

   }

}

export namespace CallDemo2$Models { 
   export class Map {
       private _ms_response_data$$$; 

       constructor(value){ 
           this._ms_response_data$$$ = value; 

       } 

   }

   export class CallResult {
       private _ms_response_data$$$; 
       private _callDemo2:Map; 

       constructor(value){ 
           this._ms_response_data$$$ = value; 
           this._callDemo2 = new Map(value.callDemo2); 

       } 
        get SUCCESS_CODE(): number {
           return this._ms_response_data$$$.SUCCESS_CODE;
        }
        set SUCCESS_CODE(value:number) {
           this._ms_response_data$$$.SUCCESS_CODE = value 
        }
        get NOT_LOGGED_CODE(): number {
           return this._ms_response_data$$$.NOT_LOGGED_CODE;
        }
        set NOT_LOGGED_CODE(value:number) {
           this._ms_response_data$$$.NOT_LOGGED_CODE = value 
        }
        get SYSTEM_ERROR_CODE(): number {
           return this._ms_response_data$$$.SYSTEM_ERROR_CODE;
        }
        set SYSTEM_ERROR_CODE(value:number) {
           this._ms_response_data$$$.SYSTEM_ERROR_CODE = value 
        }
        get BIZ_ERROR_CODE(): number {
           return this._ms_response_data$$$.BIZ_ERROR_CODE;
        }
        set BIZ_ERROR_CODE(value:number) {
           this._ms_response_data$$$.BIZ_ERROR_CODE = value 
        }
        get code(): number {
           return this._ms_response_data$$$.code;
        }
        set code(value:number) {
           this._ms_response_data$$$.code = value 
        }
        get message(): string {
           return this._ms_response_data$$$.message;
        }
        set message(value:string) {
           this._ms_response_data$$$.message = value 
        }
        get callDemo2(): Map {
           return this._callDemo2;
        }
        set callDemo2(value:Map) {
           this._callDemo2 = value 
        }
        get data(): string {
           return this._ms_response_data$$$.data;
        }
        set data(value:string) {
           this._ms_response_data$$$.data = value 
        }

   }

}

