feat: add medias
This commit is contained in:
@@ -19,7 +19,7 @@ func FromContext(ctx context.Context, db *sql.DB) qrm.DB {
|
||||
|
||||
func TruncateAllTables(ctx context.Context, db *sql.DB, tableName ...string) error {
|
||||
for _, name := range tableName {
|
||||
sql := fmt.Sprintf("TRUNCATE TABLE %s CASCADE", name)
|
||||
sql := fmt.Sprintf("TRUNCATE TABLE %s RESTART IDENTITY", name)
|
||||
if _, err := db.ExecContext(ctx, sql); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
7
backend/pkg/db/pagination.go
Normal file
7
backend/pkg/db/pagination.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package db
|
||||
|
||||
type Pagination struct {
|
||||
Offset string `json:"offset"`
|
||||
OffsetID int64 `json:"-"`
|
||||
Action int `json:"action"` // action: 0 :加载更多 1:刷新
|
||||
}
|
||||
Reference in New Issue
Block a user