fusenapi/home-user-auth/internal/logic/userfontslogic.go

42 lines
822 B
Go
Raw Normal View History

2023-05-31 10:33:02 +00:00
package logic
import (
"context"
"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/core/logx"
)
type UserFontsLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewUserFontsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserFontsLogic {
return &UserFontsLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *UserFontsLogic) UserFonts(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
2023-06-01 05:05:57 +00:00
f, err := l.svcCtx.FsFontModel.FindAllOrderSortByDesc(l.ctx)
2023-06-01 04:15:36 +00:00
if err != nil {
// panic(err)
logx.Error(err)
return
}
2023-06-01 05:05:57 +00:00
// logx.Info(f)
2023-06-01 04:15:36 +00:00
resp = &types.Response{
2023-06-01 05:05:57 +00:00
Code: 200,
Message: "success",
Data: f,
2023-06-01 04:15:36 +00:00
}
2023-05-31 10:33:02 +00:00
return
}