init(models): initialize models

also add .gitignore
This commit is contained in:
Masahiko AMANO 2025-01-14 00:32:57 +03:00
commit 80782e4f67
2 changed files with 44 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
bin/
.vscode/
.stfolder/

41
internal/models/models.go Normal file
View File

@ -0,0 +1,41 @@
package models
import (
"database/sql"
"time"
)
type Person struct {
ID string `json:"id"`
Name string `json:"name"`
Birthdate time.Time `json:"birthdate"`
Deathdate sql.NullTime `json:"deathdate"`
Info sql.NullString `json:"info"`
}
type Role struct {
ID string `json:"id"`
Name string `json:"name"`
}
type Credit struct {
Person Person `json:"person"`
Role Role `json:"role"`
}
type Artist struct {
ID string `json:"id"`
Name string `json:"name"`
Notes sql.NullString `json:"notes"`
}
type Track struct {
ID string `json:"id"`
Name string `json:"name"`
Artists []Artist `json:"artists"`
ReleaseDate sql.NullTime `json:"release_date"`
AcquireDate time.Time `json:"acquire_date"`
ISRC sql.NullString `json:"isrc"`
Credits []Credit `json:"credits"`
Notes sql.NullString `json:"notes"`
}