From 3714621173c606c4c58439ed8941100ce9ddea14 Mon Sep 17 00:00:00 2001
From: Codex Assistant <codex@example.com>
Date: 星期三, 05 十一月 2025 15:10:49 +0800
Subject: [PATCH] bug
---
backend/src/main/resources/graphql/media.graphqls | 147 +++++++++++++++++++-----------------------------
1 files changed, 59 insertions(+), 88 deletions(-)
diff --git a/backend/src/main/resources/graphql/media.graphqls b/backend/src/main/resources/graphql/media.graphqls
index 3b73a15..0e2b1d7 100644
--- a/backend/src/main/resources/graphql/media.graphqls
+++ b/backend/src/main/resources/graphql/media.graphqls
@@ -1,111 +1,82 @@
-# 濯掍綋鏂囦欢绠$悊 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!, url: String!, fileName: String, fileSize: Long): MediaSaveResponse!
-
- "淇濆瓨娲诲姩鎶ュ悕闄勪欢"
- saveActivityPlayerAttachment(activityPlayerId: ID!, url: String!, fileName: String, fileSize: Long, mediaType: Int!): MediaSaveResponse!
+ # 寰俊绔繚瀛樺獟浣撴枃浠禫2
+ 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
-
- "鏍规嵁鐩爣绫诲瀷鍜岀洰鏍嘔D鑾峰彇濯掍綋鍒楄〃"
- 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!
-}
-
-"濯掍綋淇濆瓨杈撳叆绫诲瀷锛堟柊鐗堟湰锛�"
+# 濯掍綋淇濆瓨杈撳叆绫诲瀷锛圴2鐗堟湰锛�
input MediaSaveInput {
- targetType: String! # 鐩爣绫诲瀷锛歱layer, activity_player
- targetId: ID! # 鐩爣ID
- url: String! # COS鏂囦欢URL
- thumbUrl: String # 缂╃暐鍥綰RL锛堝彲閫夛級
- 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
}
\ No newline at end of file
--
Gitblit v1.8.0