// CertificationNumScreen.tsx

const handleGetVerificationCode = async () => {
    Alert.alert("인증번호 발송 완료! 이메일을 확인해주세요.");

    const requestBody = {
      email: email,
      employeeId: employeeId,
    };

    console.log("Email:", email);
    console.log("Employee ID:", employeeId);

    // try {
    //   const response = await fetch(`${URL}/api/v1/sign`, {
    //     method: 'POST',
    //     headers: {
    //       'Content-Type': 'application/json',
    //     },
    //     body: JSON.stringify(requestBody),
    //   });
    //   const data = await response.json();
    //   console.log('Success:', data);
    // } catch (error) {
    //   console.error('Error:', error);
    // }
  };

위 코드는 API 호출 코드임.

API 호출 == 백엔드와의 통신

형태는 동일하게 사용하되 requesBody 안의 내용을 swagger를 참고하여 작성하면 됨.

이 함수는 버튼 클릭 시 onPress 에 넣어 사용하면 됨.

<Button buttonText="인증번호 받기" style={styles.button} onPress={handleGetVerificationCode}></Button>

이런 식.

  1. MainScreen에서 이메일과 사번 인증 완료

  2. 이메일과 사번을 CertificationNumScreen으로 보내줄 거임 (내가)

    1. 아래 북마크는 Swagger임

    http://52.79.91.125:8080/swagger-ui/index.html#/employee-controller/test

  3. 그걸 그대로 ${URL}/api/v1/finish-sign 으로 위의 API의 requestBody를 수정하여 보내면 됨

    1. 이때 code는 사용자가 입력한 인증코드
    2. URL은 src/const/url.js에 있음. 이걸 import 해서 쓰도록

    Untitled

  4. 인증코드가 확인되면 (서버에서 200 응답이 돌아오면)

  5. 이 이메일과 사번으로 web3 계정 생성 후 PrivateKeyScreen으로 넘어가 PrivateKey 복사를 하게 만들 것

Untitled

  1. ${URL}/api/v1/wallet 으로 이메일, 사번, 계정 >주소< 를 보낼 것
  2. 그럼 회원가입 끝.
  3. 또다시 200 돌아오면 NFT 발급 완료 페이지로 넘어가십시오