e45241fa20
Fix a few issues with users and accounts caused by reusing code without changing it correctly. Also changed some naming mistakes that made the documentation invalid.
70 lines
1.9 KiB
Go
Executable file
70 lines
1.9 KiB
Go
Executable file
/*
|
|
ScheduleTogether Backend
|
|
Copyright (C) 2024, Zervó Zadachin
|
|
|
|
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU Affero General Public License version 3
|
|
as published by the Free Software Foundation.
|
|
|
|
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 Affero General Public License version 3 for more details.
|
|
|
|
This program incorporates external libraries for certain functionalities.
|
|
These libraries are covered by their respective licenses, and their usage
|
|
agreements are as outlined in their respective documentation or source
|
|
code.
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
package database
|
|
|
|
import (
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type User struct {
|
|
gorm.Model
|
|
FirstName string `json:"firstName"`
|
|
LastName string `json:"lastName"`
|
|
Username string `json:"username"`
|
|
Email string `json:"email"`
|
|
Uuid string `json:"uuid"`
|
|
Role string `json:"role"`
|
|
Friends Friends `gorm:"type:VARCHAR(255)" json:"friends"`
|
|
Hash string `json:"hash,omitempty"`
|
|
Verified bool `json:"verified"`
|
|
}
|
|
|
|
type FriendRequest struct {
|
|
gorm.Model
|
|
Target string `json:"target"`
|
|
Source string `json:"source"`
|
|
}
|
|
|
|
type RegisterVerification struct {
|
|
gorm.Model
|
|
Uuid string `json:"uuid"`
|
|
Token string `json:"token"`
|
|
}
|
|
|
|
type Schedule struct {
|
|
gorm.Model
|
|
Uuid string `json:"uuid"`
|
|
Data string `json:"data"`
|
|
}
|
|
|
|
type Gateway struct {
|
|
gorm.Model
|
|
Address string `json:"address"`
|
|
Port int `json:"port"`
|
|
Protocol string `json:"protocol"`
|
|
Priority int `json:"priority"`
|
|
Health string `json:"health"`
|
|
Key string `json:"key"`
|
|
}
|