medicine

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: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteMedicine

func DeleteMedicine(c *gin.Context)

func GetAllMedicines

func GetAllMedicines(c *gin.Context)

GetAllMedicines godoc @Tags medicine @Summary Get all Medicines @Description Get all Medicines on the system @Success 200 {object} []models.Medicine @Failure 400 {object} MessageResponse @Failure 500 {object} MessageResponse @Router /medicine [get]

func GetMedicinesByID

func GetMedicinesByID(c *gin.Context)

GetMedicinesByID godoc @Tags medicine @Summary Get medicines by ID @Description Get Medicines by ID on the system @Param medicine_id path int true "id of medicine" @Success 200 {object} models.Medicine @Failure 400 {object} MessageResponse @Failure 500 {object} MessageResponse @Router /medicine/{medicine_id} [get]

func NewMedicine

func NewMedicine(c *gin.Context)

NewMedicine godoc @Tags medicine @Summary Create New Medicine @Description Create new medicine on the system @Accept json @Produce json @Param data body NewMedicineRequest true "body data" @Success 200 {object} models.Medicine @Failure 400 {object} MessageResponse @Failure 500 {object} MessageResponse @Router /medicine [post]

func UpdateMedicine

func UpdateMedicine(c *gin.Context)

Types

type MessageResponse

type MessageResponse struct {
	Message string `json:"message"`
}

type NewMedicineRequest

type NewMedicineRequest struct {
	Name        string `json:"name" example:"Paracetamol" gorm:"unique" binding:"required"`
	Description string `json:"description" example:"Something" binding:"required"`
	Laboratory  string `json:"laboratory" example:"Roche" binding:"required"`
	EanCode     string `json:"ean_code" example:"122000000021" gorm:"unique" binding:"required"`
}

Jump to

Keyboard shortcuts

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