feat: requirements analysis, submission checks (stability stress test), AI inspection pipeline
This commit is contained in:
+44
-1
@@ -1,3 +1,46 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
|
||||
class Requirement(models.Model):
|
||||
"""作业要求:内容 + AI 分析出的检测维度计划"""
|
||||
|
||||
title = models.CharField("标题", max_length=200)
|
||||
content = models.TextField("作业要求内容")
|
||||
spec = models.JSONField("检测维度计划", default=dict, blank=True)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
class Meta:
|
||||
ordering = ["-created_at"]
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
|
||||
|
||||
class Submission(models.Model):
|
||||
"""作业提交:项目代码包 + 检测报告"""
|
||||
|
||||
STATUS_CHOICES = [
|
||||
("pending", "待检测"),
|
||||
("running", "检测中"),
|
||||
("completed", "已完成"),
|
||||
("failed", "检测失败"),
|
||||
]
|
||||
|
||||
requirement = models.ForeignKey(
|
||||
Requirement, on_delete=models.CASCADE, related_name="submissions"
|
||||
)
|
||||
name = models.CharField("提交名称", max_length=200)
|
||||
file = models.FileField("项目包", upload_to="submissions/%Y%m/")
|
||||
status = models.CharField("状态", max_length=20, choices=STATUS_CHOICES, default="pending")
|
||||
report = models.JSONField("检测报告", default=dict, blank=True)
|
||||
submitted_by = models.ForeignKey(
|
||||
"auth.User", on_delete=models.SET_NULL, null=True, blank=True,
|
||||
verbose_name="提交人",
|
||||
)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
class Meta:
|
||||
ordering = ["-created_at"]
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.name} ({self.status})"
|
||||
|
||||
Reference in New Issue
Block a user