37 lines
529 B
Go
37 lines
529 B
Go
package service
|
|
|
|
import (
|
|
"blazing/cool"
|
|
"blazing/modules/player/model"
|
|
)
|
|
|
|
type PVPService struct {
|
|
BaseService
|
|
}
|
|
|
|
func NewPVPService(id uint32) *PVPService {
|
|
return &PVPService{
|
|
|
|
BaseService: BaseService{userid: id,
|
|
|
|
Service: &cool.Service{Model: model.NewPVP()},
|
|
},
|
|
}
|
|
|
|
}
|
|
func (s *PVPService) Get(userid uint32) (ret *model.PVP) {
|
|
|
|
//todo待测试
|
|
|
|
m := s.dbm_fix(s.Model)
|
|
|
|
m.Scan(&ret)
|
|
if ret == nil {
|
|
ret = &model.PVP{
|
|
PlayerID: uint32(userid),
|
|
RankInfo: make([]model.PVPRankInfo, 0),
|
|
}
|
|
}
|
|
return
|
|
}
|