| | |
| | | # 媒体文件管理 GraphQL Schema |
| | | extend type Query { |
| | | media(id: ID!): Media |
| | | mediasByTarget(targetType: Int!, targetId: ID!): [MediaResponse] |
| | | } |
| | | |
| | | extend type Mutation { |
| | | "保存媒体文件信息" |
| | | saveMedia(input: MediaInput!): Media |
| | | |
| | | "删除媒体文件" |
| | | deleteMedia(id: ID!): Boolean |
| | | # 微信端保存媒体文件V2 |
| | | saveMediaV2(input: MediaSaveInput!): MediaSaveResponse |
| | | # 保存选手头像 |
| | | savePlayerAvatar(playerId: ID!, path: String!, fileName: String!, fileSize: Long!): MediaSaveResponse |
| | | # 保存活动报名附件 |
| | | saveActivityPlayerAttachment(activityPlayerId: ID!, path: String!, fileName: String!, fileSize: Long!, mediaType: Int!): MediaSaveResponse |
| | | } |
| | | |
| | | extend type Query { |
| | | "根据ID获取媒体信息" |
| | | media(id: ID!): Media |
| | | |
| | | "根据目标类型和目标ID获取媒体列表" |
| | | mediasByTarget(targetType: Int!, targetId: ID!): [MediaResponse!]! |
| | | |
| | | "应用配置(提供媒体前缀等)" |
| | | appConfig: AppConfig! |
| | | type Media { |
| | | id: ID |
| | | name: String |
| | | path: String |
| | | fileSize: Int |
| | | fileExt: String |
| | | mediaType: Int |
| | | targetType: Int |
| | | targetId: Long |
| | | thumbPath: String |
| | | duration: Int |
| | | description: String |
| | | fullUrl: String |
| | | fullThumbUrl: String |
| | | } |
| | | |
| | | "媒体输入类型" |
| | | # 与后端 DTO 对齐的响应类型,供 Carousel/Activity 等使用 |
| | | type MediaResponse { |
| | | id: ID |
| | | name: String |
| | | path: String |
| | | fileSize: Int |
| | | fileExt: String |
| | | mediaType: Int |
| | | targetType: Int |
| | | targetId: Long |
| | | thumbPath: String |
| | | duration: Int |
| | | description: String |
| | | fullUrl: String |
| | | fullThumbUrl: String |
| | | } |
| | | |
| | | # 媒体输入类型 |
| | | input MediaInput { |
| | | name: String! |
| | | path: String! |
| | | fileSize: Int! |
| | | fileExt: String! |
| | | mediaType: Int! |
| | | targetType: Int |
| | | targetId: ID |
| | | thumbPath: String |
| | | duration: Int |
| | | description: String |
| | | } |
| | | |
| | | "媒体文件类型" |
| | | type Media { |
| | | id: ID! |
| | | name: String! |
| | | path: String! |
| | | fileSize: Int |
| | | fileExt: String! |
| | | fileExt: String |
| | | mediaType: Int! |
| | | targetType: Int! |
| | | targetId: Long! |
| | | thumbPath: String |
| | | duration: Int |
| | | description: String |
| | | state: String |
| | | targetType: Int |
| | | targetId: ID |
| | | mediaType: Int! |
| | | |
| | | "完整访问地址(前缀 + path)" |
| | | fullUrl: String |
| | | "缩略图完整地址(前缀 + thumbPath)" |
| | | fullThumbUrl: String |
| | | } |
| | | |
| | | "媒体响应类型" |
| | | type MediaResponse { |
| | | id: ID! |
| | | name: String! |
| | | # 媒体保存输入类型(V2版本) |
| | | input MediaSaveInput { |
| | | targetType: String! |
| | | targetId: Long! |
| | | path: String! |
| | | fileSize: Int |
| | | fileExt: String! |
| | | thumbPath: String |
| | | fileName: String |
| | | fileExt: String |
| | | fileSize: Long |
| | | duration: Int |
| | | description: String |
| | | targetType: Int |
| | | targetId: ID |
| | | mediaType: Int! |
| | | |
| | | "完整访问地址(前缀 + path)" |
| | | fullUrl: String |
| | | "缩略图完整地址(前缀 + thumbPath)" |
| | | fullThumbUrl: String |
| | | } |
| | | |
| | | |
| | | |
| | | "应用配置" |
| | | type AppConfig { |
| | | mediaBaseUrl: String! |
| | | # 媒体保存响应类型 |
| | | type MediaSaveResponse { |
| | | success: Boolean! |
| | | message: String! |
| | | mediaId: Long |
| | | } |