Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Rabbbit committed Jan 18, 2021
1 parent 3a7b1ad commit b46c8b2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions cli/actions/model.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

package actions

import (
Expand Down
22 changes: 19 additions & 3 deletions core/db/orderSQL.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,30 @@ package db
import "gorm.io/gorm"

type orderSQL interface {
Order(string) limitSQL
Order(string) interface {
limitSQL
findSQL
}
}
type orderSQLImp struct {
db *gorm.DB
}

func (o *orderSQLImp) Order(orderField string) limitSQL {
return &limitSQLImp{db: o.db}
func (o *orderSQLImp) Order(orderField string) interface{
limitSQL
findSQL
} {
return struct {
limitSQL
findSQL
}{
limitSQL: &limitSQLImp{
db: o.db,
},
findSQL: &findSQLImp{
db: o.db,
},
}
}

var _ orderSQL = &orderSQLImp{}

0 comments on commit b46c8b2

Please sign in to comment.