Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteMedicine ¶
func GetAllMedicines ¶
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 ¶
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 ¶
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 ¶
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"` }