重构
This commit is contained in:
@@ -17,7 +17,7 @@ func (h Controller) UserItemList(data *item.ItemListInboundInfo, c *player.Playe
|
||||
result = &item.ItemListOutboundInfo{}
|
||||
result.ItemList = make([]model.SingleItemInfo, 0)
|
||||
|
||||
item := c.Service.Item(data.Param1, data.Param2)
|
||||
item := c.Service.Item.Get(data.Param1, data.Param2)
|
||||
for _, v := range item {
|
||||
var vv model.SingleItemInfo
|
||||
vv.ItemId = v.ItemId
|
||||
@@ -87,7 +87,7 @@ func (h Controller) ChangePlayerCloth(data *item.ChangePlayerClothInboundInfo, c
|
||||
}
|
||||
func (h Controller) Talk(data *item.TalkCountInboundInfo, c *player.Player) (result *item.TalkCountOutboundInfo, err errorcode.ErrorCode) {
|
||||
result = &item.TalkCountOutboundInfo{}
|
||||
c.Service.Talk(func(t map[uint32]uint32) bool {
|
||||
c.Service.Talk.Exec(func(t map[uint32]uint32) bool {
|
||||
|
||||
tt, ok := t[data.ID]
|
||||
if ok {
|
||||
@@ -122,7 +122,7 @@ func (h Controller) TalkCate(data *item.TalkCateInboundInfo, c *player.Player) (
|
||||
|
||||
// 2. 生成 1-10 的随机数:rand.Intn(10) → 0-9,+1 后范围变为 1-10
|
||||
randomNum := rand.Intn(10) + 1
|
||||
c.Service.Talk(func(t map[uint32]uint32) bool {
|
||||
c.Service.Talk.Exec(func(t map[uint32]uint32) bool {
|
||||
if t == nil {
|
||||
t = make(map[uint32]uint32)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user