package handler import ( "net/http" "github.com/zeromicro/go-zero/rest/httpx" "healthapi/internal/logic" "healthapi/internal/svc" "healthapi/internal/types" ) func UpdateAddressHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { var req types.AddressIdReq if err := httpx.Parse(r, &req); err != nil { httpx.ErrorCtx(r.Context(), w, err) return } l := logic.NewUpdateAddressLogic(r.Context(), svcCtx) err := l.UpdateAddress(&req) if err != nil { httpx.ErrorCtx(r.Context(), w, err) } else { httpx.Ok(w) } } }