38 lines
839 B
Go
38 lines
839 B
Go
package logic
|
|
|
|
import (
|
|
"context"
|
|
|
|
"fusenapi/model"
|
|
"fusenapi/server/home-user-auth/internal/svc"
|
|
"fusenapi/server/home-user-auth/internal/types"
|
|
"fusenapi/utils/auth"
|
|
"fusenapi/utils/basic"
|
|
|
|
"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, userinfo *auth.UserInfo) (resp *basic.Response) {
|
|
data, err := model.NewFsFontModel(l.svcCtx.MysqlConn).FindAllOrderSortByDesc(l.ctx)
|
|
if err != nil {
|
|
logx.Error(err)
|
|
return resp.SetStatus(basic.CodeOK, data)
|
|
}
|
|
|
|
return resp.SetStatus(basic.CodeOK)
|
|
}
|