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.
21 lines
462 B
21 lines
462 B
package handler
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/zeromicro/go-zero/rest/httpx"
|
|
"healthapi/internal/logic"
|
|
"healthapi/internal/svc"
|
|
)
|
|
|
|
func ClearCartHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
|
l := logic.NewClearCartLogic(r.Context(), svcCtx)
|
|
resp, err := l.ClearCart()
|
|
if err != nil {
|
|
httpx.ErrorCtx(r.Context(), w, err)
|
|
} else {
|
|
httpx.OkJsonCtx(r.Context(), w, resp)
|
|
}
|
|
}
|
|
}
|
|
|