package main

import (
	"net/http"
	"server/console"
	"server/hall/shop"
	"server/msg"

	"github.com/gin-gonic/gin"
)

func MakeShop() []*msg.ShopItem {
	var err error = nil
	var list []*msg.ShopItem = nil
	list, err = shop.GetShopList(1)
	if err != nil {
		console.Log("MakeShop error!", err)
	}
	return list
}

func ReqShop(c *gin.Context) {
	req := c.MustGet("protobuf_data").(*msg.ReqShop)
	if req.ShopType == 1 {
		c.ProtoBuf(http.StatusOK, &msg.ResShop{
			Success: true,
			List:    MakeShop(),
		})
	}
}
