``refactor(pet): 重构宠物服务结构,将PetService独立封装并继承cool.Service``
This commit is contained in:
@@ -10,11 +10,11 @@ import (
|
||||
type UserService struct {
|
||||
userid uint32
|
||||
//感觉可以给每个server重新继承?
|
||||
talk *cool.Service //挖矿
|
||||
task *cool.Service //任务
|
||||
info *cool.Service //信息
|
||||
pet *cool.Service //精灵
|
||||
item *cool.Service //物品
|
||||
talk *cool.Service //挖矿
|
||||
task *cool.Service //任务
|
||||
info *cool.Service //信息
|
||||
pet *PetService //精灵
|
||||
item *cool.Service //物品
|
||||
}
|
||||
|
||||
func NewUserService(id uint32) *UserService {
|
||||
@@ -29,7 +29,7 @@ func NewUserService(id uint32) *UserService {
|
||||
"player_id": "角色名称不能重复",
|
||||
},
|
||||
},
|
||||
pet: &cool.Service{Model: model.NewPet()},
|
||||
pet: NewPetService(),
|
||||
item: &cool.Service{Model: model.NewPlayerBag(),
|
||||
UniqueKey: map[string]string{
|
||||
"player_id": "角色名称不能重复",
|
||||
|
||||
Reference in New Issue
Block a user