Update redemption.go

This commit is contained in:
analogpvt 2023-05-19 22:56:33 +05:30 committed by GitHub
parent 569f9721f5
commit ab94a57fa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,21 +85,21 @@ func AddRedemption(c *gin.Context) {
if len(redemption.Name) == 0 || len(redemption.Name) > 20 { if len(redemption.Name) == 0 || len(redemption.Name) > 20 {
c.JSON(http.StatusOK, gin.H{ c.JSON(http.StatusOK, gin.H{
"success": false, "success": false,
"message": "兑换码名称长度必须在1-20之间", "message": "Redemption code name length must be between 1-20",
}) })
return return
} }
if redemption.Count <= 0 { if redemption.Count <= 0 {
c.JSON(http.StatusOK, gin.H{ c.JSON(http.StatusOK, gin.H{
"success": false, "success": false,
"message": "兑换码个数必须大于0", "message": "The number of redemption codes must be greater than 0",
}) })
return return
} }
if redemption.Count > 100 { if redemption.Count > 100 {
c.JSON(http.StatusOK, gin.H{ c.JSON(http.StatusOK, gin.H{
"success": false, "success": false,
"message": "一次兑换码批量生成的个数不能大于 100", "message": "The number of redemption codes generated in batches cannot be greater than 100",
}) })
return return
} }