models

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMedicine added in v1.2.0

func CreateMedicine(medicine *Medicine) (err error)

CreateMedicine ... Insert New data

func DeleteMedicine added in v1.2.0

func DeleteMedicine(id int) (err error)

DeleteMedicine ... Delete medicine

func GetAllMedicines added in v1.0.1

func GetAllMedicines(medicine *[]Medicine) (err error)

GetAllMedicines Fetch all medicine data

func GetMedicineByID added in v1.2.0

func GetMedicineByID(medicine *Medicine, id int) (err error)

GetMedicineByID ... Fetch only one medicine by Id

Types

type Medicine added in v1.0.1

type Medicine struct {
	ID          int       `json:"id" example:"123" gorm:"primaryKey"`
	Name        string    `json:"name" example:"Paracetamol" gorm:"unique"`
	Description string    `json:"description" example:"Some Description"`
	EANCode     string    `json:"ean_code" example:"9900000124" gorm:"unique"`
	Laboratory  string    `json:"laboratory" example:"Roche"`
	CreatedAt   time.Time `json:"created_at,omitempty" example:"2021-02-24 20:19:39" gorm:"autoCreateTime:mili"`
	UpdatedAt   time.Time `json:"updated_at,omitempty" example:"2021-02-24 20:19:39" gorm:"autoUpdateTime:mili"`
}

func UpdateMedicine added in v1.2.0

func UpdateMedicine(id int, medicineMap map[string]interface{}) (medicine Medicine, err error)

UpdateMedicine ... Update medicine

func (*Medicine) TableName added in v1.2.0

func (b *Medicine) TableName() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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