Init: bootstrap go module with basic framework

This commit is contained in:
2025-09-25 08:14:34 +08:00
commit 60f534be1e
47 changed files with 1084 additions and 0 deletions

10
utils/initDB.go Normal file
View File

@@ -0,0 +1,10 @@
package utils
import (
"gitea.konchin.com/service/amane-tanikaze-dcbot/amane/models"
"github.com/uptrace/bun"
)
func InitDB(db *bun.DB) {
db.RegisterModel((*models.AliasToImage)(nil))
}

14
utils/success.go Normal file
View File

@@ -0,0 +1,14 @@
package utils
import (
"io"
"net/http"
)
func Success(w http.ResponseWriter) error {
w.WriteHeader(http.StatusOK)
w.Header().Set("Content-Type", "text/plain")
_, err := io.WriteString(w,
`{"code":200, "message": "success"}`+"\n")
return err
}