From 49c254ed5bdc8348551d808ee72579a6d2221e3b Mon Sep 17 00:00:00 2001
From: lrj <owen.stl@gmail.com>
Date: 星期六, 04 十月 2025 18:43:12 +0800
Subject: [PATCH] fix(miniprogram): 切换 GraphQL 端点为 /graphql,修复 review/index 400
---
backend/src/main/java/com/rongyichuang/player/api/PlayerGraphqlApi.java | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 55 insertions(+), 2 deletions(-)
diff --git a/backend/src/main/java/com/rongyichuang/player/api/PlayerGraphqlApi.java b/backend/src/main/java/com/rongyichuang/player/api/PlayerGraphqlApi.java
index adce16f..fdef59a 100644
--- a/backend/src/main/java/com/rongyichuang/player/api/PlayerGraphqlApi.java
+++ b/backend/src/main/java/com/rongyichuang/player/api/PlayerGraphqlApi.java
@@ -1,9 +1,12 @@
package com.rongyichuang.player.api;
+import com.rongyichuang.common.dto.PageResponse;
import com.rongyichuang.player.dto.input.ActivityPlayerRatingInput;
import com.rongyichuang.player.dto.ActivityRegistrationInput;
import com.rongyichuang.player.dto.response.ActivityPlayerApplicationResponse;
import com.rongyichuang.player.dto.response.ActivityPlayerDetailResponse;
+import com.rongyichuang.player.dto.response.ProjectReviewApplicationPageResponse;
+import com.rongyichuang.player.dto.response.PlayerApplicationPageResponse;
import com.rongyichuang.player.dto.ActivityRegistrationResponse;
import com.rongyichuang.player.dto.response.JudgeRatingStatusResponse;
import com.rongyichuang.player.dto.response.CurrentJudgeRatingResponse;
@@ -14,6 +17,7 @@
import com.rongyichuang.player.dto.PromotionInput;
import com.rongyichuang.player.dto.PromotionResult;
import com.rongyichuang.player.dto.PromotableParticipantsResponse;
+import com.rongyichuang.player.entity.ActivityPlayer;
import com.rongyichuang.player.service.PlayerApplicationService;
import com.rongyichuang.player.service.ActivityPlayerDetailService;
import com.rongyichuang.player.service.ActivityPlayerRatingService;
@@ -53,14 +57,37 @@
}
@QueryMapping
- public List<ActivityPlayerApplicationResponse> activityPlayerApplications(
+ public ActivityPlayer myActivityPlayer(@Argument Long activityId) {
+ return activityPlayerService.getMyActivityPlayer(activityId);
+ }
+
+ @QueryMapping
+ public PlayerApplicationPageResponse activityPlayerApplications(
@Argument String name,
@Argument Long activityId,
@Argument Integer state,
@Argument Integer page,
@Argument Integer size
) {
- return service.listApplications(name, activityId, state, page, size);
+ PageResponse<ActivityPlayerApplicationResponse> pageResponse =
+ service.listApplications(name, activityId, state, page, size);
+ return PlayerApplicationPageResponse.from(pageResponse);
+ }
+
+ /**
+ * 椤圭洰璇勫涓撶敤鏌ヨ锛屽寘鍚墍鏈夐樁娈垫暟鎹紙鍖呮嫭澶嶈禌銆佸喅璧涳級
+ */
+ @QueryMapping
+ public ProjectReviewApplicationPageResponse projectReviewApplications(
+ @Argument String name,
+ @Argument Long activityId,
+ @Argument Integer state,
+ @Argument Integer page,
+ @Argument Integer size
+ ) {
+ PageResponse<ActivityPlayerApplicationResponse> pageResponse =
+ service.listProjectReviewApplications(name, activityId, state, page, size);
+ return ProjectReviewApplicationPageResponse.from(pageResponse);
}
/**
@@ -76,6 +103,14 @@
*/
@QueryMapping
public PlayerRegistrationResponse playerRegistration(@Argument Long activityId) {
+ return activityPlayerService.getPlayerRegistration(activityId);
+ }
+
+ /**
+ * 鏌ヨ鐜╁鍦ㄦ寚瀹氭椿鍔ㄤ腑鐨勬姤鍚嶇姸鎬侊紙鍒悕锛岄伩鍏嶆贩娣嗭級
+ */
+ @QueryMapping(name = "getPlayerRegistrationState")
+ public PlayerRegistrationResponse getPlayerRegistrationState(@Argument Long activityId) {
return activityPlayerService.getPlayerRegistration(activityId);
}
@@ -133,6 +168,24 @@
}
/**
+ * 妫�鏌ヨ瘎濮旀槸鍚﹀湪鎸囧畾姣旇禌闃舵鐨勮瘎濮斿垪琛ㄤ腑
+ */
+ @QueryMapping
+ public Boolean isJudgeInActivity(@Argument Long stageId, @Argument Long judgeId) {
+ log.info("妫�鏌ヨ瘎濮旀潈闄愶紝stageId: {}, judgeId: {}", stageId, judgeId);
+ return ratingService.isJudgeInActivity(stageId, judgeId);
+ }
+
+ /**
+ * 鑾峰彇鎸囧畾璇勫鐨勮瘎鍒嗘槑缁�
+ */
+ @QueryMapping
+ public CurrentJudgeRatingResponse judgeRatingDetail(@Argument Long activityPlayerId, @Argument Long judgeId) {
+ log.info("鑾峰彇鎸囧畾璇勫璇勫垎鏄庣粏锛宎ctivityPlayerId: {}, judgeId: {}", activityPlayerId, judgeId);
+ return ratingService.getJudgeRatingDetail(activityPlayerId, judgeId);
+ }
+
+ /**
* 鎻愪氦娲诲姩鎶ュ悕
*/
@MutationMapping
--
Gitblit v1.8.0