mirror of
https://github.com/PhoenixTwoFive/karaoqueue.git
synced 2025-05-19 19:11:49 +02:00
Add constructors and accessors to models
This commit is contained in:
parent
869166f818
commit
c0c6fb8b06
@ -1,4 +1,10 @@
|
|||||||
export class Artist {
|
export class Artist {
|
||||||
|
|
||||||
|
constructor(id: number, name: string) {
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,16 @@
|
|||||||
export class Genre {
|
export class Genre {
|
||||||
id: number;
|
|
||||||
name: string;
|
constructor(id: number, name: string) {
|
||||||
|
this.id = id;
|
||||||
|
this._name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public get name() : string {
|
||||||
|
return this._name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
id: number;
|
||||||
|
_name: string;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,10 @@
|
|||||||
export class Language {
|
export class Language {
|
||||||
|
|
||||||
|
constructor(id: number, name: string) {
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
@ -3,12 +3,24 @@ import { Language } from './language.model';
|
|||||||
import { Artist } from './artist.model';
|
import { Artist } from './artist.model';
|
||||||
|
|
||||||
export class Song {
|
export class Song {
|
||||||
explicit: boolean;
|
|
||||||
duet: boolean;
|
constructor(title: string, artist: Artist, karafun_id: number, duet: boolean, explicit: boolean, id: number, genres: Array<Genre>, languages: Array<Language>) {
|
||||||
|
this.title=title;
|
||||||
|
this.artist=artist;
|
||||||
|
this.karafun_id=karafun_id;
|
||||||
|
this.duet=duet;
|
||||||
|
this.explicit=explicit;
|
||||||
|
this.id=id;
|
||||||
|
this.genres=genres;
|
||||||
|
this.languages=languages;
|
||||||
|
}
|
||||||
|
|
||||||
title: string;
|
title: string;
|
||||||
id: number;
|
artist: Artist;
|
||||||
karafun_id: number;
|
karafun_id: number;
|
||||||
|
duet: boolean;
|
||||||
|
explicit: boolean;
|
||||||
|
id: number;
|
||||||
genres: Array<Genre>;
|
genres: Array<Genre>;
|
||||||
languages: Array<Language>;
|
languages: Array<Language>;
|
||||||
artist: Artist;
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user