38 lines
839 B
Go
Raw Normal View History

2023-05-31 18:33:02 +08:00
package logic
import (
"context"
2023-06-05 17:56:55 +08:00
"fusenapi/model"
2023-06-08 10:51:56 +08:00
"fusenapi/server/home-user-auth/internal/svc"
"fusenapi/server/home-user-auth/internal/types"
2023-06-12 15:17:42 +08:00
"fusenapi/utils/auth"
2023-06-05 17:56:55 +08:00
"fusenapi/utils/basic"
2023-05-31 18:33:02 +08: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-12 17:28:49 +08:00
func (l *UserFontsLogic) UserFonts(req *types.Request, userinfo *auth.UserInfo) (resp *basic.Response) {
2023-06-05 17:56:55 +08:00
data, err := model.NewFsFontModel(l.svcCtx.MysqlConn).FindAllOrderSortByDesc(l.ctx)
2023-06-01 12:15:36 +08:00
if err != nil {
logx.Error(err)
2023-06-07 11:57:04 +08:00
return resp.SetStatus(basic.CodeOK, data)
2023-06-01 12:15:36 +08:00
}
2023-06-05 17:56:55 +08:00
2023-06-07 11:57:04 +08:00
return resp.SetStatus(basic.CodeOK)
2023-05-31 18:33:02 +08:00
}