@ -210,7 +210,6 @@ func (m *MessageApi) SendMessage(c *gin.Context) {
sendMsgReq , err := m . getSendMsgReq ( c , req . SendMsg )
sendMsgReq , err := m . getSendMsgReq ( c , req . SendMsg )
if err != nil {
if err != nil {
// Log and respond with an error if preparation fails.
// Log and respond with an error if preparation fails.
log . ZError ( c , "decodeData failed" , err )
apiresp . GinError ( c , err )
apiresp . GinError ( c , err )
return
return
}
}
@ -226,7 +225,6 @@ func (m *MessageApi) SendMessage(c *gin.Context) {
if err != nil {
if err != nil {
// Set the status to failed and respond with an error if sending fails.
// Set the status to failed and respond with an error if sending fails.
status = constant . MsgSendFailed
status = constant . MsgSendFailed
log . ZError ( c , "send message err" , err )
apiresp . GinError ( c , err )
apiresp . GinError ( c , err )
return
return
}
}
@ -240,7 +238,8 @@ func (m *MessageApi) SendMessage(c *gin.Context) {
} )
} )
if err != nil {
if err != nil {
// Log the error if updating the status fails.
// Log the error if updating the status fails.
log . ZError ( c , "SetSendMsgStatus failed" , err )
apiresp . GinError ( c , err )
return
}
}
// Respond with a success message and the response payload.
// Respond with a success message and the response payload.
@ -299,7 +298,6 @@ func (m *MessageApi) BatchSendMsg(c *gin.Context) {
resp apistruct . BatchSendMsgResp
resp apistruct . BatchSendMsgResp
)
)
if err := c . BindJSON ( & req ) ; err != nil {
if err := c . BindJSON ( & req ) ; err != nil {
log . ZError ( c , "BatchSendMsg BindJSON failed" , err )
apiresp . GinError ( c , errs . ErrArgs . WithDetail ( err . Error ( ) ) . Wrap ( ) )
apiresp . GinError ( c , errs . ErrArgs . WithDetail ( err . Error ( ) ) . Wrap ( ) )
return
return
}
}
@ -317,7 +315,6 @@ func (m *MessageApi) BatchSendMsg(c *gin.Context) {
for {
for {
recvIDsPart , err := m . userRpcClient . GetAllUserIDs ( c , int32 ( pageNumber ) , int32 ( showNumber ) )
recvIDsPart , err := m . userRpcClient . GetAllUserIDs ( c , int32 ( pageNumber ) , int32 ( showNumber ) )
if err != nil {
if err != nil {
log . ZError ( c , "GetAllUserIDs failed" , err )
apiresp . GinError ( c , err )
apiresp . GinError ( c , err )
return
return
}
}
@ -333,7 +330,6 @@ func (m *MessageApi) BatchSendMsg(c *gin.Context) {
log . ZDebug ( c , "BatchSendMsg nums" , "nums " , len ( recvIDs ) )
log . ZDebug ( c , "BatchSendMsg nums" , "nums " , len ( recvIDs ) )
sendMsgReq , err := m . getSendMsgReq ( c , req . SendMsg )
sendMsgReq , err := m . getSendMsgReq ( c , req . SendMsg )
if err != nil {
if err != nil {
log . ZError ( c , "decodeData failed" , err )
apiresp . GinError ( c , err )
apiresp . GinError ( c , err )
return
return
}
}