mirror of
https://github.com/makayabou/asg-server.git
synced 2026-05-02 17:43:36 +02:00
Merge pull request #22 from capcom6/feature/privacy-hash
Added: `isHashed` field in external API
This commit is contained in:
commit
bb64fa1df8
@ -28,7 +28,7 @@ Authorization: Basic {{credentials}}
|
||||
}
|
||||
|
||||
###
|
||||
GET {{baseUrl}}/api/3rdparty/v1/message/IyJP8Iexf55XFhYFHMjcs HTTP/1.1
|
||||
GET {{baseUrl}}/api/3rdparty/v1/message/-rnEaUz7KObDdokPrzKpM HTTP/1.1
|
||||
Authorization: Basic {{credentials}}
|
||||
|
||||
###
|
||||
|
||||
@ -242,6 +242,7 @@ func modelToMessageState(input models.Message) smsgateway.MessageState {
|
||||
return smsgateway.MessageState{
|
||||
ID: input.ExtID,
|
||||
State: smsgateway.ProcessState(input.State),
|
||||
IsHashed: input.IsHashed,
|
||||
Recipients: slices.Map(input.Recipients, modelToRecipientState),
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,12 +24,13 @@ type Message struct {
|
||||
type MessageState struct {
|
||||
ID string `json:"id,omitempty" validate:"omitempty,max=36" example:"PyDmBQZZXYmyxMwED8Fzy"` // Идентификатор
|
||||
State ProcessState `json:"state" validate:"required" example:"Pending"` // Состояние
|
||||
IsHashed bool `json:"isHashed" validate:"required" example:"false"` // Хэшировано
|
||||
Recipients []RecipientState `json:"recipients" validate:"required,min=1,dive"` // Детализация состояния по получателям
|
||||
}
|
||||
|
||||
// Детализация состояния
|
||||
type RecipientState struct {
|
||||
PhoneNumber string `json:"phoneNumber" validate:"required,min=10" example:"79990001234"` // Номер телефона
|
||||
PhoneNumber string `json:"phoneNumber" validate:"required,min=10" example:"79990001234"` // Номер телефона или первые 16 символов SHA256
|
||||
State ProcessState `json:"state" validate:"required" example:"Pending"` // Состояние
|
||||
Error *string `json:"error,omitempty" example:"timeout"` // Ошибка
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user