| | |
| | | # 媒体文件管理 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 |
| | | |
| | | "保存媒体文件(新版本)" |
| | | 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! |
| | | # 微信端保存媒体文件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! |
| | | path: String! |
| | | fileSize: Int |
| | | fileExt: String! |
| | | thumbPath: String |
| | | duration: Int |
| | | description: String |
| | | targetType: Int |
| | | targetId: ID |
| | | mediaType: Int! |
| | | |
| | | "完整访问地址(前缀 + path)" |
| | | fullUrl: String |
| | | "缩略图完整地址(前缀 + thumbPath)" |
| | | fullThumbUrl: String |
| | | } |
| | | |
| | | |
| | | |
| | | "应用配置" |
| | | type AppConfig { |
| | | mediaBaseUrl: String! |
| | | } |
| | | |
| | | "媒体保存输入类型(新版本)" |
| | | # 媒体保存输入类型(V2版本) |
| | | input MediaSaveInput { |
| | | targetType: String! # 目标类型:player, activity_player |
| | | targetId: ID! # 目标ID |
| | | path: String! # COS文件路径 |
| | | thumbPath: String # 缩略图路径(可选) |
| | | fileName: String # 文件名 |
| | | fileExt: String # 文件扩展名 |
| | | fileSize: Long # 文件大小(字节) |
| | | duration: Int # 视频时长(秒,视频文件专用) |
| | | mediaType: Int! # 媒体类型:1-图片,2-视频,3-音频,4-文档 |
| | | targetType: String! |
| | | targetId: Long! |
| | | path: String! |
| | | thumbPath: String |
| | | fileName: String |
| | | fileExt: String |
| | | fileSize: Long |
| | | duration: Int |
| | | mediaType: Int! |
| | | } |
| | | |
| | | "媒体保存响应类型" |
| | | # 媒体保存响应类型 |
| | | type MediaSaveResponse { |
| | | success: Boolean! |
| | | message: String |
| | | mediaId: ID |
| | | message: String! |
| | | mediaId: Long |
| | | } |