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 ...@@ -15,3 +15,4 @@ Homestead.json
.DS_Store? .DS_Store?
.DS_Store .DS_Store
/configs /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
import "fmt" import "fmt"
......
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" 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" 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"] 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 @@ ...@@ -9,3 +9,4 @@
queryTimeout = "200ms" queryTimeout = "200ms"
execTimeout = "300ms" execTimeout = "300ms"
tranTimeout = "400ms" tranTimeout = "400ms"
...@@ -39,7 +39,7 @@ func checkErr(err error) { ...@@ -39,7 +39,7 @@ func checkErr(err error) {
func New() (Dao) { func New() (Dao) {
var ( var (
dc struct { dc struct {
Demo *sql.Config Liexin_credit *sql.Config
} }
rc struct { rc struct {
Demo *redis.Config Demo *redis.Config
...@@ -55,7 +55,7 @@ func New() (Dao) { ...@@ -55,7 +55,7 @@ func New() (Dao) {
checkErr(paladin.Get("memcache.toml").UnmarshalTOML(&mc)) checkErr(paladin.Get("memcache.toml").UnmarshalTOML(&mc))
return &dao{ return &dao{
// mysql // mysql
db: sql.NewMySQL(dc.Demo), db: sql.NewMySQL(dc.Liexin_credit),
// redis // redis
redis: redis.NewPool(rc.Demo), redis: redis.NewPool(rc.Demo),
redisExpire: int32(time.Duration(rc.DemoExpire) / time.Second), 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