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/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