Files
openai-api-route/record.go

20 lines
300 B
Go

package main
import (
"github.com/gin-gonic/gin"
"gorm.io/gorm"
)
type RequestRecord struct {
gorm.Model
Body string
}
func recordUserMessage(c *gin.Context, db *gorm.DB, body []byte) {
bodyStr := string(body)
requestRecord := RequestRecord{
Body: bodyStr,
}
db.Create(&requestRecord)
}