| 1234567891011121314151617181920212223242526 |
- package handler
- import (
- "net/http"
- "slow_wild_api/apps/internal/logic"
- "slow_wild_api/apps/internal/response"
- "slow_wild_api/apps/internal/svc"
- "slow_wild_api/apps/internal/types"
- "github.com/zeromicro/go-zero/rest/httpx"
- )
- // 帖子分享
- func postShareHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- var req types.PostShareReq
- if err := httpx.Parse(r, &req); err != nil {
- httpx.ErrorCtx(r.Context(), w, err)
- return
- }
- l := logic.NewPostShareLogic(r.Context(), svcCtx)
- resp, err := l.PostShare(&req)
- response.Response(w, resp, err)
- }
- }
|