完成 /user/fonts 功能
This commit is contained in:
@@ -25,15 +25,17 @@ func NewUserFontsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserFon
|
||||
|
||||
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.FindOne(context.TODO(), 10)
|
||||
f, err := l.svcCtx.FsFontModel.FindAllOrderSortByDesc(l.ctx)
|
||||
if err != nil {
|
||||
// panic(err)
|
||||
logx.Error(err)
|
||||
return
|
||||
}
|
||||
logx.Info(f)
|
||||
// logx.Info(f)
|
||||
resp = &types.Response{
|
||||
Data: f,
|
||||
Code: 200,
|
||||
Message: "success",
|
||||
Data: f,
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ type ServiceContext struct {
|
||||
}
|
||||
|
||||
func NewServiceContext(c config.Config) *ServiceContext {
|
||||
|
||||
return &ServiceContext{
|
||||
Config: c,
|
||||
FsFontModel: model.NewFsFontModel(sqlx.NewMysql(c.DataSource)),
|
||||
|
||||
Reference in New Issue
Block a user