feat: added modules

This commit is contained in:
Marvin Zhang
2024-06-14 15:59:48 +08:00
parent 0b67fd9ece
commit dc21bce11f
138 changed files with 3231 additions and 120 deletions

8
db/generic/base.go Normal file
View File

@@ -0,0 +1,8 @@
package generic
const (
DataSourceTypeMongo = "mongo"
DataSourceTypeMysql = "mysql"
DataSourceTypePostgres = "postgres"
DataSourceTypeElasticSearch = "postgres"
)

15
db/generic/list.go Normal file
View File

@@ -0,0 +1,15 @@
package generic
type ListQueryCondition struct {
Key string
Op string
Value interface{}
}
type ListQuery []ListQueryCondition
type ListOptions struct {
Skip int
Limit int
Sort []ListSort
}

7
db/generic/op.go Normal file
View File

@@ -0,0 +1,7 @@
package generic
type Op string
const (
OpEqual = "eq"
)

13
db/generic/sort.go Normal file
View File

@@ -0,0 +1,13 @@
package generic
type SortDirection string
const (
SortDirectionAsc SortDirection = "asc"
SortDirectionDesc SortDirection = "desc"
)
type ListSort struct {
Key string
Direction SortDirection
}