record ip

This commit is contained in:
2023-07-19 23:59:29 +08:00
parent a9ca26c3ec
commit fe8bf39ee6

View File

@@ -14,6 +14,7 @@ import (
type Record struct {
ID uuid.UUID `gorm:"type:uuid"`
CreatedAt time.Time
IP string
Body string
Response string
}
@@ -23,6 +24,7 @@ func recordUserMessage(c *gin.Context, db *gorm.DB, trackID uuid.UUID, body []by
requestRecord := Record{
Body: bodyStr,
ID: trackID,
IP: c.ClientIP(),
}
err := db.Create(&requestRecord).Error
if err != nil {