lrj
昨天 9f8395fab13ca4b230a0f7d62636e209745c91d4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# 媒体文件管理 GraphQL Schema
 
extend type Mutation {
    "保存媒体文件信息"
    saveMedia(input: MediaInput!): Media
    
    "删除媒体文件"
    deleteMedia(id: ID!): Boolean
    
    "保存媒体文件(新版本)"
    saveMediaV2(input: MediaSaveInput!): MediaSaveResponse!
    
    "保存选手头像"
    savePlayerAvatar(playerId: ID!, url: String!, fileName: String, fileSize: Long): MediaSaveResponse!
    
    "保存活动报名附件"
    saveActivityPlayerAttachment(activityPlayerId: ID!, url: 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!
}
 
"媒体输入类型"
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!
    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!
}
 
"媒体保存输入类型(新版本)"
input MediaSaveInput {
    targetType: String!     # 目标类型:player, activity_player
    targetId: ID!          # 目标ID
    url: String!           # COS文件URL
    thumbUrl: String       # 缩略图URL(可选)
    fileName: String       # 文件名
    fileExt: String        # 文件扩展名
    fileSize: Long         # 文件大小(字节)
    duration: Int          # 视频时长(秒,视频文件专用)
    mediaType: Int!        # 媒体类型:1-图片,2-视频,3-音频,4-文档
}
 
"媒体保存响应类型"
type MediaSaveResponse {
    success: Boolean!
    message: String
    mediaId: ID
}