feat: associate generation calls with devices
This commit is contained in:
@@ -35,6 +35,14 @@ class CallRecord(models.Model):
|
||||
on_delete=models.SET_NULL,
|
||||
related_name="call_records",
|
||||
)
|
||||
client_device = models.ForeignKey(
|
||||
"licensing.ClientDevice",
|
||||
verbose_name="客户端设备",
|
||||
null=True,
|
||||
blank=True,
|
||||
on_delete=models.SET_NULL,
|
||||
related_name="call_records",
|
||||
)
|
||||
operation_type = models.CharField("操作类型", max_length=32, choices=OperationType.choices)
|
||||
alias = models.CharField("能力别名", max_length=64, blank=True)
|
||||
model_used = models.CharField("实际模型", max_length=128, blank=True)
|
||||
@@ -68,6 +76,7 @@ class CallRecord(models.Model):
|
||||
indexes = [
|
||||
models.Index(fields=("user", "created_at")),
|
||||
models.Index(fields=("api_key", "created_at")),
|
||||
models.Index(fields=("client_device", "created_at")),
|
||||
models.Index(fields=("operation_type", "status")),
|
||||
models.Index(fields=("alias",)),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user