历史上一共 6 条站内信(最后一条 2025-06),发信接口两代前端都没接过,后台页面只有一句 「未完待续」,OJ2 顶栏也没有入口。 0033 是 DROP TABLE,部署要显式放行:OJ2_ALLOW_DESTRUCTIVE=1 docker/deploy.sh, 或 CI 手工触发时勾 allow_destructive。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
734f4aed05
commit
4240a451e4
13 files changed
+3838
-308
No files matched your search
@@ -1,7 +1,6 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { paginatedSchema, sampleUserSchema } from "./common"
|
||||
import { embeddedSubmissionSchema } from "./submission"
|
||||
|
||||
export const announcementSchema = z.object({
|
||||
id: z.number().int(),
|
||||
@@ -26,25 +25,6 @@ export const announcementListItemSchema = announcementSchema.omit({
|
||||
|
||||
export const announcementListSchema = paginatedSchema(announcementListItemSchema)
|
||||
|
||||
export const messageSchema = z.object({
|
||||
id: z.number().int(),
|
||||
sender: sampleUserSchema,
|
||||
createTime: z.string(),
|
||||
message: z.string(),
|
||||
submission: embeddedSubmissionSchema,
|
||||
})
|
||||
|
||||
export const messageListSchema = paginatedSchema(messageSchema)
|
||||
|
||||
export const createMessageRequestSchema = z.object({
|
||||
recipientId: z.number().int().positive(),
|
||||
submissionId: z.string().min(1),
|
||||
message: z
|
||||
.string()
|
||||
.min(1)
|
||||
.max(1024 * 1024),
|
||||
})
|
||||
|
||||
export const reactionKeySchema = z.enum([
|
||||
"too_easy",
|
||||
"too_hard",
|
||||
@@ -194,14 +174,11 @@ export const exerciseSchema = z.object({
|
||||
solved: z.boolean(),
|
||||
})
|
||||
|
||||
export type Message = z.infer<typeof messageSchema>
|
||||
export type MessageList = z.infer<typeof messageListSchema>
|
||||
export type Announcement = z.infer<typeof announcementSchema>
|
||||
export type AnnouncementListItem = z.infer<typeof announcementListItemSchema>
|
||||
export type TutorialSummary = z.infer<typeof tutorialSummarySchema>
|
||||
|
||||
export type AnnouncementList = z.infer<typeof announcementListSchema>
|
||||
export type CreateMessageRequest = z.infer<typeof createMessageRequestSchema>
|
||||
export type ReactionKey = z.infer<typeof reactionKeySchema>
|
||||
export type ReactionCounts = z.infer<typeof reactionCountsSchema>
|
||||
export type ReactionState = z.infer<typeof reactionStateSchema>
|
||||
|
||||
@@ -229,24 +229,6 @@ export const submissionDetailSchema = z.object({
|
||||
caseSummary: caseSummarySchema,
|
||||
})
|
||||
|
||||
/**
|
||||
* 内嵌在别处(目前只有站内信)的提交对象。对齐旧后端的
|
||||
* `SubmissionSafeModelSerializer(exclude=("info", "contest", "ip"))` ——
|
||||
* 这些键**根本不出现**,而不是出现但值为空。(`ip` 已随 IP 功能整体删除。)
|
||||
*
|
||||
* 独立成一个 schema 而不是复用 submissionDetailSchema 传空值:形状一致了,
|
||||
* 将来有人「顺手」把空值改成真值就不会变成泄露,因为这里压根没有这些字段。
|
||||
*/
|
||||
export const embeddedSubmissionSchema = submissionDetailSchema
|
||||
// 留下 problemDisplayId(展示用题号)而不是数字主键:站内信页面拿它拼
|
||||
// `/problem/<题号>` 链接,给数字 id 会拼出打不开的地址。
|
||||
.omit({
|
||||
info: true,
|
||||
contestId: true,
|
||||
problemId: true,
|
||||
caseSummary: true,
|
||||
})
|
||||
|
||||
/**
|
||||
* 判题进度推送。**只带前端真正要用的东西**:靠 submissionId 认领、靠 result /
|
||||
* status 决定是继续等还是去拉详情。
|
||||
@@ -623,7 +605,6 @@ export type AttemptedStudent = z.infer<typeof attemptedStudentSchema>
|
||||
|
||||
export type SubmissionListItem = z.infer<typeof submissionListItemSchema>
|
||||
export type SubmissionList = z.infer<typeof submissionListSchema>
|
||||
export type EmbeddedSubmission = z.infer<typeof embeddedSubmissionSchema>
|
||||
export type CreateSubmissionResponse = z.infer<typeof createSubmissionResponseSchema>
|
||||
export type FormatCodeResponse = z.infer<typeof formatCodeResponseSchema>
|
||||
|
||||
|
||||
Reference in new issue
Block a user