Commit 0634e7cb by Joneq

Merge branch 'dev' of http://119.23.72.7/sunlong_v5/kaopu-server into dev

parents 28a46be0 49353a19
......@@ -15,3 +15,4 @@ Homestead.json
.DS_Store?
.DS_Store
/configs
cmd/cmd.exe
package main
import (
"flag"
"context"
"kaopu-server/internal/service"
"github.com/bilibili/kratos/pkg/conf/paladin"
"github.com/bilibili/kratos/pkg/log"
)
func main() {
//获取输入参数
flag.Parse()
if err := paladin.Init(); err != nil {
panic(err)
}
//初始化日志目录
log.Init(&log.Config{Dir: "logs"})
defer log.Close()
log.Info("caipu-server start")
//声明service层
svc := service.New()
ctx := context.Background()
//调用会员服务
svc.GetUserList(ctx)
}
package main
package static
//企业征信
\ No newline at end of file
package main
package static
//历史交易
\ No newline at end of file
package main
package static
//个人征信
\ No newline at end of file
[demo]
[liexin_credit]
addr = "192.168.2.232:3306"
dsn = "liexin_credit:liexin_credit#zsyM@tcp(192.168.2.232:3306)/liexin_credit?timeout=1s&readTimeout=1s&writeTimeout=1s&parseTime=true&loc=Local&charset=utf8mb4,utf8"
readDSN = ["liexin_credit:liexin_credit#zsyM@tcp(192.168.2.232:3306)/liexin_credit?timeout=1s&readTimeout=1s&writeTimeout=1s&parseTime=true&loc=Local&charset=utf8mb4,utf8"]
......@@ -9,3 +9,4 @@
queryTimeout = "200ms"
execTimeout = "300ms"
tranTimeout = "400ms"
......@@ -39,7 +39,7 @@ func checkErr(err error) {
func New() (Dao) {
var (
dc struct {
Demo *sql.Config
Liexin_credit *sql.Config
}
rc struct {
Demo *redis.Config
......@@ -55,7 +55,7 @@ func New() (Dao) {
checkErr(paladin.Get("memcache.toml").UnmarshalTOML(&mc))
return &dao{
// mysql
db: sql.NewMySQL(dc.Demo),
db: sql.NewMySQL(dc.Liexin_credit),
// redis
redis: redis.NewPool(rc.Demo),
redisExpire: int32(time.Duration(rc.DemoExpire) / time.Second),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment