1234567891011121314151617181920212223242526272829 |
- package handler
- import (
- "net/http"
- "app.yhyue.com/moapp/jyPoints/api/internal/logic"
- "app.yhyue.com/moapp/jyPoints/api/internal/svc"
- "app.yhyue.com/moapp/jyPoints/api/internal/types"
- "github.com/zeromicro/go-zero/rest/httpx"
- )
- func IntegralConsumeHandler(ctx *svc.ServiceContext) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- var req types.ConsumeReq
- if err := httpx.Parse(r, &req); err != nil {
- httpx.Error(w, err)
- return
- }
- l := logic.NewIntegralConsumeLogic(r.Context(), ctx)
- resp, err := l.IntegralConsume(req)
- if err != nil {
- httpx.Error(w, err)
- } else {
- httpx.OkJson(w, resp)
- }
- }
- }
|