上传bug修复代码
This commit is contained in:
parent
10c5a1d705
commit
355df5e380
@ -5,40 +5,29 @@ import (
|
||||
"go_dreamfactory/lego/sys/mgo"
|
||||
"go_dreamfactory/pb"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
"go_dreamfactory/sys/db"
|
||||
"math/rand"
|
||||
"time"
|
||||
)
|
||||
|
||||
//参数校验
|
||||
// 参数校验
|
||||
func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.ArenaInfoReq) (errdata *pb.ErrorData) {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
///获取自己的排行榜信息
|
||||
// /获取自己的排行榜信息
|
||||
func (this *apiComp) Info(session comm.IUserSession, req *pb.ArenaInfoReq) (errdata *pb.ErrorData) {
|
||||
var (
|
||||
global *cfg.GameGlobalData
|
||||
info *pb.DBArenaUser
|
||||
user *pb.DBUser
|
||||
model *db.DBModel
|
||||
err error
|
||||
)
|
||||
|
||||
if errdata = this.InfoCheck(session, req); errdata != nil {
|
||||
return
|
||||
}
|
||||
if model, err = this.module.GetDBNodule(session, comm.TableUser, time.Hour); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DBError,
|
||||
Title: pb.ErrorCode_DBError.ToString(),
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
}
|
||||
user = &pb.DBUser{}
|
||||
if err = model.Get(session.GetUserId(), user); err != nil {
|
||||
user = this.module.ModuleUser.GetUser(session.GetUserId())
|
||||
if user == nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DBError,
|
||||
Title: pb.ErrorCode_DBError.ToString(),
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
//参数校验
|
||||
// 参数校验
|
||||
func (this *apiComp) GetlistCheck(session comm.IUserSession, req *pb.ShopGetListReq) (errdata *pb.ErrorData) {
|
||||
if req.SType == 0 {
|
||||
errdata = &pb.ErrorData{
|
||||
@ -20,7 +20,7 @@ func (this *apiComp) GetlistCheck(session comm.IUserSession, req *pb.ShopGetList
|
||||
return
|
||||
}
|
||||
|
||||
///获取用户商品列表
|
||||
// /获取用户商品列表
|
||||
func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq) (errdata *pb.ErrorData) {
|
||||
var (
|
||||
err error
|
||||
@ -109,7 +109,7 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
|
||||
leftrefnum = shopconf.Rnum
|
||||
}
|
||||
|
||||
tdata = time.Since(time.Unix(sdata.LastRefreshTime, 0))
|
||||
tdata = configure.Now().Sub((time.Unix(sdata.LastRefreshTime, 0)))
|
||||
switch shopconf.Rtype {
|
||||
case 1:
|
||||
ltime = time.Hour * time.Duration(shopconf.Rtime)
|
||||
|
Loading…
Reference in New Issue
Block a user