From b672014e483f10871ea137a5bc9a7091fddf2231 Mon Sep 17 00:00:00 2001 From: odboy Date: Fri, 8 Nov 2024 22:01:15 +0800 Subject: [PATCH] release: version 1.0.0 --- dao.go | 20 -------------------- database.go | 26 -------------------------- restful.go | 19 ------------------- 3 files changed, 65 deletions(-) delete mode 100644 dao.go delete mode 100644 database.go delete mode 100644 restful.go diff --git a/dao.go b/dao.go deleted file mode 100644 index 19a5c7d..0000000 --- a/dao.go +++ /dev/null @@ -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 -} diff --git a/database.go b/database.go deleted file mode 100644 index a964fd3..0000000 --- a/database.go +++ /dev/null @@ -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("数据库连接成功") -} diff --git a/restful.go b/restful.go deleted file mode 100644 index b01aaff..0000000 --- a/restful.go +++ /dev/null @@ -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", - }) - }) -}