/**
 * rest api interface
 * 项目标准接口
 *
 * The version of the OpenAPI document: 0.0.1
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */ import { Inject , Injectable , Optional } from '@angular/core' ; import { HttpClient , HttpHeaders , HttpParams , HttpResponse , HttpEvent , HttpParameterCodec } from '@angular/common/http' ; import { CustomHttpParameterCodec } from '../encoder' ; import { Observable } from 'rxjs' ; import { AccessToken } from '../model/accessToken' ; import { InlineResponse200 } from '../model/inlineResponse200' ; import { LoginReq } from '../model/loginReq' ; import { LoginRes } from '../model/loginRes' ; import { RegisterReq } from '../model/registerReq' ; import { BASE_PATH , COLLECTION_FORMATS } from '../variables' ; import { Configuration } from '../configuration' ; @ Injectable ( { providedIn : 'root' } ) export class AuthService { protected basePath = 'http://localhost' ; public defaultHeaders = new HttpHeaders ( ) ; public configuration = new Configuration ( ) ; public encoder : HttpParameterCodec ; constructor ( protected httpClient , @ Optional ( ) @ Inject ( BASE_PATH ) basePath , @ Optional ( ) configuration ) { if ( configuration ) { this . configuration = configuration ; } if ( typeof this . configuration . basePath !== 'string' ) { if ( typeof basePath !== 'string' ) { basePath = this . basePath ; } this . configuration . basePath = basePath ; } this . encoder = this . configuration . encoder || new CustomHttpParameterCodec ( ) ; } param mobile param observe param reportProgress public authCaptcha ( mobile , observe ? , reportProgress ? ) ; public authCaptcha ( mobile , observe ? , reportProgress ? ) ; public authCaptcha ( mobile , observe ? , reportProgress ? ) ; public authCaptcha ( mobile , observe = 'body' , reportProgress = false ) { if ( mobile === null || mobile === undefined ) { throw new Error ( 'Required parameter mobile was null or undefined when calling authCaptcha.' ) ; } let queryParameters = new HttpParams ( { encoder : this . encoder } ) ; if ( mobile !== undefined && mobile !== null ) { queryParameters = queryParameters . set ( 'mobile' , < any > mobile ) ; } let headers = this . defaultHeaders ; const httpHeaderAccepts = [ 'application/json' ] ; const httpHeaderAcceptSelected = this . configuration . selectHeaderAccept ( httpHeaderAccepts ) ; if ( httpHeaderAcceptSelected !== undefined ) { headers = headers . set ( 'Accept' , httpHeaderAcceptSelected ) ; } return this . httpClient . get < InlineResponse200 > ( `${ this . configuration . basePath }/auth/captcha` , { params : queryParameters , withCredentials : this . configuration . withCredentials , headers : headers , observe : observe , reportProgress : reportProgress } ) ; } param payload param observe param reportProgress public authLogin ( payload , observe ? , reportProgress ? ) ; public authLogin ( payload , observe ? , reportProgress ? ) ; public authLogin ( payload , observe ? , reportProgress ? ) ; public authLogin ( payload , observe = 'body' , reportProgress = false ) { if ( payload === null || payload === undefined ) { throw new Error ( 'Required parameter payload was null or undefined when calling authLogin.' ) ; } let headers = this . defaultHeaders ; const httpHeaderAccepts = [ 'application/json' ] ; const httpHeaderAcceptSelected = this . configuration . selectHeaderAccept ( httpHeaderAccepts ) ; if ( httpHeaderAcceptSelected !== undefined ) { headers = headers . set ( 'Accept' , httpHeaderAcceptSelected ) ; } const consumes = [ 'application/json' ] ; const httpContentTypeSelected = this . configuration . selectHeaderContentType ( consumes ) ; if ( httpContentTypeSelected !== undefined ) { headers = headers . set ( 'Content-Type' , httpContentTypeSelected ) ; } return this . httpClient . post < LoginRes > ( `${ this . configuration . basePath }/auth/login` , payload , { withCredentials : this . configuration . withCredentials , headers : headers , observe : observe , reportProgress : reportProgress } ) ; } param observe param reportProgress public authLogout ( observe ? , reportProgress ? ) ; public authLogout ( observe ? , reportProgress ? ) ; public authLogout ( observe ? , reportProgress ? ) ; public authLogout ( observe = 'body' , reportProgress = false ) { let headers = this . defaultHeaders ; const httpHeaderAccepts = [ 'application/json' ] ; const httpHeaderAcceptSelected = this . configuration . selectHeaderAccept ( httpHeaderAccepts ) ; if ( httpHeaderAcceptSelected !== undefined ) { headers = headers . set ( 'Accept' , httpHeaderAcceptSelected ) ; } return this . httpClient . get < InlineResponse200 > ( `${ this . configuration . basePath }/auth/logout` , { withCredentials : this . configuration . withCredentials , headers : headers , observe : observe , reportProgress : reportProgress } ) ; } param payload param observe param reportProgress public authRegister ( payload , observe ? , reportProgress ? ) ; public authRegister ( payload , observe ? , reportProgress ? ) ; public authRegister ( payload , observe ? , reportProgress ? ) ; public authRegister ( payload , observe = 'body' , reportProgress = false ) { if ( payload === null || payload === undefined ) { throw new Error ( 'Required parameter payload was null or undefined when calling authRegister.' ) ; } let headers = this . defaultHeaders ; const httpHeaderAccepts = [ 'application/json' ] ; const httpHeaderAcceptSelected = this . configuration . selectHeaderAccept ( httpHeaderAccepts ) ; if ( httpHeaderAcceptSelected !== undefined ) { headers = headers . set ( 'Accept' , httpHeaderAcceptSelected ) ; } const consumes = [ 'application/json' ] ; const httpContentTypeSelected = this . configuration . selectHeaderContentType ( consumes ) ; if ( httpContentTypeSelected !== undefined ) { headers = headers . set ( 'Content-Type' , httpContentTypeSelected ) ; } return this . httpClient . post < AccessToken > ( `${ this . configuration . basePath }/auth/register` , payload , { withCredentials : this . configuration . withCredentials , headers : headers , observe : observe , reportProgress : reportProgress } ) ; } }