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