kdf;dfldfl

This commit is contained in:
cangui 2025-05-09 16:20:29 +02:00
parent 6c4a1aa2b2
commit 0a3c0d219b
2 changed files with 5 additions and 4 deletions

View File

@ -333,7 +333,7 @@ func WebhookReceiveHandler(db *gorm.DB) http.HandlerFunc {
messages := value["messages"].([]interface{}) messages := value["messages"].([]interface{})
if len(messages) > 0 { if len(messages) > 0 {
msg := messages[0].(map[string]interface{}) msg := messages[0].(map[string]interface{})
from := msg["from"].(string) //from := msg["from"].(string)
msgType := msg["type"].(string) msgType := msg["type"].(string)
msgID := msg["id"].(string) msgID := msg["id"].(string)
@ -354,7 +354,7 @@ func WebhookReceiveHandler(db *gorm.DB) http.HandlerFunc {
conv := models.Conversation{ conv := models.Conversation{
UserID: user.ID, UserID: user.ID,
From: from, From: user.NameClient,
To: recipientID, To: recipientID,
MessageID: msgID, MessageID: msgID,
Type: msgType, Type: msgType,

View File

@ -19,8 +19,9 @@ type User struct {
CreatedAt time.Time CreatedAt time.Time
UpdatedAt time.Time UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"` DeletedAt gorm.DeletedAt `gorm:"index"`
Password string `gorm:"not null"` // hashé avec bcrypt NameClient string `gorm:"not null"`
Password string `gorm:"not null"` // hashé avec bcrypt
Email string `gorm:"uniqueIndex;not null"` Email string `gorm:"uniqueIndex;not null"`
SSOID string `gorm:"uniqueIndex;not null"` SSOID string `gorm:"uniqueIndex;not null"`
Role UserRole `gorm:"type:enum('ADMIN','CLIENT');default:'CLIENT';not null"` Role UserRole `gorm:"type:enum('ADMIN','CLIENT');default:'CLIENT';not null"`