release: version 1.0.0

This commit is contained in:
骑着蜗牛追导弹 2024-11-08 22:01:15 +08:00
parent 462e354964
commit b672014e48
3 changed files with 0 additions and 65 deletions

20
dao.go
View File

@ -1,20 +0,0 @@
package main
import "fmt"
type ResolveRecord struct {
Id int32 `xorm:"pk not null integer 'id' autoincr"`
Name string `xorm:"not null text 'name'"`
RecordType string `xorm:"not null text 'record_type'"`
Ttl int32 `xorm:"not null integer 'ttl'"`
Value string `xorm:"not null text 'value'"`
}
func selectResolveRecords() []*ResolveRecord {
records := make([]*ResolveRecord, 0)
err := Engine.Table("resolve_record").Find(&records)
if err != nil {
fmt.Println(err)
}
return records
}

View File

@ -1,26 +0,0 @@
package main
import (
"fmt"
"github.com/go-xorm/xorm"
_ "github.com/mattn/go-sqlite3"
)
var (
Engine *xorm.Engine
)
func init() {
var err error
Engine, err = xorm.NewEngine("sqlite3", "dns.sqlite3")
if err != nil {
fmt.Println(err)
}
fmt.Println("数据库引擎创建成功")
err = Engine.Ping()
if err != nil {
fmt.Println(err)
}
fmt.Println("数据库连接成功")
}

View File

@ -1,19 +0,0 @@
package main
import (
"github.com/gin-gonic/gin"
)
func initRestFunc(r *gin.Engine) {
//records := selectResolveRecords()
//jsonData, err := json.Marshal(records)
//if err != nil {
// log.Fatal(err)
//}
//fmt.Println(string(jsonData))
r.GET("/ping", func(c *gin.Context) {
c.JSON(200, gin.H{
"message": "pong",
})
})
}