上传背包系统代码
This commit is contained in:
parent
1cdf4b29df
commit
3e39b41446
2
go.mod
2
go.mod
@ -8,6 +8,7 @@ require (
|
|||||||
github.com/json-iterator/go v1.1.12
|
github.com/json-iterator/go v1.1.12
|
||||||
github.com/liwei1dao/lego v0.0.0-20220531091126-a21bb3766fbc
|
github.com/liwei1dao/lego v0.0.0-20220531091126-a21bb3766fbc
|
||||||
github.com/spf13/cobra v1.2.1
|
github.com/spf13/cobra v1.2.1
|
||||||
|
github.com/spf13/pflag v1.0.5
|
||||||
github.com/stretchr/testify v1.7.1
|
github.com/stretchr/testify v1.7.1
|
||||||
go.mongodb.org/mongo-driver v1.5.1
|
go.mongodb.org/mongo-driver v1.5.1
|
||||||
google.golang.org/protobuf v1.28.0
|
google.golang.org/protobuf v1.28.0
|
||||||
@ -95,7 +96,6 @@ require (
|
|||||||
github.com/smallnest/quick v0.0.0-20220103065406-780def6371e6 // indirect
|
github.com/smallnest/quick v0.0.0-20220103065406-780def6371e6 // indirect
|
||||||
github.com/smallnest/rpcx v1.7.4 // indirect
|
github.com/smallnest/rpcx v1.7.4 // indirect
|
||||||
github.com/soheilhy/cmux v0.1.5 // indirect
|
github.com/soheilhy/cmux v0.1.5 // indirect
|
||||||
github.com/spf13/pflag v1.0.5 // indirect
|
|
||||||
github.com/templexxx/cpufeat v0.0.0-20180724012125-cef66df7f161 // indirect
|
github.com/templexxx/cpufeat v0.0.0-20180724012125-cef66df7f161 // indirect
|
||||||
github.com/templexxx/xor v0.0.0-20191217153810-f85b25db303b // indirect
|
github.com/templexxx/xor v0.0.0-20191217153810-f85b25db303b // indirect
|
||||||
github.com/tinylib/msgp v1.1.6 // indirect
|
github.com/tinylib/msgp v1.1.6 // indirect
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package login
|
package pack
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
@ -7,6 +7,7 @@ import (
|
|||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
"go_dreamfactory/sys/cache"
|
"go_dreamfactory/sys/cache"
|
||||||
|
|
||||||
|
"github.com/liwei1dao/lego/core"
|
||||||
"github.com/liwei1dao/lego/sys/log"
|
"github.com/liwei1dao/lego/sys/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -17,6 +18,13 @@ const (
|
|||||||
|
|
||||||
type Api_Comp struct {
|
type Api_Comp struct {
|
||||||
modules.MComp_GateComp
|
modules.MComp_GateComp
|
||||||
|
module *Pack
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Api_Comp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||||
|
this.MComp_GateComp.Init(service, module, comp, options)
|
||||||
|
this.module = module.(*Pack)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
///查询用户背包数据
|
///查询用户背包数据
|
||||||
|
16
modules/pack/configure_comp.go
Normal file
16
modules/pack/configure_comp.go
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
package pack
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/liwei1dao/lego/core"
|
||||||
|
"github.com/liwei1dao/lego/core/cbase"
|
||||||
|
)
|
||||||
|
|
||||||
|
///背包配置管理组件
|
||||||
|
type Configure_Comp struct {
|
||||||
|
cbase.ModuleCompBase
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Configure_Comp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||||
|
this.ModuleCompBase.Init(service, module, comp, options)
|
||||||
|
return
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package login
|
package pack
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
@ -19,6 +19,8 @@ func NewModule() core.IModule {
|
|||||||
|
|
||||||
type Pack struct {
|
type Pack struct {
|
||||||
modules.ModuleBase
|
modules.ModuleBase
|
||||||
|
api_comp *Api_Comp
|
||||||
|
configure_comp *Configure_Comp
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Pack) GetType() core.M_Modules {
|
func (this *Pack) GetType() core.M_Modules {
|
||||||
@ -27,4 +29,6 @@ func (this *Pack) GetType() core.M_Modules {
|
|||||||
|
|
||||||
func (this *Pack) OnInstallComp() {
|
func (this *Pack) OnInstallComp() {
|
||||||
this.ModuleBase.OnInstallComp()
|
this.ModuleBase.OnInstallComp()
|
||||||
|
this.api_comp = this.RegisterComp(new(Api_Comp)).(*Api_Comp)
|
||||||
|
this.configure_comp = this.RegisterComp(new(Configure_Comp)).(*Configure_Comp)
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ func (this *Api_Comp) Register(c *engine.Context) {
|
|||||||
rsp := &pb.UserRegisterRsp{}
|
rsp := &pb.UserRegisterRsp{}
|
||||||
err := c.BindJSON(&req)
|
err := c.BindJSON(&req)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
err := db.Defsys.CreateUser(&pb.DB_UserData{
|
err := db.Defsys.User_CreateUser(&pb.DB_UserData{
|
||||||
Account: req.Account,
|
Account: req.Account,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -4,6 +4,7 @@ import (
|
|||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"go_dreamfactory/modules/login"
|
"go_dreamfactory/modules/login"
|
||||||
|
"go_dreamfactory/modules/pack"
|
||||||
"go_dreamfactory/services"
|
"go_dreamfactory/services"
|
||||||
"go_dreamfactory/sys/cache"
|
"go_dreamfactory/sys/cache"
|
||||||
"go_dreamfactory/sys/db"
|
"go_dreamfactory/sys/db"
|
||||||
@ -30,6 +31,7 @@ func main() {
|
|||||||
lego.Run(s, //运行模块
|
lego.Run(s, //运行模块
|
||||||
// web.NewModule(),
|
// web.NewModule(),
|
||||||
login.NewModule(),
|
login.NewModule(),
|
||||||
|
pack.NewModule(),
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user