file_upload_record.go 1.2 KB

1234567891011121314151617181920212223242526272829
  1. package aimod
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type FileUploadRecord struct {
  7. FileUploadRecordId int `orm:"column(file_upload_record_id);pk"`
  8. AdminId int `description:"用户id"`
  9. FileUrl string `description:"文件地址"`
  10. FileName string `description:"文件名称"`
  11. OpenaiFileId string `description:"openai返回的文件id"`
  12. OpenaiFileName string `description:"openai返回的文件名称"`
  13. OpenaiObject string `description:"openai返回的文件对象"`
  14. OpenaiStatus string `description:"openai返回的文件状态"`
  15. OpenaiPurpose string `description:"openai返回的提示词"`
  16. OpenaiStatusDetails string `description:"openai返回的文件状态详情"`
  17. OpenaiCreatedAt int64 `description:"openai返回的创建时间"`
  18. CreateTime time.Time `description:"创建时间"`
  19. ModifyTime time.Time `description:"修改时间"`
  20. }
  21. // AddAiChatTopic 新增上传文件记录
  22. func (obj *FileUploadRecord) AddFileUploadRecord() (lastId int64, err error) {
  23. o := orm.NewOrmUsingDB("ai")
  24. lastId, err = o.Insert(obj)
  25. return
  26. }