24 lines
460 B
Go
24 lines
460 B
Go
package model
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
|
)
|
|
|
|
func (m *defaultFsFontModel) FindAllOrderSortByDesc(ctx context.Context) ([]*FsFont, error) {
|
|
|
|
query := fmt.Sprintf("select %s from %s order by sort desc", fsFontRows, m.table)
|
|
var resp []*FsFont
|
|
err := m.conn.QueryRows(&resp, query)
|
|
switch err {
|
|
case nil:
|
|
return resp, nil
|
|
case sqlc.ErrNotFound:
|
|
return nil, ErrNotFound
|
|
default:
|
|
return nil, err
|
|
}
|
|
}
|