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

37 lines
777 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-06-05 09:56:55 +00:00
"fusenapi/model"
"fusenapi/utils/basic"
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,
}
}
2023-06-05 09:56:55 +00:00
func (l *UserFontsLogic) UserFonts(req *types.Request) (resp *types.Response) {
data, err := model.NewFsFontModel(l.svcCtx.MysqlConn).FindAllOrderSortByDesc(l.ctx)
2023-06-01 04:15:36 +00:00
if err != nil {
logx.Error(err)
2023-06-07 03:57:04 +00:00
return resp.SetStatus(basic.CodeOK, data)
2023-06-01 04:15:36 +00:00
}
2023-06-05 09:56:55 +00:00
2023-06-07 03:57:04 +00:00
return resp.SetStatus(basic.CodeOK)
2023-05-31 10:33:02 +00:00
}