1
This commit is contained in:
parent
69907abec1
commit
247aa4bde5
@ -22,6 +22,9 @@ func (this *ShopApi) Goods(c *gin.Context) {
|
|||||||
Data []*vo.Goods `json:"goods"`
|
Data []*vo.Goods `json:"goods"`
|
||||||
}{}
|
}{}
|
||||||
mt.Table.Item.Traverse(func (itemMeta *mt.Item) bool {
|
mt.Table.Item.Traverse(func (itemMeta *mt.Item) bool {
|
||||||
|
if itemMeta.GetItemType() != constant.ITEM_TYPE_CHIP {
|
||||||
|
return true
|
||||||
|
}
|
||||||
goodsVo := new(vo.Goods)
|
goodsVo := new(vo.Goods)
|
||||||
goodsVo.ItemId = itemMeta.GetId()
|
goodsVo.ItemId = itemMeta.GetId()
|
||||||
q5.AppendSlice(&rspObj.Data, goodsVo)
|
q5.AppendSlice(&rspObj.Data, goodsVo)
|
||||||
|
@ -29,3 +29,8 @@ const (
|
|||||||
const (
|
const (
|
||||||
VIRTUAL_ITEM_SCORE = 20001
|
VIRTUAL_ITEM_SCORE = 20001
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
ITEM_TYPE_CHIP = 1
|
||||||
|
ITEM_TYPE_SCORE = 2
|
||||||
|
)
|
||||||
|
@ -34,8 +34,9 @@ type Item struct {
|
|||||||
id int32
|
id int32
|
||||||
level int32
|
level int32
|
||||||
price_type int32
|
price_type int32
|
||||||
type_ int32
|
item_type int32
|
||||||
time int32
|
time int32
|
||||||
|
produce_type int32
|
||||||
produce int32
|
produce int32
|
||||||
accelerate_type int32
|
accelerate_type int32
|
||||||
accelerate_price int32
|
accelerate_price int32
|
||||||
@ -179,11 +180,11 @@ func (this *Item) HasPriceType() bool {
|
|||||||
return (this._flags1_ & (uint64(1) << 3)) > 0
|
return (this._flags1_ & (uint64(1) << 3)) > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Item) GetType() int32 {
|
func (this *Item) GetItemType() int32 {
|
||||||
return this.type_
|
return this.item_type
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Item) HasType() bool {
|
func (this *Item) HasItemType() bool {
|
||||||
return (this._flags1_ & (uint64(1) << 4)) > 0
|
return (this._flags1_ & (uint64(1) << 4)) > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,6 +196,14 @@ func (this *Item) HasTime() bool {
|
|||||||
return (this._flags1_ & (uint64(1) << 5)) > 0
|
return (this._flags1_ & (uint64(1) << 5)) > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *Item) GetProduceType() int32 {
|
||||||
|
return this.produce_type
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Item) HasProduceType() bool {
|
||||||
|
return (this._flags1_ & (uint64(1) << 9)) > 0
|
||||||
|
}
|
||||||
|
|
||||||
func (this *Item) GetProduce() int32 {
|
func (this *Item) GetProduce() int32 {
|
||||||
return this.produce
|
return this.produce
|
||||||
}
|
}
|
||||||
@ -377,8 +386,9 @@ func (this *Item) LoadFromKv(kv map[string]interface{}) {
|
|||||||
f5.ReadMetaTableField(&this.id, "id", &this._flags1_, 1, kv)
|
f5.ReadMetaTableField(&this.id, "id", &this._flags1_, 1, kv)
|
||||||
f5.ReadMetaTableField(&this.level, "level", &this._flags1_, 2, kv)
|
f5.ReadMetaTableField(&this.level, "level", &this._flags1_, 2, kv)
|
||||||
f5.ReadMetaTableField(&this.price_type, "price_type", &this._flags1_, 3, kv)
|
f5.ReadMetaTableField(&this.price_type, "price_type", &this._flags1_, 3, kv)
|
||||||
f5.ReadMetaTableField(&this.type_, "type", &this._flags1_, 4, kv)
|
f5.ReadMetaTableField(&this.item_type, "item_type", &this._flags1_, 4, kv)
|
||||||
f5.ReadMetaTableField(&this.time, "time", &this._flags1_, 5, kv)
|
f5.ReadMetaTableField(&this.time, "time", &this._flags1_, 5, kv)
|
||||||
|
f5.ReadMetaTableField(&this.produce_type, "produce_type", &this._flags1_, 9, kv)
|
||||||
f5.ReadMetaTableField(&this.produce, "produce", &this._flags1_, 6, kv)
|
f5.ReadMetaTableField(&this.produce, "produce", &this._flags1_, 6, kv)
|
||||||
f5.ReadMetaTableField(&this.accelerate_type, "accelerate_type", &this._flags1_, 7, kv)
|
f5.ReadMetaTableField(&this.accelerate_type, "accelerate_type", &this._flags1_, 7, kv)
|
||||||
f5.ReadMetaTableField(&this.accelerate_price, "accelerate_price", &this._flags1_, 8, kv)
|
f5.ReadMetaTableField(&this.accelerate_price, "accelerate_price", &this._flags1_, 8, kv)
|
||||||
|
@ -27,8 +27,9 @@ message Item
|
|||||||
optional int32 id = 1;
|
optional int32 id = 1;
|
||||||
optional int32 level = 2;
|
optional int32 level = 2;
|
||||||
optional int32 price_type = 3;
|
optional int32 price_type = 3;
|
||||||
optional int32 type = 4;
|
optional int32 item_type = 4;
|
||||||
optional int32 time = 5;
|
optional int32 time = 5;
|
||||||
|
optional int32 produce_type = 9;
|
||||||
optional int32 produce = 6;
|
optional int32 produce = 6;
|
||||||
optional int32 accelerate_type = 7;
|
optional int32 accelerate_type = 7;
|
||||||
optional int32 accelerate_price = 8;
|
optional int32 accelerate_price = 8;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user