package api

import (
	"gadmin/internal/admin/forms"
	"gadmin/internal/admin/service"
	"github.com/gin-gonic/gin"
	"github.com/sirupsen/logrus"
)

// PeripheralsReceiveCdk 领取兑换码
func PeripheralsReceiveCdk(c *gin.Context) {
	var req forms.PeripheralsReceiveCdk
	if err := c.ShouldBind(&req); err != nil {
		c.JSON(200, ErrorResponse(err))
		return
	}
	logrus.Warnf("PeripheralsReceiveCdk req:%+v", req)
	
	if err := forms.ParseParams(&req); err != nil {
		c.JSON(200, ErrorResponse(err))
		return
	}

	c.JSON(200, service.Peripherals.ReceiveCdk(c, req))
}
