diff --git a/models/blog_post.go b/models/blog_post.go index d44aaf9..deb952a 100644 --- a/models/blog_post.go +++ b/models/blog_post.go @@ -16,9 +16,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see .Rawley Fowler, 2022 */ -import ( - "gorm.io/gorm" -) + +import "gorm.io/gorm" type BlogPost struct { gorm.Model diff --git a/models/music.go b/models/music.go new file mode 100644 index 0000000..58f6287 --- /dev/null +++ b/models/music.go @@ -0,0 +1,26 @@ +package models + +/* +Copyright (C) 2022 Rawley Fowler + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see .Rawley Fowler, 2022 +*/ + +import "gorm.io/gorm" + +type Music struct { + gorm.Model + Name string `json:"name" gorm:"primaryKey unique"` + Url string `json:"url" gorm:"not null"` +} diff --git a/repos/music_repo.go b/repos/music_repo.go new file mode 100644 index 0000000..b865a59 --- /dev/null +++ b/repos/music_repo.go @@ -0,0 +1,31 @@ +package repos + +/* +Copyright (C) 2022 Rawley Fowler + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see .Rawley Fowler, 2022 +*/ + +import ( + "gorm.io/gorm" +) + +type MusicRepo struct { + DB *gorm.DB +} + +func (mr *MusicRepo) GetAllSongs() []Music { + songs := []Music{} + mr.DB.Select() +} diff --git a/templates/nav.tmpl b/templates/nav.tmpl index 4b2e1a5..1e2c1dd 100644 --- a/templates/nav.tmpl +++ b/templates/nav.tmpl @@ -16,9 +16,12 @@
donate +
+
+ tunes
- software + software