Modify the code logic and add a mongo svc context

This commit is contained in:
wwweww
2026-04-25 08:29:25 +08:00
parent 5a99baafd0
commit 2ec2075c16
6 changed files with 103 additions and 265 deletions
+13
View File
@@ -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
}