Modify the code logic and add a mongo svc context
This commit is contained in:
@@ -6,8 +6,21 @@ import (
|
||||
"github.com/zeromicro/go-zero/rest"
|
||||
)
|
||||
|
||||
type MongoConf struct {
|
||||
URI string `json:",default=mongodb://localhost:27017"`
|
||||
Database string `json:",default=juwan_chat"`
|
||||
}
|
||||
|
||||
type RedisConf struct {
|
||||
Addr string `json:",default=localhost:6379"`
|
||||
Password string `json:",optional"`
|
||||
DB int `json:",default=0"`
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
rest.RestConf
|
||||
Hybrid hybrid.HybridConf
|
||||
Stateless stateless.Config
|
||||
Mongo MongoConf
|
||||
Redis RedisConf
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user