fusenapi/model/gmodel/fs_font_logic.go
2023-06-15 16:08:43 +08:00

22 lines
383 B
Go

package gmodel
import (
"context"
)
// TODO: 使用model的属性做你想做的
func (m *FsFontModel) FindAllOrderSortByDesc(ctx context.Context) ([]*FsFont, error) {
var fonts []*FsFont
err := m.db.Model(&FsFont{}).Order("sort desc").Find(&fonts).Error
switch err {
case nil:
return fonts, nil
case ErrRecordNotFound:
return nil, nil
default:
return nil, err
}
}