| 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 searchUsernameHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- var req types.SearchUsernameReq
- if err := httpx.Parse(r, &req); err != nil {
- httpx.ErrorCtx(r.Context(), w, err)
- return
- }
- l := logic.NewSearchUsernameLogic(r.Context(), svcCtx)
- resp, err := l.SearchUsername(&req)
- response.Response(w, resp, err)
- }
- }
|