This commit is contained in:
liang
2021-10-17 20:04:40 +08:00
parent 63e5bd8930
commit 7dfb9d8797
212 changed files with 59018 additions and 1 deletions
+44
View File
@@ -0,0 +1,44 @@
package test
import (
"fmt"
"gfast/app/system/dao"
_ "gfast/boot"
"gfast/library"
"github.com/gogf/gf/os/glog"
"testing"
)
func TestDemo(t *testing.T) {
//t.Run("testEncryptPassword", testEncryptPassword)
//t.Run("testIpToAddr", testIpToAddr)
//t.Run("testDb", testDb)
t.Run("test2", test2)
}
//测试加密函数
func testEncryptPassword(t *testing.T) {
fmt.Println(library.EncryptPassword("yxh402063397", "OoFtPv"))
}
func testIpToAddr(t *testing.T) {
fmt.Println(library.GetCityByIp("223.210.17.184"))
}
func testDb(t *testing.T) {
d := dao.SysUser.Fields("id,user_name,user_nickname")
d = d.Where("user_name", "admin")
d = d.Or("user_name", "zs")
data, _ := d.All()
glog.Debug(data)
}
func test2(t *testing.T) {
}
func TestHe(t *testing.T) {
a := 1 | 8
fmt.Println(a)
}