api

package
v0.0.0-...-a1e7e79 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Stat *StatHandler
}

func New

func New(cfg *config.Config, infra *infrastructure.Infra) *API

func (*API) Build

func (a *API) Build() *gin.Engine

type ResponsePeriod

type ResponsePeriod struct {
	Type string `json:"type"`
	Data Stat   `json:"data"`
}

type ResponseTotal

type ResponseTotal struct {
	Type  string `json:"type"`
	Data  Stat   `json:"data"`
	Month Stat   `json:"month"`
}

type Stat

type Stat struct {
	Patients  uint64 `json:"patients"`
	Documents uint64 `json:"documents"`
	Time      uint64 `json:"time"`
}

type StatHandler

type StatHandler struct {
	// contains filtered or unexported fields
}

func NewStatHandler

func NewStatHandler(db *localDB.DB) *StatHandler

func (*StatHandler) GetStat

func (h *StatHandler) GetStat(c *gin.Context)

GetStatPerMonth @Summary Get IPEHR statistics per month @Description Retrieve the IPEHR statistics per month @Tags Stat @Produce json @Param period path string false "Month in YYYYYMM format. Example: 202201" @Success 200 {object} ResponsePeriod @Failure 500 "Is returned when an unexpected error occurs while processing a request" @Router /{period} [get]

func (*StatHandler) GetTotal

func (h *StatHandler) GetTotal(c *gin.Context)

GetStat @Summary Get IPEHR statistics total @Description Retrieve the IPEHR statistics total and current month @Tags Stat @Produce json @Success 200 {object} ResponseTotal @Failure 500 "Is returned when an unexpected error occurs while processing a request" @Router / [get]

Directories

Path Synopsis
Package docs GENERATED BY SWAG; DO NOT EDIT This file was generated by swaggo/swag
Package docs GENERATED BY SWAG; DO NOT EDIT This file was generated by swaggo/swag

Jump to

Keyboard shortcuts

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