add get medcard by id
This commit is contained in:
1
main.go
1
main.go
@@ -79,6 +79,7 @@ func main() {
|
||||
// Medical cards
|
||||
|
||||
mainGroup.GET("/medical_cards", medical_information.GetMCList)
|
||||
mainGroup.GET("/medical_cards/:id", medical_information.GetMC)
|
||||
mainGroup.POST("/medical_cards", medical_information.CreateMC)
|
||||
|
||||
// Store
|
||||
|
||||
@@ -31,3 +31,17 @@ func CreateMC(c echo.Context) error {
|
||||
|
||||
return c.Blob(resp.StatusCode, resp.Header.Get("Content-Type"), data)
|
||||
}
|
||||
|
||||
func GetMC(c echo.Context) error {
|
||||
id := c.Param("id")
|
||||
|
||||
data, err, resp := api.GetRequest(
|
||||
config.Env.MSHosts.MedicalCardHost+"/medical_cards/"+id,
|
||||
c.Request().Header, c.Request().URL.RawQuery)
|
||||
|
||||
if err != nil {
|
||||
return c.NoContent(http.StatusBadGateway)
|
||||
}
|
||||
|
||||
return c.Blob(resp.StatusCode, resp.Header.Get("Content-Type"), data)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user