From ba94ceae1315174798ae1967ef62268c6d16cd5b Mon Sep 17 00:00:00 2001 From: Codex Assistant <codex@example.com> Date: 星期一, 06 十月 2025 22:07:06 +0800 Subject: [PATCH] feat: 评审与活动相关改动 - backend(GraphQL): Activity schema 增加 updateActivityState(id, state);实现 resolver/service 仅更新 state=2 作为逻辑删除 - backend(GraphQL): region.graphqls 新增 Query leafRegions - backend(GraphQL): player.graphqls 的 projectReviewApplications 增加可选参数 regionId - backend(Service): listProjectReviewApplications 绑定 regionId 参数,修复 QueryParameterException - frontend(web): 新增 api/activity.js 的 updateActivityState 并接入 activity-list 删除逻辑 - frontend(web): review-list.vue 权限仅校验登录,移除角色限制;查询参数修正为 name/regionId - frontend(web): 删除未引用的 ActivityList.vue - frontend(web): projectReviewNew.js GraphQL 查询增加 name 参数 --- backend/src/main/java/com/rongyichuang/media/api/MediaV2GraphqlApi.java | 28 +++++++++++++++++++--------- 1 files changed, 19 insertions(+), 9 deletions(-) diff --git a/backend/src/main/java/com/rongyichuang/media/api/MediaV2GraphqlApi.java b/backend/src/main/java/com/rongyichuang/media/api/MediaV2GraphqlApi.java index 3a280cf..6d6786d 100644 --- a/backend/src/main/java/com/rongyichuang/media/api/MediaV2GraphqlApi.java +++ b/backend/src/main/java/com/rongyichuang/media/api/MediaV2GraphqlApi.java @@ -1,4 +1,6 @@ package com.rongyichuang.media.api; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.rongyichuang.media.dto.MediaSaveInput; import com.rongyichuang.media.dto.MediaSaveResponse; @@ -15,6 +17,7 @@ @Controller @Slf4j public class MediaV2GraphqlApi { + private static final Logger log = LoggerFactory.getLogger(MediaV2GraphqlApi.class); @Autowired private MediaV2Service mediaService; @@ -39,17 +42,24 @@ * @return 淇濆瓨缁撴灉 */ @MutationMapping - public MediaSaveResponse savePlayerAvatar(@Argument Long playerId, @Argument String url, + public MediaSaveResponse savePlayerAvatar(@Argument Long playerId, @Argument String path, @Argument String fileName, @Argument Long fileSize) { log.info("鏀跺埌淇濆瓨閫夋墜澶村儚璇锋眰锛岄�夋墜ID: {}", playerId); MediaSaveInput input = new MediaSaveInput(); input.setTargetType("player"); input.setTargetId(playerId); - input.setPath(url); - input.setName(fileName); + input.setPath(path); + input.setFileName(fileName); input.setFileSize(fileSize); - input.setMediaType(1); // 澶村儚绫诲瀷 + input.setMediaType(1); // 澶村儚榛樿涓哄浘鐗囩被鍨� + + // 浠庢枃浠跺悕涓彁鍙栨枃浠舵墿灞曞悕 + String fileExt = ""; + if (fileName != null && fileName.contains(".")) { + fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase(); + } + input.setFileExt(fileExt); return mediaService.saveMedia(input); } @@ -64,19 +74,19 @@ * @return 淇濆瓨缁撴灉 */ @MutationMapping - public MediaSaveResponse saveActivityPlayerAttachment(@Argument Long activityPlayerId, @Argument String url, - @Argument String fileName, @Argument Long fileSize, - @Argument Integer mediaType) { + public MediaSaveResponse saveActivityPlayerAttachment(@Argument Long activityPlayerId, @Argument String path, + @Argument String fileName, @Argument Long fileSize, @Argument Integer mediaType) { log.info("鏀跺埌淇濆瓨娲诲姩鎶ュ悕闄勪欢璇锋眰锛屾椿鍔ㄦ姤鍚岻D: {}", activityPlayerId); MediaSaveInput input = new MediaSaveInput(); input.setTargetType("activity_player"); input.setTargetId(activityPlayerId); - input.setPath(url); - input.setName(fileName); + input.setPath(path); + input.setFileName(fileName); input.setFileSize(fileSize); input.setMediaType(mediaType); + return mediaService.saveMedia(input); } } \ No newline at end of file -- Gitblit v1.8.0