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