From afeeed281e60466b576fbe74d339634cc5d07b82 Mon Sep 17 00:00:00 2001
From: Codex Assistant <codex@example.com>
Date: 星期三, 08 十月 2025 08:56:42 +0800
Subject: [PATCH] 修复评审功能和用户认证问题

---
 backend/src/main/java/com/rongyichuang/auth/api/AuthGraphqlApi.java |   52 +++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 49 insertions(+), 3 deletions(-)

diff --git a/backend/src/main/java/com/rongyichuang/auth/api/AuthGraphqlApi.java b/backend/src/main/java/com/rongyichuang/auth/api/AuthGraphqlApi.java
index fab4042..4738fae 100644
--- a/backend/src/main/java/com/rongyichuang/auth/api/AuthGraphqlApi.java
+++ b/backend/src/main/java/com/rongyichuang/auth/api/AuthGraphqlApi.java
@@ -1,5 +1,8 @@
 package com.rongyichuang.auth.api;
 
+import com.rongyichuang.auth.dto.PhoneDecryptResponse;
+import com.rongyichuang.auth.dto.WxLoginRequest;
+import com.rongyichuang.auth.dto.WxLoginResponse;
 import com.rongyichuang.auth.dto.LoginRequest;
 import com.rongyichuang.auth.dto.LoginResponse;
 import com.rongyichuang.auth.service.AuthService;
@@ -9,7 +12,7 @@
 import org.springframework.stereotype.Controller;
 
 /**
- * 璁よ瘉GraphQL API
+ * 璁よ瘉GraphQL API鎺у埗鍣�
  */
 @Controller
 public class AuthGraphqlApi {
@@ -18,10 +21,53 @@
     private AuthService authService;
 
     /**
-     * Web绔敤鎴风櫥褰�
+     * 寰俊鐧诲綍
+     */
+    @MutationMapping
+    public WxLoginResponse wxLogin(@Argument WxLoginRequest input) {
+        try {
+            return authService.wxLogin(input);
+        } catch (Exception e) {
+            throw new RuntimeException("寰俊鐧诲綍澶辫触: " + e.getMessage(), e);
+        }
+    }
+
+    /**
+     * Web绔櫥褰�
      */
     @MutationMapping
     public LoginResponse webLogin(@Argument LoginRequest input) {
-        return authService.login(input);
+        try {
+            return authService.login(input);
+        } catch (Exception e) {
+            throw new RuntimeException("鐧诲綍澶辫触: " + e.getMessage(), e);
+        }
+    }
+
+    /**
+     * 瑙e瘑寰俊鎵嬫満鍙凤紙鏃х増API锛�
+     */
+    @MutationMapping
+    public PhoneDecryptResponse decryptPhoneNumber(
+            @Argument String encryptedData,
+            @Argument String iv,
+            @Argument String sessionKey) {
+        try {
+            return authService.decryptPhoneNumber(encryptedData, iv, sessionKey);
+        } catch (Exception e) {
+            throw new RuntimeException("鎵嬫満鍙疯В瀵嗗け璐�: " + e.getMessage(), e);
+        }
+    }
+
+    /**
+     * 鑾峰彇寰俊鎵嬫満鍙凤紙鏂扮増API锛�
+     */
+    @MutationMapping
+    public PhoneDecryptResponse getPhoneNumberByCode(@Argument String code) {
+        try {
+            return authService.getPhoneNumberByCode(code);
+        } catch (Exception e) {
+            throw new RuntimeException("鑾峰彇鎵嬫満鍙峰け璐�: " + e.getMessage(), e);
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.8.0