package mw

import (
	"strings"

	"github.com/gin-gonic/gin"

	"applet/app/e"
	"applet/app/md"
)

// 检查设备等, 把头部信息下放到hdl可以获取
func Checker(c *gin.Context) {
	// 校验平台支持
	platform := strings.ToLower(c.GetHeader("Platform"))
	//fmt.Println(platform)
	if _, ok := md.PlatformList[platform]; !ok {
		e.OutErr(c, e.ERR_PLATFORM)
		return
	}
	c.Next()
}
