36 lines
984 B
Go
36 lines
984 B
Go
package integral
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/lego/sys/mgo"
|
|
"go_dreamfactory/pb"
|
|
|
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
|
)
|
|
|
|
//参数校验
|
|
func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.IntegralGetListReq) (errdata *pb.ErrorData) {
|
|
|
|
return
|
|
}
|
|
|
|
func (this *apiComp) GetList(session comm.IUserSession, req *pb.IntegralGetListReq) (errdata *pb.ErrorData) {
|
|
|
|
list, err := this.module.modelIntegral.getIntegralList(session.GetUserId())
|
|
if mgo.MongodbNil == err {
|
|
|
|
list.Id = primitive.NewObjectID().Hex()
|
|
list.Uid = session.GetUserId()
|
|
|
|
this.module.modelIntegral.Add(session.GetUserId(), list)
|
|
}
|
|
// if session.GetUserId() != "" { // 恢复时间
|
|
// if userexpand, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil {
|
|
// list.RecoveryTime = userexpand.Recovertimeunifiedticket
|
|
// }
|
|
// }
|
|
|
|
session.SendMsg(string(this.module.GetType()), "getlist", &pb.IntegralGetListResp{Data: list})
|
|
return
|
|
}
|