增加cmd命令
This commit is contained in:
40
cmd/make/act
Normal file
40
cmd/make/act
Normal file
@@ -0,0 +1,40 @@
|
||||
package act{id}
|
||||
|
||||
import (
|
||||
v1 "game_server/api/act/v1"
|
||||
"game_server/internal/service"
|
||||
"github.com/gogf/gf/v2/os/gctx"
|
||||
)
|
||||
|
||||
type sAct{id} struct {
|
||||
}
|
||||
|
||||
func New() *sAct{id} {
|
||||
return &sAct{id}{}
|
||||
}
|
||||
|
||||
var (
|
||||
ActId = {id}
|
||||
ctx = gctx.New()
|
||||
)
|
||||
|
||||
type Data struct {
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
}
|
||||
|
||||
func (s *sAct{id}) GetData(uid int64) (data *Data) {
|
||||
get, _ := service.GameAct().Info(uid, ActId)
|
||||
get.Scan(&data)
|
||||
if get.IsEmpty() || data == nil {
|
||||
data = &Data{
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (s *sAct{id}) SetData(uid int64, data interface{}) {
|
||||
service.GameAct().Set(uid, ActId, data)
|
||||
}
|
||||
25
cmd/make/logic
Normal file
25
cmd/make/logic
Normal file
@@ -0,0 +1,25 @@
|
||||
package {package}
|
||||
|
||||
import (
|
||||
"game_server/internal/service"
|
||||
"github.com/gogf/gf/v2/os/gctx"
|
||||
)
|
||||
|
||||
type s{name} struct {
|
||||
}
|
||||
|
||||
var (
|
||||
ctx = gctx.New()
|
||||
)
|
||||
|
||||
func New() *s{name} {
|
||||
return &s{name}{}
|
||||
}
|
||||
|
||||
func init() {
|
||||
service.Register{name}(New())
|
||||
}
|
||||
|
||||
func (s *s{name}) Info() {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user