Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app
Submodule app added at 10696d
Binary file modified application/.gradle/7.3.3/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified application/.gradle/7.3.3/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified application/.gradle/7.3.3/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified application/.gradle/7.3.3/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified application/.gradle/7.3.3/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file modified application/.gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified application/.gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
3 changes: 3 additions & 0 deletions application/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package="com.example.myapplication">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:usesCleartextTraffic="true"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
Expand All @@ -23,6 +24,8 @@
</intent-filter>
</activity>
<activity android:name=".ui.mainPage.MainActivity" />
<activity android:name=".ui.mainPage.NewActivity" />
<activity android:name=".ui.mainPage.ChatbotWeb" />
<activity android:name=".ui.join.JoinActivity" />
<activity android:name=".ui.setting.SettingActivity" />
<activity android:name=".ui.join.PasswordChangeActivity" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
import androidx.appcompat.app.AppCompatActivity;

import com.example.myapplication.R;
import com.example.myapplication.ui.ServiceSetting.ServiceAPI;
import com.example.myapplication.ui.ServiceSetting.ServiceGenerator;
import com.example.myapplication.ui.login.LoginActivity;
import com.example.myapplication.ui.mainPage.NewActivity;
import com.example.myapplication.ui.petSelect.PetSelectActivity;

import retrofit2.Call;
import retrofit2.Callback;
Expand All @@ -29,7 +29,7 @@ public class JoinActivity extends AppCompatActivity {

private JoinUserState joinUserState = new JoinUserState();
private boolean validate = false;
private ServiceAPI service = RetrofitClient.getClient().create(ServiceAPI.class);
private ServiceAPI service = ServiceGenerator.createService(ServiceAPI.class);
private Dialog enterCodeDialog;
private AlertDialog dialog;
private int codeEntered;
Expand Down Expand Up @@ -124,8 +124,8 @@ private void validateEmail(EmailValidationData data) {
@Override
public void onResponse(Call<JoinResponse> call, Response<JoinResponse> response) {
JoinResponse result = response.body();
// Toast.makeText(JoinActivity.this, result.getMessage(), Toast.LENGTH_SHORT).show();
if (result.getCode() == 200) {
// Toast.makeText(JoinActivity.this, result.getMessage(), Toast.LENGTH_SHORT).show();
AlertDialog.Builder builder = new AlertDialog.Builder(JoinActivity.this);
dialog = builder.setMessage("사용할 수 있는 이메일입니다.")
.setCancelable(false)
Expand All @@ -137,9 +137,6 @@ public void onClick(DialogInterface dialog, int which) {
.create();
dialog.show();
validate = true;
} else {
string faileResult = "사용할 수 없는 이메일입니다.";
Toast.makeText(JoinActivity.this, faileResult, Toast.LENGTH_SHORT).show();
}
}
@Override
Expand All @@ -156,16 +153,13 @@ private void sendEmail(EmailValidationData data) {
@Override
public void onResponse(Call<JoinResponse> call, retrofit2.Response<JoinResponse> response) {
JoinResponse result = response.body();
Toast.makeText(JoinActivity.this, result.getMessage(), Toast.LENGTH_SHORT).show();
if (result.getCode() == 200) {
Toast.makeText(JoinActivity.this, result.getMessage(), Toast.LENGTH_SHORT).show();
enterCodeDialog = new Dialog(JoinActivity.this);
enterCodeDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
enterCodeDialog.setContentView(R.layout.email_check_dialog);
codeReceived = result.getData();
showEmailCodeEnterDialog();
} else {
string faileResult = "코드 전송에 실패하였습니다. 다시 시도해주세요.";
Toast.makeText(JoinActivity.this, faileResult, Toast.LENGTH_SHORT).show();
}
}
@Override
Expand Down Expand Up @@ -196,13 +190,10 @@ private void startJoin(JoinData data) {
@Override
public void onResponse(Call<JoinResponse> call, Response<JoinResponse> response) {
JoinResponse result = response.body();
Toast.makeText(JoinActivity.this, result.getMessage(), Toast.LENGTH_SHORT).show();
if (result.getCode() == 200) {
Toast.makeText(JoinActivity.this, result.getMessage(), Toast.LENGTH_SHORT).show();
Intent intent = new Intent(getApplicationContext(), LoginActivity.class);
startActivity(intent);
} else {
string faileResult = "회원가입에 실패하였습니다. 다시 시도해주세요.";
Toast.makeText(JoinActivity.this, faileResult, Toast.LENGTH_SHORT).show();
}
}
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import androidx.appcompat.app.AppCompatActivity;

import com.example.myapplication.R;
import com.example.myapplication.ui.ServiceSetting.ServiceAPI;
import com.example.myapplication.ui.ServiceSetting.ServiceGenerator;
import com.example.myapplication.ui.login.LoginActivity;
import com.example.myapplication.ui.login.LoginRequest;

Expand All @@ -28,7 +30,7 @@ public class PasswordChangeActivity extends AppCompatActivity {

private AlertDialog dialog;
private JoinUserState joinUserState = new JoinUserState();
private ServiceAPI service = RetrofitClient.getClient().create(ServiceAPI.class);
private ServiceAPI service = ServiceGenerator.createService(ServiceAPI.class);
private Dialog enterCodeDialog;
private boolean isEmailValidated = false;
private int codeEntered;
Expand Down Expand Up @@ -103,22 +105,19 @@ public void onClick(View view) {
});
}

// 이메일 전송
// 회원가입 버튼 클릭시에 코드를 전송
private void sendEmail(EmailValidationData data) {
service.sendEmail(data).enqueue(new Callback<JoinResponse>() {
@Override
public void onResponse(Call<JoinResponse> call, retrofit2.Response<JoinResponse> response) {
JoinResponse result = response.body();
Toast.makeText(PasswordChangeActivity.this, result.getMessage(), Toast.LENGTH_SHORT).show();
if (result.getCode() == 200) {
Toast.makeText(PasswordChangeActivity.this, result.getMessage(), Toast.LENGTH_SHORT).show();
enterCodeDialog = new Dialog(PasswordChangeActivity.this);
enterCodeDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
enterCodeDialog.setContentView(R.layout.email_check_dialog);
codeReceived = result.getData();
showEmailCodeEnterDialog();
} else {
string faileResult = "입력하신 이메일로 코드를 전송하는데 실패하였습니다. 다시 시도해주세요.";
Toast.makeText(JoinActivity.this, faileResult, Toast.LENGTH_SHORT).show();
}
}
@Override
Expand Down Expand Up @@ -161,9 +160,6 @@ public void onClick(DialogInterface dialog, int which) {}
})
.create();
dialog.show();
} else {
string faileResult = "이메일로 인증에 실패하였습니다. 다시 시도해주세요.";
Toast.makeText(JoinActivity.this, faileResult, Toast.LENGTH_SHORT).show();
}
}
@Override
Expand All @@ -185,9 +181,6 @@ public void onResponse(Call<JoinResponse> call, Response<JoinResponse> response)
AlertDialog.Builder builder = new AlertDialog.Builder(PasswordChangeActivity.this);
Intent intent = new Intent(getApplicationContext(), LoginActivity.class);
startActivity(intent);
} else {
string faileResult = "비밀번호에 실패하였습니다. 다시 시도해주세요.";
Toast.makeText(JoinActivity.this, faileResult, Toast.LENGTH_SHORT).show();
}
}
@Override
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
import androidx.appcompat.app.AppCompatActivity;

import com.example.myapplication.R;
import com.example.myapplication.ui.ServiceSetting.ServiceGenerator;
import com.example.myapplication.ui.join.JoinActivity;
import com.example.myapplication.ui.join.PasswordChangeActivity;
import com.example.myapplication.ui.join.RetrofitClient;
import com.example.myapplication.ui.ServiceSetting.ServiceAPI;
import com.example.myapplication.ui.petSelect.PetSelectActivity;

import retrofit2.Call;
Expand All @@ -28,12 +29,18 @@

public class LoginActivity extends AppCompatActivity {

private LoginAPI loginAPI = RetrofitClient.getClient().create(LoginAPI.class);
private String TOKEN = getToken(); // access token을 가져오는 함수를 직접 정의하셔야합니다.
private ServiceAPI service = ServiceGenerator.createService(ServiceAPI.class, TOKEN);

private TextView pw_change;
private EditText login_email, login_password;
private Button login_button, join_button, pw_change;
private Button login_button, join_button;
private LoginFormState LoginFormState = new LoginFormState();

public String getToken() {
return TOKEN;
}

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate( savedInstanceState );
Expand Down Expand Up @@ -116,6 +123,7 @@ public void onClick(View view) {
}
});
}

public void LoginResponse() {
String userID = login_email.getText().toString().trim();
String userPassword = login_password.getText().toString().trim();
Expand All @@ -124,7 +132,7 @@ public void LoginResponse() {
LoginRequest loginRequest = new LoginRequest(userID, userPassword);

//loginRequest에 저장된 데이터와 함께 LoginAPI에서 정의한 getLoginResponse 함수를 실행한 후 응답을 받음
loginAPI.getLoginResponse(loginRequest).enqueue(new Callback<LoginResponse>() {
service.getLoginResponse(loginRequest).enqueue(new Callback<LoginResponse>() {
@Override
public void onResponse(Call<LoginResponse> call, Response<LoginResponse> response) {
//response.body()를 result에 저장
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,18 @@ public class LoginResponse {

@SerializedName("responseMessage")
private String message;
//회원 기본 정보
@SerializedName("memberEmail")
public String inputId;

public int getStatusCode() { return statusCode; }

public String getMessage() {
return message;
}

public String getuserID() {
return inputId;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ protected void onCreate(Bundle savedInstanceState) {
// getActionBar().setDisplayShowTitleEnabled(false);

// 버튼 선언
Button questionnaireBtn = (Button) findViewById(R.id.home_button1);
Button chatbotBtn = (Button) findViewById(R.id.home_button2);
Button chatbotBtn = (Button) findViewById(R.id.home_button1);
Button questionnaireBtn = (Button) findViewById(R.id.home_button2);
Button diseaseListBtn = (Button) findViewById(R.id.home_button3);
Button loginPage = (Button) findViewById(R.id.drawer_button_login);
Button petPage = (Button) findViewById(R.id.drawer_button_pet);
Expand All @@ -38,14 +38,14 @@ protected void onCreate(Bundle savedInstanceState) {
ImageButton drawerBtn = (ImageButton) findViewById(R.id.toolbar_btn);

// 버튼 클릭 시의 화면 이동 구현
questionnaireBtn.setOnClickListener(new View.OnClickListener(){
chatbotBtn.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view){
Intent intent = new Intent(getApplicationContext(), NewActivity.class);
Intent intent = new Intent(getApplicationContext(), ChatbotWeb.class);
startActivity(intent);
}
});
chatbotBtn.setOnClickListener(new View.OnClickListener(){
questionnaireBtn.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view){
Intent intent = new Intent(getApplicationContext(), NewActivity.class);
Expand Down
Loading