This commit is contained in:
Cristiano
2025-12-02 08:34:58 +01:00
parent 5b1030570f
commit 4b3faa236d
37 changed files with 178 additions and 495 deletions

View File

@@ -15,7 +15,7 @@
<tr>
<td>{{ book.title}}</td>
<td>{{ book.isbn }}</td>
<td>{{ book.bookAuthorFirstName }} {{ book.bookAuthorName }}</td>
<td>{{ book.authorFirstName }} {{ book.authorName }}</td>
<td>{{ book.releaseYear}}</td>
<div style="justify-content: center; display: flex">
<td>

View File

@@ -37,7 +37,7 @@ export class BookTable implements OnInit {
this.booksLoading.set(true)
try {
const books = await firstValueFrom(this.booksService.getAllBooksEndpoint());
const books = await firstValueFrom(this.booksService.getAllBookEndpoint());
this.books.set(books);

View File

@@ -40,7 +40,7 @@ export class CreateLoan implements OnInit {
async fetchUsers() {
try {
const users = await firstValueFrom(this.userService.getAllUsersEndpoint());
const users = await firstValueFrom(this.userService.getAllUserEndpoint());
this.users.set(users);
} catch (e) {
this.notificationService.error('Erreur', 'Impossible de récupérer les utilisateurs');
@@ -49,7 +49,7 @@ export class CreateLoan implements OnInit {
async fetchBooks() {
try {
const books = await firstValueFrom(this.bookService.getAllBooksEndpoint());
const books = await firstValueFrom(this.bookService.getAllBookEndpoint());
this.books.set(books);
} catch (e) {
this.notificationService.error('Erreur', 'Impossible de récupérer les livres');

View File

@@ -112,13 +112,14 @@ export class LoanTable implements OnInit {
}
async validationDate(loanId: number) {
try {
const PatchLoanValue = {
effectiveReturningDate: format(new Date(), 'yyyy-MM-dd')
};
try {
await firstValueFrom(this.loansService.patchLoanEndpoint(loanId, PatchLoanValue))
await firstValueFrom(this.loansService.updateLoanEffectiveReturnDateEndpoint(loanId, PatchLoanValue))
this.notificationService.success(
'Success',
@@ -126,8 +127,8 @@ export class LoanTable implements OnInit {
)
} catch (e) {
this.notificationService.error(
'Erreur',
'La date à déjà été actualisée'
'Error',
'Can\'t set returning date'
)
}
} catch (e) {

View File

@@ -32,7 +32,7 @@ export class UpdateBook implements OnInit {
title: this.book().title,
isbn: this.book().isbn,
releaseYear: this.book().releaseYear,
authorId: this.book().bookAuthorId
authorId: this.book().authorId
});
}
}

View File

@@ -1,4 +1,4 @@
import {Component, inject, input, OnInit, signal} from '@angular/core';
import {Component, inject, input, OnChanges, OnInit, signal} from '@angular/core';
import {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from "@angular/forms";
import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid";
import {NzFormControlComponent, NzFormDirective, NzFormItemComponent, NzFormLabelComponent} from "ng-zorro-antd/form";
@@ -26,7 +26,7 @@ import {firstValueFrom} from "rxjs";
templateUrl: './update-loan.html',
styleUrl: './update-loan.css',
})
export class UpdateLoan implements OnInit {
export class UpdateLoan implements OnInit, OnChanges {
updateLoanForm = new FormGroup({
userId: new FormControl<number>(null, Validators.required),
bookId: new FormControl<number>(null, Validators.required),
@@ -64,7 +64,7 @@ export class UpdateLoan implements OnInit {
async fetchUsers() {
try {
const users = await firstValueFrom(this.userService.getAllUsersEndpoint());
const users = await firstValueFrom(this.userService.getAllUserEndpoint());
this.users.set(users);
} catch (e) {
this.notificationService.error('Erreur', 'Impossible de récupérer les utilisateurs');
@@ -73,7 +73,7 @@ export class UpdateLoan implements OnInit {
async fetchBooks() {
try {
const books = await firstValueFrom(this.bookService.getAllBooksEndpoint());
const books = await firstValueFrom(this.bookService.getAllBookEndpoint());
this.books.set(books);
} catch (e) {
this.notificationService.error('Erreur', 'Impossible de récupérer les livres');

View File

@@ -41,7 +41,7 @@ export class UserTable implements OnInit {
this.usersLoading.set(true)
try {
const users = await firstValueFrom(this.usersService.getAllUsersEndpoint())
const users = await firstValueFrom(this.usersService.getAllUserEndpoint())
this.users.set(users);
} catch (e) {
this.notificationService.error(

View File

@@ -1,4 +1,5 @@
.gitignore
.openapi-generator-ignore
README.md
api.base.service.ts
api.module.ts
@@ -7,7 +8,6 @@ api/authors.service.ts
api/books.service.ts
api/loans.service.ts
api/login.service.ts
api/logins.service.ts
api/users.service.ts
configuration.ts
encoder.ts
@@ -22,15 +22,13 @@ model/create-user-dto.ts
model/get-author-dto.ts
model/get-book-dto.ts
model/get-loan-dto.ts
model/get-login-connect-dto.ts
model/get-login-dto.ts
model/get-user-dto.ts
model/models.ts
model/patch-loan-dto.ts
model/update-author-dto.ts
model/update-book-dto.ts
model/update-loan-dto.ts
model/update-login-dto.ts
model/update-loan-effective-return-date-dto.ts
model/update-user-dto.ts
param.ts
provide-api.ts

View File

@@ -1,5 +1,5 @@
/**
* ApiEfCoreLibrary
* ApiLibrary
*
*
*
@@ -12,7 +12,7 @@ import { CustomHttpParameterCodec } from './encoder';
import { Configuration } from './configuration';
export class BaseService {
protected basePath = 'https://localhost:44390';
protected basePath = 'http://localhost:5156';
public defaultHeaders = new HttpHeaders();
public configuration: Configuration;
public encoder: HttpParameterCodec;

View File

@@ -6,8 +6,6 @@ export * from './loans.service';
import { LoansService } from './loans.service';
export * from './login.service';
import { LoginService } from './login.service';
export * from './logins.service';
import { LoginsService } from './logins.service';
export * from './users.service';
import { UsersService } from './users.service';
export const APIS = [AuthorsService, BooksService, LoansService, LoginService, LoginsService, UsersService];
export const APIS = [AuthorsService, BooksService, LoansService, LoginService, UsersService];

View File

@@ -1,5 +1,5 @@
/**
* ApiEfCoreLibrary
* ApiLibrary
*
*
*
@@ -222,6 +222,9 @@ export class AuthorsService extends BaseService {
let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);

View File

@@ -1,5 +1,5 @@
/**
* ApiEfCoreLibrary
* ApiLibrary
*
*
*
@@ -161,10 +161,10 @@ export class BooksService extends BaseService {
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getAllBooksEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<GetBookDto>>;
public getAllBooksEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<GetBookDto>>>;
public getAllBooksEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<GetBookDto>>>;
public getAllBooksEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
public getAllBookEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<GetBookDto>>;
public getAllBookEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<GetBookDto>>>;
public getAllBookEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<GetBookDto>>>;
public getAllBookEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
let localVarHeaders = this.defaultHeaders;

View File

@@ -1,5 +1,5 @@
/**
* ApiEfCoreLibrary
* ApiLibrary
*
*
*
@@ -21,9 +21,9 @@ import { CreateLoanDto } from '../model/create-loan-dto';
// @ts-ignore
import { GetLoanDto } from '../model/get-loan-dto';
// @ts-ignore
import { PatchLoanDto } from '../model/patch-loan-dto';
// @ts-ignore
import { UpdateLoanDto } from '../model/update-loan-dto';
// @ts-ignore
import { UpdateLoanEffectiveReturnDateDto } from '../model/update-loan-effective-return-date-dto';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
@@ -224,6 +224,9 @@ export class LoansService extends BaseService {
let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
@@ -263,21 +266,21 @@ export class LoansService extends BaseService {
}
/**
* @endpoint patch /API/loans/{id}/EffectiveReturningDate
* @endpoint patch /API/loans/{id}/EffectiveReturnDate
* @param id
* @param patchLoanDto
* @param updateLoanEffectiveReturnDateDto
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public patchLoanEndpoint(id: number, patchLoanDto: PatchLoanDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<GetLoanDto>;
public patchLoanEndpoint(id: number, patchLoanDto: PatchLoanDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<GetLoanDto>>;
public patchLoanEndpoint(id: number, patchLoanDto: PatchLoanDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<GetLoanDto>>;
public patchLoanEndpoint(id: number, patchLoanDto: PatchLoanDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
public updateLoanEffectiveReturnDateEndpoint(id: number, updateLoanEffectiveReturnDateDto: UpdateLoanEffectiveReturnDateDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<GetLoanDto>;
public updateLoanEffectiveReturnDateEndpoint(id: number, updateLoanEffectiveReturnDateDto: UpdateLoanEffectiveReturnDateDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<GetLoanDto>>;
public updateLoanEffectiveReturnDateEndpoint(id: number, updateLoanEffectiveReturnDateDto: UpdateLoanEffectiveReturnDateDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<GetLoanDto>>;
public updateLoanEffectiveReturnDateEndpoint(id: number, updateLoanEffectiveReturnDateDto: UpdateLoanEffectiveReturnDateDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling patchLoanEndpoint.');
throw new Error('Required parameter id was null or undefined when calling updateLoanEffectiveReturnDateEndpoint.');
}
if (patchLoanDto === null || patchLoanDto === undefined) {
throw new Error('Required parameter patchLoanDto was null or undefined when calling patchLoanEndpoint.');
if (updateLoanEffectiveReturnDateDto === null || updateLoanEffectiveReturnDateDto === undefined) {
throw new Error('Required parameter updateLoanEffectiveReturnDateDto was null or undefined when calling updateLoanEffectiveReturnDateEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
@@ -314,12 +317,12 @@ export class LoansService extends BaseService {
}
}
let localVarPath = `/API/loans/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/EffectiveReturningDate`;
let localVarPath = `/API/loans/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}/EffectiveReturnDate`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<GetLoanDto>('patch', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: patchLoanDto,
body: updateLoanEffectiveReturnDateDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,

View File

@@ -1,5 +1,5 @@
/**
* ApiEfCoreLibrary
* ApiLibrary
*
*
*
@@ -19,7 +19,9 @@ import { Observable } from 'rxjs';
// @ts-ignore
import { ConnectLoginDto } from '../model/connect-login-dto';
// @ts-ignore
import { GetLoginConnectDto } from '../model/get-login-connect-dto';
import { CreateLoginDto } from '../model/create-login-dto';
// @ts-ignore
import { GetLoginDto } from '../model/get-login-dto';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
@@ -38,21 +40,24 @@ export class LoginService extends BaseService {
}
/**
* @endpoint post /API/login
* @param connectLoginDto
* @endpoint post /API/login/create
* @param createLoginDto
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public userLoginEndpoint(connectLoginDto: ConnectLoginDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<GetLoginConnectDto>;
public userLoginEndpoint(connectLoginDto: ConnectLoginDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<GetLoginConnectDto>>;
public userLoginEndpoint(connectLoginDto: ConnectLoginDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<GetLoginConnectDto>>;
public userLoginEndpoint(connectLoginDto: ConnectLoginDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (connectLoginDto === null || connectLoginDto === undefined) {
throw new Error('Required parameter connectLoginDto was null or undefined when calling userLoginEndpoint.');
public createLoginEndpoint(createLoginDto: CreateLoginDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<GetLoginDto>;
public createLoginEndpoint(createLoginDto: CreateLoginDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<GetLoginDto>>;
public createLoginEndpoint(createLoginDto: CreateLoginDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<GetLoginDto>>;
public createLoginEndpoint(createLoginDto: CreateLoginDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (createLoginDto === null || createLoginDto === undefined) {
throw new Error('Required parameter createLoginDto was null or undefined when calling createLoginEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
// authentication (JWTBearerAuth) required
localVarHeaders = this.configuration.addCredentialToHeaders('JWTBearerAuth', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
@@ -65,6 +70,69 @@ export class LoginService extends BaseService {
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/login/create`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<GetLoginDto>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: createLoginDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint post /API/login
* @param connectLoginDto
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public userLoginEndpoint(connectLoginDto: ConnectLoginDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
public userLoginEndpoint(connectLoginDto: ConnectLoginDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public userLoginEndpoint(connectLoginDto: ConnectLoginDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public userLoginEndpoint(connectLoginDto: ConnectLoginDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (connectLoginDto === null || connectLoginDto === undefined) {
throw new Error('Required parameter connectLoginDto was null or undefined when calling userLoginEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
@@ -87,7 +155,7 @@ export class LoginService extends BaseService {
let localVarPath = `/API/login`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<GetLoginConnectDto>('post', `${basePath}${localVarPath}`,
return this.httpClient.request<any>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: connectLoginDto,

View File

@@ -1,331 +0,0 @@
/**
* ApiEfCoreLibrary
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/* tslint:disable:no-unused-variable member-ordering */
import { Inject, Injectable, Optional } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
import { CreateLoginDto } from '../model/create-login-dto';
// @ts-ignore
import { GetLoginDto } from '../model/get-login-dto';
// @ts-ignore
import { UpdateLoginDto } from '../model/update-login-dto';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root'
})
export class LoginsService extends BaseService {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
/**
* @endpoint post /API/logins
* @param createLoginDto
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public createLoginEndpoint(createLoginDto: CreateLoginDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<GetLoginDto>;
public createLoginEndpoint(createLoginDto: CreateLoginDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<GetLoginDto>>;
public createLoginEndpoint(createLoginDto: CreateLoginDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<GetLoginDto>>;
public createLoginEndpoint(createLoginDto: CreateLoginDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (createLoginDto === null || createLoginDto === undefined) {
throw new Error('Required parameter createLoginDto was null or undefined when calling createLoginEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/logins`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<GetLoginDto>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: createLoginDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint delete /API/logins/{id}
* @param id
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public deleteLoginEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any>;
public deleteLoginEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public deleteLoginEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public deleteLoginEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling deleteLoginEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/logins/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint get /API/logins
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getAllLoginEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<GetLoginDto>>;
public getAllLoginEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<GetLoginDto>>>;
public getAllLoginEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<GetLoginDto>>>;
public getAllLoginEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/logins`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<GetLoginDto>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint get /API/logins/{id}
* @param id
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getLoginEndpoint(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<GetLoginDto>;
public getLoginEndpoint(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<GetLoginDto>>;
public getLoginEndpoint(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<GetLoginDto>>;
public getLoginEndpoint(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling getLoginEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/logins/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<GetLoginDto>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* @endpoint put /API/logins/{id}
* @param id
* @param updateLoginDto
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public updateLoginEndpoint(id: number, updateLoginDto: UpdateLoginDto, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<GetLoginDto>;
public updateLoginEndpoint(id: number, updateLoginDto: UpdateLoginDto, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<GetLoginDto>>;
public updateLoginEndpoint(id: number, updateLoginDto: UpdateLoginDto, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<GetLoginDto>>;
public updateLoginEndpoint(id: number, updateLoginDto: UpdateLoginDto, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling updateLoginEndpoint.');
}
if (updateLoginDto === null || updateLoginDto === undefined) {
throw new Error('Required parameter updateLoginDto was null or undefined when calling updateLoginEndpoint.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/API/logins/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int32"})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<GetLoginDto>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: updateLoginDto,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
}

View File

@@ -1,5 +1,5 @@
/**
* ApiEfCoreLibrary
* ApiLibrary
*
*
*
@@ -161,10 +161,10 @@ export class UsersService extends BaseService {
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getAllUsersEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<GetUserDto>>;
public getAllUsersEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<GetUserDto>>>;
public getAllUsersEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<GetUserDto>>>;
public getAllUsersEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
public getAllUserEndpoint(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<GetUserDto>>;
public getAllUserEndpoint(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<GetUserDto>>>;
public getAllUserEndpoint(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<GetUserDto>>>;
public getAllUserEndpoint(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
let localVarHeaders = this.defaultHeaders;

View File

@@ -1,5 +1,5 @@
/**
* ApiEfCoreLibrary
* ApiLibrary
*
*
*

View File

@@ -1,5 +1,5 @@
/**
* ApiEfCoreLibrary
* ApiLibrary
*
*
*
@@ -10,7 +10,7 @@
export interface CreateAuthorDto {
name?: string | null;
firstName?: string | null;
name?: string | null;
}

View File

@@ -1,5 +1,5 @@
/**
* ApiEfCoreLibrary
* ApiLibrary
*
*
*
@@ -11,8 +11,8 @@
export interface CreateBookDto {
title?: string | null;
authorId?: number;
releaseYear?: number | null;
isbn?: string | null;
authorId?: number;
}

View File

@@ -1,5 +1,5 @@
/**
* ApiEfCoreLibrary
* ApiLibrary
*
*
*
@@ -10,8 +10,8 @@
export interface CreateLoanDto {
bookId?: number;
userId?: number;
bookId?: number;
date?: string;
}

View File

@@ -1,5 +1,5 @@
/**
* ApiEfCoreLibrary
* ApiLibrary
*
*
*
@@ -10,8 +10,9 @@
export interface CreateLoginDto {
username?: string | null;
fullName?: string | null;
password?: string | null;
username?: string;
password?: string;
fullName?: string;
role?: string;
}

View File

@@ -1,5 +1,5 @@
/**
* ApiEfCoreLibrary
* ApiLibrary
*
*
*

View File

@@ -1,5 +1,5 @@
/**
* ApiEfCoreLibrary
* ApiLibrary
*
*
*
@@ -12,8 +12,8 @@ import { GetBookDto } from './get-book-dto';
export interface GetAuthorDto {
id?: number;
name?: string | null;
firstName?: string | null;
name?: string | null;
books?: Array<GetBookDto> | null;
}

View File

@@ -1,5 +1,5 @@
/**
* ApiEfCoreLibrary
* ApiLibrary
*
*
*
@@ -12,11 +12,10 @@
export interface GetBookDto {
id?: number;
title?: string | null;
authorId?: number;
bookAuthorId?: number;
bookAuthorName?: string | null;
bookAuthorFirstName?: string | null;
releaseYear?: number | null;
isbn?: string | null;
authorId?: number;
authorFirstName?: string | null;
authorName?: string | null;
}

View File

@@ -1,5 +1,5 @@
/**
* ApiEfCoreLibrary
* ApiLibrary
*
*
*
@@ -11,20 +11,19 @@
export interface GetLoanDto {
id?: number;
bookId?: number;
bookTitle?: string | null;
bookAuthorId?: number;
bookAuthorName?: string | null;
bookAuthorFirstName?: string | null;
bookReleaseYear?: number | null;
bookIsbn?: string | null;
date?: string;
plannedReturningDate?: string;
effectiveReturningDate?: string | null;
userId?: number;
userName?: string | null;
userFirstName?: string | null;
userEmail?: string | null;
userBirthDate?: string | null;
date?: string;
plannedReturningDate?: string;
effectiveReturningDate?: string | null;
bookId?: number;
bookTitle?: string | null;
bookReleaseYear?: number | null;
bookISBN?: string | null;
bookAuthorName?: string | null;
bookAuthorFirstName?: string | null;
}

View File

@@ -1,15 +0,0 @@
/**
* ApiEfCoreLibrary
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface GetLoginConnectDto {
token?: string | null;
}

View File

@@ -1,5 +1,5 @@
/**
* ApiEfCoreLibrary
* ApiLibrary
*
*
*
@@ -12,8 +12,9 @@
export interface GetLoginDto {
id?: number;
username?: string | null;
fullName?: string | null;
password?: string | null;
fullName?: string | null;
salt?: string | null;
role?: string | null;
}

View File

@@ -1,5 +1,5 @@
/**
* ApiEfCoreLibrary
* ApiLibrary
*
*
*
@@ -16,6 +16,6 @@ export interface GetUserDto {
firstName?: string | null;
email?: string | null;
birthDate?: string | null;
loans?: Array<GetLoanDto> | null;
loans?: Array<GetLoanDto>;
}

View File

@@ -7,12 +7,10 @@ export * from './create-user-dto';
export * from './get-author-dto';
export * from './get-book-dto';
export * from './get-loan-dto';
export * from './get-login-connect-dto';
export * from './get-login-dto';
export * from './get-user-dto';
export * from './patch-loan-dto';
export * from './update-author-dto';
export * from './update-book-dto';
export * from './update-loan-dto';
export * from './update-login-dto';
export * from './update-loan-effective-return-date-dto';
export * from './update-user-dto';

View File

@@ -1,5 +1,5 @@
/**
* ApiEfCoreLibrary
* ApiLibrary
*
*
*
@@ -10,7 +10,7 @@
export interface UpdateAuthorDto {
name?: string | null;
firstName?: string | null;
name?: string | null;
}

View File

@@ -1,5 +1,5 @@
/**
* ApiEfCoreLibrary
* ApiLibrary
*
*
*
@@ -11,8 +11,8 @@
export interface UpdateBookDto {
title?: string | null;
releaseYear?: number | null;
isbn?: string | null;
authorId?: number;
releaseYear?: number;
isbn?: string | null;
}

View File

@@ -1,5 +1,5 @@
/**
* ApiEfCoreLibrary
* ApiLibrary
*
*
*
@@ -10,8 +10,8 @@
export interface UpdateLoanDto {
bookId?: number;
userId?: number;
bookId?: number;
date?: string;
plannedReturningDate?: string;
effectiveReturningDate?: string | null;

View File

@@ -1,5 +1,5 @@
/**
* ApiEfCoreLibrary
* ApiLibrary
*
*
*
@@ -9,7 +9,7 @@
*/
export interface PatchLoanDto {
export interface UpdateLoanEffectiveReturnDateDto {
effectiveReturningDate?: string;
}

View File

@@ -1,17 +0,0 @@
/**
* ApiEfCoreLibrary
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface UpdateLoginDto {
username?: string | null;
fullName?: string | null;
password?: string | null;
}

View File

@@ -1,5 +1,5 @@
/**
* ApiEfCoreLibrary
* ApiLibrary
*
*
*