package mainline // import ( // "go_dreamfactory/comm" // "go_dreamfactory/pb" // cfg "go_dreamfactory/sys/configure/structs" // ) // // 参数校验 // func (this *apiComp) ShopCheck(session comm.IUserSession, req *pb.MainlineShopReq) (errdata *pb.ErrorData) { // return // } // // 查询商店信息 // func (this *apiComp) Shop(session comm.IUserSession, req *pb.MainlineShopReq) (errdata *pb.ErrorData) { // var ( // info *pb.DBMainlineShop // err error // shopinfo []*cfg.GameMainShopItemData // condiIds []int32 // bchange bool // ) // errdata = this.ShopCheck(session, req) // if errdata != nil { // return // 参数校验失败直接返回 // } // info, err = this.module.modelShop.getMainlineShopData(session.GetUserId()) // if err != nil { // errdata = &pb.ErrorData{ // Code: pb.ErrorCode_DBError, // Title: pb.ErrorCode_DBError.ToString(), // Message: err.Error(), // } // return // } // shopinfo = this.module.configure.GetAllShopConf() // for _, v := range shopinfo { // condiIds = append(condiIds, v.Unlock) // } // info.Unlock = make(map[int32]int32) // if data, err := this.module.ModuleBuried.CheckCondition(session, condiIds...); err == nil { // for pos, v := range data { // if int32(v.State) == 1 { // 记录解锁的数据 // key := shopinfo[pos].Key // if _, ok := info.Unlock[key]; !ok { // info.Unlock[key] = 1 // bchange = true // } // } // } // } // if bchange { // this.module.modelShop.updateMainlineShopData(session.GetUserId(), info) // } // session.SendMsg(string(this.module.GetType()), "shop", &pb.MainlineShopResp{ // Info: info, // }) // return // }