mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
log
This commit is contained in:
parent
3373925acf
commit
658d97ff4e
@ -6,11 +6,13 @@ import (
|
||||
"Open_IM/pkg/common/db"
|
||||
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/common/utils"
|
||||
"fmt"
|
||||
"github.com/gin-gonic/gin"
|
||||
"gopkg.in/gomail.v2"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -41,11 +43,17 @@ type paramsVerificationCode struct {
|
||||
|
||||
func SendVerificationCode(c *gin.Context) {
|
||||
params := paramsVerificationCode{}
|
||||
|
||||
if err := c.BindJSON(¶ms); err != nil {
|
||||
log.NewError("", "BindJSON failed", "err:", err.Error(), "phoneNumber", params.PhoneNumber, "email", params.Email)
|
||||
c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()})
|
||||
return
|
||||
}
|
||||
operationID := params.OperationID
|
||||
if operationID == "" {
|
||||
operationID = utils.OperationIDGenerator()
|
||||
}
|
||||
log.Info(operationID, "SendVerificationCode args: ", params)
|
||||
var account string
|
||||
if params.Email != "" {
|
||||
account = params.Email
|
||||
|
@ -5,8 +5,7 @@ import (
|
||||
"Open_IM/pkg/common/constant"
|
||||
"Open_IM/pkg/common/db"
|
||||
"Open_IM/pkg/common/log"
|
||||
"Open_IM/pkg/utils"
|
||||
|
||||
"Open_IM/pkg/common/utils"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
)
|
||||
@ -23,14 +22,15 @@ type paramsCertification struct {
|
||||
func Verify(c *gin.Context) {
|
||||
params := paramsCertification{}
|
||||
operationID := params.OperationID
|
||||
if operationID == "" {
|
||||
operationID = utils.OperationIDGenerator()
|
||||
}
|
||||
|
||||
if err := c.BindJSON(¶ms); err != nil {
|
||||
log.NewError(operationID, "request params json parsing failed", "", "err", err.Error())
|
||||
c.JSON(http.StatusBadRequest, gin.H{"errCode": constant.FormattingError, "errMsg": err.Error()})
|
||||
return
|
||||
}
|
||||
if operationID == "" {
|
||||
operationID = utils.OperationIDGenerator()
|
||||
}
|
||||
log.NewInfo(operationID, "recv req: ", params)
|
||||
|
||||
var account string
|
||||
|
Loading…
x
Reference in New Issue
Block a user