model

package
v0.0.0-...-57d8560 Latest Latest
Warning

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

Go to latest
Published: May 14, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseModel

type BaseModel struct {
	ID        uint64         `gorm:"primarykey" json:"id"`
	CreatedAt time.Time      `json:"createdAt"`
	UpdatedAt time.Time      `json:"updatedAt"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"deletedAt"`
}

type Company

type Company struct {
	BaseModel
	Provider          int    `gorm:"index:idx_provider_provider_company_id,unique" json:"provider"`
	ProviderCompanyID string `gorm:"index:idx_provider_provider_company_id,unique" json:"providerCompanyId"`
	Name              string `json:"name"`
	Content           string `json:"content"` // TODO: can be refactored to use gorm custom data type
	Link              string `json:"link"`
}

func (*Company) GetContent

func (c *Company) GetContent() (map[string]interface{}, error)

func (*Company) SetContent

func (c *Company) SetContent(content interface{}) error

type Job

type Job struct {
	BaseModel
	CompanyID     *uint64  `json:"company_id"`
	Company       *Company `json:"company"`
	Provider      int      `gorm:"index:idx_provider_provider_job_id,unique" json:"provider"`
	ProviderJobID string   `gorm:"index:idx_provider_provider_job_id,unique" json:"providerJobId"`
	Title         string   `json:"title"`
	Salary        string   `json:"salary"`
	Location      string   `json:"location"`
	Link          string   `json:"link"`
	Description   string   `json:"description"`
}

type User

type User struct {
	BaseModel
	Email        string `json:"email"`
	PasswordHash string
}

TODO: set unique constraint on email

Jump to

Keyboard shortcuts

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