mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-04-18 03:17:27 +00:00
feat: 保存重定向信息到 task.Properties
This commit is contained in:
@@ -72,7 +72,10 @@ func (t *Task) GetData(v any) error {
|
||||
}
|
||||
|
||||
type Properties struct {
|
||||
Input string `json:"input"`
|
||||
Input string `json:"input"`
|
||||
IsModelMapped bool `json:"is_model_mapped,omitempty"`
|
||||
OriginModelName string `json:"origin_model_name,omitempty"`
|
||||
UpstreamModelName string `json:"upstream_model_name,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Properties) Scan(val interface{}) error {
|
||||
|
||||
@@ -214,6 +214,11 @@ func RelayTaskSubmit(c *gin.Context, info *relaycommon.RelayInfo) (taskErr *dto.
|
||||
task.Quota = quota
|
||||
task.Data = taskData
|
||||
task.Action = info.Action
|
||||
task.Properties = model.Properties{
|
||||
IsModelMapped: info.IsModelMapped,
|
||||
UpstreamModelName: info.UpstreamModelName,
|
||||
OriginModelName: info.OriginModelName,
|
||||
}
|
||||
err = task.Insert()
|
||||
if err != nil {
|
||||
taskErr = service.TaskErrorWrapper(err, "insert_task_failed", http.StatusInternalServerError)
|
||||
|
||||
Reference in New Issue
Block a user