healthapp
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

29 lines
628 B

package handler
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"healthapi/internal/logic"
"healthapi/internal/svc"
"healthapi/internal/types"
"healthapi/pkg/response"
)
func SubmitAllergyHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.SubmitAllergyReq
if err := httpx.Parse(r, &req); err != nil {
response.Error(w, err)
return
}
l := logic.NewSubmitAllergyLogic(r.Context(), svcCtx)
resp, err := l.SubmitAllergy(&req)
if err != nil {
response.Error(w, err)
} else {
response.Success(w, resp)
}
}
}