驯龙接口补充
This commit is contained in:
parent
0d47281050
commit
278f30346a
@ -654,5 +654,9 @@ type (
|
|||||||
CreateDragon(session IUserSession, dragons map[string]int32, bPush bool) (errdata *pb.ErrorData)
|
CreateDragon(session IUserSession, dragons map[string]int32, bPush bool) (errdata *pb.ErrorData)
|
||||||
// 机器人 坐骑
|
// 机器人 坐骑
|
||||||
CreateRobotDragon(dragonid string, lv int32) (dragon *pb.DBDragon, err error)
|
CreateRobotDragon(dragonid string, lv int32) (dragon *pb.DBDragon, err error)
|
||||||
|
// 查询所有成龙
|
||||||
|
QueryBigDragonList(uid string) (dragon []*pb.DBDragon, err error)
|
||||||
|
// 通过ID 查询龙的信息
|
||||||
|
QueryDragonById(uid string, dragonid string) (dragon *pb.DBDragon, err error)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package dragon
|
package dragon
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/lego/core"
|
"go_dreamfactory/lego/core"
|
||||||
"go_dreamfactory/modules"
|
"go_dreamfactory/modules"
|
||||||
@ -89,3 +90,39 @@ func (this *Dragon) CreateRobotDragon(dragonid string, lv int32) (dragon *pb.DBD
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *Dragon) QueryBigDragonList(uid string) (dragon []*pb.DBDragon, err error) {
|
||||||
|
var (
|
||||||
|
list []*pb.DBDragon
|
||||||
|
)
|
||||||
|
|
||||||
|
if list, err = this.modelDragon.GetDragonList(uid); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
for _, v := range list {
|
||||||
|
if c, err := this.configure.GetDragonConfById(v.Dragonid, v.Lv); err == nil {
|
||||||
|
if c.Type == 3 {
|
||||||
|
dragon = append(dragon, v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Dragon) QueryDragonById(uid string, dragonid string) (dragon *pb.DBDragon, err error) {
|
||||||
|
var (
|
||||||
|
list []*pb.DBDragon
|
||||||
|
)
|
||||||
|
|
||||||
|
if list, err = this.modelDragon.GetDragonList(uid); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
for _, v := range list {
|
||||||
|
if v.Dragonid == dragonid {
|
||||||
|
dragon = v
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
err = fmt.Errorf("not found dragon dragonid:%s", dragonid)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user