fusenapi/home-user-auth/internal/handler/userfontshandler.go

29 lines
661 B
Go
Raw Normal View History

2023-05-31 10:33:02 +00:00
package handler
import (
"net/http"
"fusenapi/home-user-auth/internal/logic"
"fusenapi/home-user-auth/internal/svc"
"fusenapi/home-user-auth/internal/types"
2023-05-31 10:33:02 +00:00
"github.com/zeromicro/go-zero/rest/httpx"
)
func UserFontsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
httpx.ErrorCtx(r.Context(), w, err)
return
}
l := logic.NewUserFontsLogic(r.Context(), svcCtx)
resp, err := l.UserFonts(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
}
}