package troll import ( "go_dreamfactory/comm" "go_dreamfactory/pb" ) func (this *apiComp) AfkSetCheck(session comm.IUserSession, req *pb.TrollAfkSetReq) (code pb.ErrorCode) { return } // 设置挂机规则 func (this *apiComp) AfkSet(session comm.IUserSession, req *pb.TrollAfkSetReq) (code pb.ErrorCode, data *pb.ErrorData) { var ( update map[string]interface{} ) update = make(map[string]interface{}) code = this.AfkSetCheck(session, req) troll, err := this.module.modelTroll.getTrollList(session.GetUserId()) if err != nil { code = pb.ErrorCode_DBError return } troll.Buy = req.Buy //this.configure.GetTrollRule(comm.TrollBuy) troll.Sell = req.Sell //this.configure.GetTrollRule(comm.TrollSell) //troll.AiCount = req.Count update["buy"] = troll.Buy update["sell"] = troll.Sell //update["aiCount"] = troll.AiCount this.module.ModifyTrollData(session.GetUserId(), update) session.SendMsg(string(this.module.GetType()), TrollAfkSetResp, &pb.TrollAfkSetResp{Data: troll}) return }