Refine the rest structure.
This commit is contained in:
1 parent
c55e8699b4
commit
e88930e13a
49 files changed
+201
-183
No files matched your search
@@ -0,0 +1,30 @@
|
||||
package builder
|
||||
|
||||
type OrderPair struct {
|
||||
Key string
|
||||
Value string
|
||||
}
|
||||
|
||||
type WherePair struct {
|
||||
Query string
|
||||
Args []interface{}
|
||||
}
|
||||
|
||||
func (this *WherePair) And(where *WherePair) *WherePair {
|
||||
if this.Query == "" {
|
||||
return where
|
||||
} else {
|
||||
return &WherePair{Query: this.Query + " AND " + where.Query, Args: append(this.Args, where.Args...)}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (this *WherePair) Or(where *WherePair) *WherePair {
|
||||
if this.Query == "" {
|
||||
return where
|
||||
} else {
|
||||
return &WherePair{Query: this.Query + " OR " + where.Query, Args: append(this.Args, where.Args...)}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user