42 lines
822 B
Go
42 lines
822 B
Go
package logic
|
|
|
|
import (
|
|
"context"
|
|
|
|
"fusenapi/home-user-auth/internal/svc"
|
|
"fusenapi/home-user-auth/internal/types"
|
|
|
|
"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
|
|
f, err := l.svcCtx.FsFontModel.FindAllOrderSortByDesc(l.ctx)
|
|
if err != nil {
|
|
// panic(err)
|
|
logx.Error(err)
|
|
return
|
|
}
|
|
// logx.Info(f)
|
|
resp = &types.Response{
|
|
Code: 200,
|
|
Message: "success",
|
|
Data: f,
|
|
}
|
|
return
|
|
}
|