|
|
@ -34,7 +34,7 @@ func QueryIP(c *gin.Context) {
|
|
|
|
ips, err := imdb.QueryUserIPLimits(req.IP)
|
|
|
|
ips, err := imdb.QueryUserIPLimits(req.IP)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
log.NewError(req.OperationID, "GetInvitationCode failed", req.IP)
|
|
|
|
log.NewError(req.OperationID, "GetInvitationCode failed", req.IP)
|
|
|
|
c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrDB, "errMsg": "QueryUserIPLimits error!"})
|
|
|
|
c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrDB.ErrCode, "errMsg": "QueryUserIPLimits error!"})
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
resp.IP = req.IP
|
|
|
|
resp.IP = req.IP
|
|
|
@ -85,7 +85,7 @@ func AddIPLimit(c *gin.Context) {
|
|
|
|
LimitTime: time.Time{},
|
|
|
|
LimitTime: time.Time{},
|
|
|
|
}); err != nil {
|
|
|
|
}); err != nil {
|
|
|
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.IP, req.LimitTime)
|
|
|
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.IP, req.LimitTime)
|
|
|
|
c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrDB, "errMsg": "InsertOneIntoIpLimits error!"})
|
|
|
|
c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrDB.ErrCode, "errMsg": "InsertOneIntoIpLimits error!"})
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": ""})
|
|
|
|
c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": ""})
|
|
|
@ -122,7 +122,7 @@ func QueryUserIPLimitLogin(c *gin.Context) {
|
|
|
|
resp, err := imdb.GetIpLimitsLoginByUserID(req.UserID)
|
|
|
|
resp, err := imdb.GetIpLimitsLoginByUserID(req.UserID)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.UserID)
|
|
|
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error(), req.UserID)
|
|
|
|
c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrDB, "errMsg": "GetIpLimitsByUserID error!"})
|
|
|
|
c.JSON(http.StatusInternalServerError, gin.H{"errCode": constant.ErrDB.ErrCode, "errMsg": "GetIpLimitsByUserID error!"})
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp:", resp)
|
|
|
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp:", resp)
|
|
|
|