| 12345678910111213141516171819202122232425 |
- package handler
- import (
- "github.com/zeromicro/go-zero/rest/httpx"
- "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"
- )
- func unfollowUserHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- var req types.UnFollowUserReq
- if err := httpx.Parse(r, &req); err != nil {
- httpx.Error(w, err)
- return
- }
- l := logic.NewUnfollowUserLogic(r.Context(), svcCtx)
- resp, err := l.UnfollowUser(&req)
- response.Response(w, resp, err) //②
- }
- }
|