fix: capturar subid de LabsMobile como MsgID en logs de SMS
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
8a9235631c
commit
cb9d984ee8
@@ -28,6 +28,14 @@ type WebSmsResponse struct {
|
||||
Code string `json:"code"`
|
||||
Message string `json:"message"`
|
||||
ID string `json:"id"`
|
||||
SubID string `json:"subid"`
|
||||
}
|
||||
|
||||
func (r *WebSmsResponse) MsgID() string {
|
||||
if r.ID != "" {
|
||||
return r.ID
|
||||
}
|
||||
return r.SubID
|
||||
}
|
||||
|
||||
type WebSmsAckPayload struct {
|
||||
|
||||
@@ -92,7 +92,7 @@ func TestWebSms(c *fiber.Ctx) error {
|
||||
Para: b.Para,
|
||||
Mensaje: b.Mensaje,
|
||||
Status: resp.Code,
|
||||
MsgID: resp.ID,
|
||||
MsgID: resp.MsgID(),
|
||||
})
|
||||
|
||||
return c.JSON(fiber.Map{"ok": true, "response": resp})
|
||||
@@ -189,7 +189,7 @@ func ApiSendSms(c *fiber.Ctx) error {
|
||||
Para: b.Numero,
|
||||
Mensaje: b.Mensaje,
|
||||
Status: status,
|
||||
MsgID: func() string { if resp != nil { return resp.ID }; return "" }(),
|
||||
MsgID: func() string { if resp != nil { return resp.MsgID() }; return "" }(),
|
||||
Error: errStr,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user