数据 输入输出 处理
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

37 lines
689 B

package dbOperate
import (
"goInOut/models"
"testing"
)
type res struct {
RLLYCJ string `json:"LLYCJ"`
RLLCacheMap string `json:"LLCacheMap"`
}
func TestRedis(t *testing.T) {
addr := "10.8.30.160:30379"
redis := NewRedisHelper("", addr)
key1 := "RLLYCJ"
//v := redis.Get(key1)
//println(v)
key2 := "RLLCacheMap"
res1 := res{}
v2 := redis.MGet(&res1, key1, key2)
println(v2)
}
func TestPg(t *testing.T) {
dbType := "postgres"
connectStr := "host=10.8.30.32 port=5432 user=postgres password=123 dbname=NBJJ1215-T sslmode=disable"
db := NewDBHelper(dbType, connectStr)
sql := "select * from t_agg_way"
var r []models.AggWay
db.Query(&r, sql)
println("===")
}