db

package
v0.0.0-...-e3a0aff Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectDB

func ConnectDB() *gorm.DB

ConnectDB : Make database connection

Types

type Admin

type Admin struct {
	gorm.Model

	FirstName string `json:"FirstName"`
	LastName  string `json:"LastName"`
	Email     string `json:"Email"`
	Password  string `json:"Password"`
}

type Conversation

type Conversation struct {
	gorm.Model

	ConversationID uint

	From uint

	Message string

	Url string

	SentAt time.Time
}

type CustomClaims

type CustomClaims struct {
	UserID uint
	Name   string
	Email  string
	Role   string

	jwt.StandardClaims
}

type PairedUsers

type PairedUsers struct {
	gorm.Model

	PsychologistID uint

	PatientID uint

	Conversation []Conversation `gorm:"foreignKey:ConversationID"`

	EncryptionKey string

	PairedAt time.Time
}

type Patient

type Patient struct {
	gorm.Model

	NickName string `json:"NickName"`
	Password string `json:"Password"`

	PairedUsers []PairedUsers
}

func (*Patient) GetPairedUsers

func (p *Patient) GetPairedUsers() []PairedUsers

func (*Patient) TableName

func (p *Patient) TableName() string

type Profile

type Profile struct {
	gorm.Model

	ID           uint
	Psychologist uint   `gorm:"primaryKey;autoIncrement:false"`
	PhoneNumber  string `json:"PhoneNumber"`
	Image        string `json:"Image"`
	Country      string `json:"Country"`
	FocusedArea  string `json:"FocusedArea"`
	Address      string `json:"Address"`
	Description  string `json:"Description"`
}

type Psychologist

type Psychologist struct {
	gorm.Model

	FirstName string `json:"FirstName"`
	LastName  string `json:"LastName"`
	Email     string `json:"Email"`
	Password  string `json:"Password"`
	IsVerfied bool   `json:"IsVerfied" gorm:"default:false"`
	IsDeleted bool   `json:"IsDeleted" gorm:"default:false"`

	PairedUsers []PairedUsers
	Profile     Profile `gorm:"foreignKey:Psychologist"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL