models

package
v0.0.0-...-662530a Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoginCheck

func LoginCheck(u User, username string, password string) (string, error)

func VerifyPassword

func VerifyPassword(password, hashedPassword string) error

Types

type Advertisement struct {
	ID          int    `json:"id"`
	Description string `json:"description"`
	Title       string `json:"title"`
	Power       uint   `json:"power"`
	Price       uint   `json:"price"`
	UserID      int    `json:"userID"`
	CarID       int    `json:"carID"`
}

type Car

type Car struct {
	ID                int       `json:"id"`
	CategoryID        int       `json:"category_id"`
	FuelTypeID        int       `json:"fuelType_id" gorm:"column:fuelType_id"`
	GearboxID         int       `json:"gearbox_id"`
	Make              string    `json:"make"`
	Model             string    `json:"model"`
	Power             uint      `json:"power"`
	Mileage           uint      `json:"mileage"`
	EmissionsCategory uint8     `json:"emissionsCategory" gorm:"column:emissionsCategory"`
	FirstRegistration time.Time `json:"firstRegistration" gorm:"column:firstRegistration"`
	Color             string    `json:"color"`
}

type Config

type Config struct {
	Enabled      bool
	DatabasePath string
	Port         string
}

func NewConfig

func NewConfig() *Config

type LeaseOffer

type LeaseOffer struct {
	ID                    int     `json:"id"`
	UserID                int     `json:"userID"`
	Description           string  `json:"description"`
	FirstInstallmentPtMin string  `json:"firstInstallmentPtMin"`
	FirstInstallmentPtMax string  `json:"firstInstallmentPtMax"`
	InterestRate          float32 `json:"interestRate"`
	PeriodInMonths        uint    `json:"periodInMonths"`
	MinValue              uint    `json:"minValue"`
	MaxValue              uint    `json:"maxValue"`
	IsInsuranceRequired   bool    `json:"isInsuranceRequired"` //required_insurance
}

type User

type User struct {
	ID        int    `json:"id" header:"ID"`
	Password  string `json:"password" gorm:"column:password"`
	UserName  string `json:"userName" gorm:"column:username" header:"Username"`
	FirstName string `json:"firstName" gorm:"column:firstname" header:"First Name"`
	LastName  string `json:"lastName" gorm:"column:lastname" header:"Last Name"`
	Email     string `json:"email" header:"Email"`
	IsPrivate bool   `json:"isPrivate" gorm:"'is_private' boolean"`
	RoleID    int    `json:"roleID" gorm:"'role_id'"` //[role_id]

}

func (*User) BeforeSave

func (u *User) BeforeSave(*gorm.DB) error

Jump to

Keyboard shortcuts

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