management of library
All checks were successful
build / windows (push) Successful in 2m38s
build / linux (push) Successful in 2m0s

This commit is contained in:
2025-03-07 11:51:21 +01:00
parent e90cdf4e6a
commit 5bedea5312
26 changed files with 1078 additions and 228 deletions

View File

@ -1,4 +1,39 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import {model} from '../models';
export function BookLended(arg1:number):Promise<boolean>;
export function DeleteAuthor(arg1:model.Author):Promise<void>;
export function DeleteBook(arg1:model.Book):Promise<void>;
export function DeleteClient(arg1:model.Client):Promise<void>;
export function DeleteLending(arg1:model.Lending):Promise<void>;
export function GetAllLendings():Promise<Array<model.Lending>>;
export function GetAuthors():Promise<Array<model.Author>>;
export function GetAvailableBooks():Promise<Array<model.Book>>;
export function GetBooks():Promise<Array<model.Book>>;
export function GetClients():Promise<Array<model.Client>>;
export function GetLendings():Promise<Array<model.Lending>>;
export function GetReturnedLendings():Promise<Array<model.Lending>>;
export function Greet(arg1:string):Promise<string>;
export function ReturnLending(arg1:model.Lending):Promise<void>;
export function SaveAuthor(arg1:model.Author):Promise<void>;
export function SaveBook(arg1:model.Book):Promise<void>;
export function SaveClient(arg1:model.Client):Promise<void>;
export function SaveLending(arg1:model.Lending):Promise<string>;

View File

@ -2,6 +2,74 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export function BookLended(arg1) {
return window['go']['main']['App']['BookLended'](arg1);
}
export function DeleteAuthor(arg1) {
return window['go']['main']['App']['DeleteAuthor'](arg1);
}
export function DeleteBook(arg1) {
return window['go']['main']['App']['DeleteBook'](arg1);
}
export function DeleteClient(arg1) {
return window['go']['main']['App']['DeleteClient'](arg1);
}
export function DeleteLending(arg1) {
return window['go']['main']['App']['DeleteLending'](arg1);
}
export function GetAllLendings() {
return window['go']['main']['App']['GetAllLendings']();
}
export function GetAuthors() {
return window['go']['main']['App']['GetAuthors']();
}
export function GetAvailableBooks() {
return window['go']['main']['App']['GetAvailableBooks']();
}
export function GetBooks() {
return window['go']['main']['App']['GetBooks']();
}
export function GetClients() {
return window['go']['main']['App']['GetClients']();
}
export function GetLendings() {
return window['go']['main']['App']['GetLendings']();
}
export function GetReturnedLendings() {
return window['go']['main']['App']['GetReturnedLendings']();
}
export function Greet(arg1) {
return window['go']['main']['App']['Greet'](arg1);
}
export function ReturnLending(arg1) {
return window['go']['main']['App']['ReturnLending'](arg1);
}
export function SaveAuthor(arg1) {
return window['go']['main']['App']['SaveAuthor'](arg1);
}
export function SaveBook(arg1) {
return window['go']['main']['App']['SaveBook'](arg1);
}
export function SaveClient(arg1) {
return window['go']['main']['App']['SaveClient'](arg1);
}
export function SaveLending(arg1) {
return window['go']['main']['App']['SaveLending'](arg1);
}

View File

@ -1,35 +1,30 @@
export namespace model {
export class SubThing {
export class Client {
ID: number;
ThingID: number;
// Go type: time
CreatedAt: any;
// Go type: time
UpdatedAt: any;
// Go type: gorm
DeletedAt: any;
Name: string;
Email: string;
Lendings: Lending[];
static createFrom(source: any = {}) {
return new SubThing(source);
return new Client(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.ID = source["ID"];
this.ThingID = source["ThingID"];
this.CreatedAt = this.convertValues(source["CreatedAt"], null);
this.UpdatedAt = this.convertValues(source["UpdatedAt"], null);
this.DeletedAt = this.convertValues(source["DeletedAt"], null);
this.Name = source["Name"];
}
}
export class Thing {
ID: number;
Name: string;
Subthings: SubThing[];
static createFrom(source: any = {}) {
return new Thing(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.ID = source["ID"];
this.Name = source["Name"];
this.Subthings = this.convertValues(source["Subthings"], SubThing);
this.Email = source["Email"];
this.Lendings = this.convertValues(source["Lendings"], Lending);
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
@ -50,6 +45,152 @@ export namespace model {
return a;
}
}
export class Lending {
ID: number;
// Go type: time
CreatedAt: any;
// Go type: time
UpdatedAt: any;
// Go type: gorm
DeletedAt: any;
// Go type: time
DueDate: any;
Returned: boolean;
ClientID: number;
Client: Client;
BookID: number;
Book: Book;
static createFrom(source: any = {}) {
return new Lending(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.ID = source["ID"];
this.CreatedAt = this.convertValues(source["CreatedAt"], null);
this.UpdatedAt = this.convertValues(source["UpdatedAt"], null);
this.DeletedAt = this.convertValues(source["DeletedAt"], null);
this.DueDate = this.convertValues(source["DueDate"], null);
this.Returned = source["Returned"];
this.ClientID = source["ClientID"];
this.Client = this.convertValues(source["Client"], Client);
this.BookID = source["BookID"];
this.Book = this.convertValues(source["Book"], Book);
}
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;
}
}
export class Book {
ID: number;
// Go type: time
CreatedAt: any;
// Go type: time
UpdatedAt: any;
// Go type: gorm
DeletedAt: any;
Title: string;
ISBN: string;
AuthorID: number;
Author: Author;
Lendings: Lending[];
static createFrom(source: any = {}) {
return new Book(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.ID = source["ID"];
this.CreatedAt = this.convertValues(source["CreatedAt"], null);
this.UpdatedAt = this.convertValues(source["UpdatedAt"], null);
this.DeletedAt = this.convertValues(source["DeletedAt"], null);
this.Title = source["Title"];
this.ISBN = source["ISBN"];
this.AuthorID = source["AuthorID"];
this.Author = this.convertValues(source["Author"], Author);
this.Lendings = this.convertValues(source["Lendings"], Lending);
}
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;
}
}
export class Author {
ID: number;
// Go type: time
CreatedAt: any;
// Go type: time
UpdatedAt: any;
// Go type: gorm
DeletedAt: any;
Name: string;
Books: Book[];
static createFrom(source: any = {}) {
return new Author(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.ID = source["ID"];
this.CreatedAt = this.convertValues(source["CreatedAt"], null);
this.UpdatedAt = this.convertValues(source["UpdatedAt"], null);
this.DeletedAt = this.convertValues(source["DeletedAt"], null);
this.Name = source["Name"];
this.Books = this.convertValues(source["Books"], Book);
}
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;
}
}
}

View File

@ -1,15 +0,0 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import {model} from '../models';
export function AddSubThing(arg1:number,arg2:string):Promise<void>;
export function DeleteSubThing(arg1:number):Promise<void>;
export function DeleteThing(arg1:number):Promise<void>;
export function GetSubThings(arg1:number):Promise<Array<model.SubThing>>;
export function GetThings():Promise<Array<model.Thing>>;
export function NewThing(arg1:string):Promise<void>;

View File

@ -1,27 +0,0 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export function AddSubThing(arg1, arg2) {
return window['go']['things']['Service']['AddSubThing'](arg1, arg2);
}
export function DeleteSubThing(arg1) {
return window['go']['things']['Service']['DeleteSubThing'](arg1);
}
export function DeleteThing(arg1) {
return window['go']['things']['Service']['DeleteThing'](arg1);
}
export function GetSubThings(arg1) {
return window['go']['things']['Service']['GetSubThings'](arg1);
}
export function GetThings() {
return window['go']['things']['Service']['GetThings']();
}
export function NewThing(arg1) {
return window['go']['things']['Service']['NewThing'](arg1);
}