Feat: add query params
This commit is contained in:
14
utils/initDB.go
Normal file
14
utils/initDB.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/uptrace/bun"
|
||||
)
|
||||
|
||||
func InitDB(db *bun.DB) {
|
||||
err := db.ResetModel(context.Background())
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
13
utils/success.go
Normal file
13
utils/success.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"inp2025/tcp"
|
||||
"io"
|
||||
)
|
||||
|
||||
func Success(w tcp.ResponseWriter) error {
|
||||
w.WriteHeader(tcp.StatusOK)
|
||||
_, err := io.WriteString(w,
|
||||
`{"code":200, "message": "success"}`+"\n")
|
||||
return err
|
||||
}
|
||||
Reference in New Issue
Block a user