feat: add authorization for MidJourney function calls

This commit is contained in:
RockYang
2023-08-16 23:16:44 +08:00
parent c8998ba294
commit fab43097dc
12 changed files with 81 additions and 58 deletions

View File

@@ -3,15 +3,16 @@ package model
import "time"
type MidJourneyJob struct {
Id uint `gorm:"primarykey;column:id"`
UserId uint
ChatId string
MessageId string
Hash string
Content string
Prompt string
Image string
CreatedAt time.Time
Id uint `gorm:"primarykey;column:id"`
UserId uint
ChatId string
MessageId string
ReferenceId string
Hash string
Content string
Prompt string
Image string
CreatedAt time.Time
}
func (MidJourneyJob) TableName() string {

View File

@@ -10,6 +10,7 @@ type User struct {
Salt string // 密码盐
Tokens int64 // 剩余tokens
Calls int // 剩余对话次数
ImgCalls int // 剩余绘图次数
ChatConfig string `gorm:"column:chat_config_json"` // 聊天配置 json
ChatRoles string `gorm:"column:chat_roles_json"` // 聊天角色
ExpiredTime int64 // 账户到期时间

View File

@@ -8,9 +8,10 @@ type User struct {
Mobile string `json:"mobile"`
Nickname string `json:"nickname"`
Avatar string `json:"avatar"`
Salt string `json:"salt"` // 密码盐
Tokens int64 `json:"tokens"` // 剩余tokens
Calls int `json:"calls"` // 剩余对话次数
Salt string `json:"salt"` // 密码盐
Tokens int64 `json:"tokens"` // 剩余tokens
Calls int `json:"calls"` // 剩余对话次数
ImgCalls int `json:"img_calls"`
ChatConfig types.ChatConfig `json:"chat_config"` // 聊天配置
ChatRoles []string `json:"chat_roles"` // 聊天角色集合
ExpiredTime int64 `json:"expired_time"` // 账户到期时间