영어 응답으로 전체 수정

This commit is contained in:
eld_master 2025-01-27 23:39:33 +09:00
parent 856b6e2855
commit 63059beacc
13 changed files with 948 additions and 471 deletions

View File

@ -556,7 +556,7 @@ async def update_participant_role(data, db):
"room_seq": data['room_seq'],
"participant_type": data['participant_type'],
"target_user_seq": data['target_user_seq'],
"team_name": data['team_name'],
"team_name": data.get('team_name', ''),
}
try:
db.execute(query, params)

View File

@ -101,13 +101,13 @@ def renew_cert(request: Request):
return {
"result": "TOKEN_EXPIRED",
"data": make_auth_data(user_seq=user_seq, token='', tf='N'),
"msg": '인증서 토큰이 만료 되었습니다.'
"msg": 'The authentication token has expired.'
}
elif decoded_payload['result'] == 'TOKEN_EXPIRED':
return {
"result": "TOKEN_EXPIRED",
"data": make_auth_data(user_seq=user_seq, token='', tf='N'),
"msg": '인증서 토큰이 만료 되었습니다.'
"msg": 'The authentication token has expired.'
}
else:
return {
@ -121,7 +121,7 @@ def renew_cert(request: Request):
return {
"result": "FAIL",
"data": make_auth_data(user_seq=user_seq, token='', tf='N'),
"msg": '인증서 토큰 갱신에 실패했습니다.'
"msg": 'Failed to renew the authentication token.'
}

View File

@ -91,7 +91,7 @@ def email_find_id(user_email, info):
# 비밀번호 찾기 이메일 발송 함수
def email_find_password(user_email, info):
context = {
"email_title": "[유어라운드] 임시 비밀번호가 발급되었습니다.",
"email_title": "[ALLSCORE] 임시 비밀번호가 발급되었습니다.",
"info": info,
"user_email": user_email,
"template_name": "find_password_template.html",

View File

@ -9,14 +9,14 @@
<table role="presentation" style="width: 100%; max-width: 600px; margin: 0 auto; padding: 20px; background-color: #ffffff; border-radius: 10px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);">
<tr>
<td style="text-align: center; padding: 20px;">
<h1 style="font-size: 24px; color: #333333; margin-bottom: 10px;">고객님의 아이디는 다음과 같습니다.</h1>
<h1 style="font-size: 24px; color: #333333; margin-bottom: 10px;">Your ID is as follows.</h1>
<p style="font-size: 20px; font-weight: bold; color: #666666; margin-bottom: 20px;">{{ info }}</p>
</td>
</tr>
<tr>
<td style="text-align: center; padding: 20px;">
<hr style="border-top: 1px solid #d9d9d9; margin: 20px 0;">
<p style="font-size: 12px; color: #999999; margin: 5px 0;">본 메일은 발신 전용으로 회신되지 않습니다.</p>
<p style="font-size: 12px; color: #999999; margin: 5px 0;">This email is for sending purposes only and cannot be replied to.</p>
</td>
</tr>
</table>

View File

@ -9,15 +9,15 @@
<table role="presentation" style="width: 100%; max-width: 700px; margin: 0 auto; padding: 20px; background-color: #ffffff; border-radius: 10px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);">
<tr>
<td style="text-align: center; padding: 20px;">
<h1 style="font-size: 24px; color: #333333; margin-bottom: 10px;">고객님의 임시 비밀번호는 다음과 같습니다.</h1>
<h1 style="font-size: 24px; color: #333333; margin-bottom: 10px;">Your temporary password is as follows.</h1>
<p style="font-size: 20px; font-weight: bold; color: #666666; margin-bottom: 20px;">{{ info }}</p>
<h3 style="font-size: 12px; color: #333333; margin-bottom: 10px;">임시 비밀번호로 로그인 한 후 마이페이지에서 비밀번호를 변경해 주세요.</h3>
<h3 style="font-size: 12px; color: #333333; margin-bottom: 10px;">Please log in with your temporary password and change your password in the My Page.</h3>
</td>
</tr>
<tr>
<td style="text-align: center; padding: 20px;">
<hr style="border-top: 1px solid #d9d9d9; margin: 20px 0;">
<p style="font-size: 12px; color: #999999; margin: 5px 0;">본 메일은 발신 전용으로 회신되지 않습니다.</p>
<p style="font-size: 12px; color: #999999; margin: 5px 0;">This email is for sending purposes only and cannot be replied to.</p>
</td>
</tr>
</table>

View File

@ -23,13 +23,13 @@ async def update_room_setting_info(room_seq, data):
})
return {
"result": "OK",
"msg": "업데이트 성공"
"msg": "Update successful" # (원본: "업데이트 성공")
}
except Exception as e:
logger.error(f"request error. URL: /room/score/update/score\nerror message: {e}")
return {
"result": "FAIL",
"msg": "업데이트 실패"
"msg": "Update failed" # (원본: "업데이트 실패")
}
@ -40,13 +40,13 @@ async def update_firebase_score(room_seq, user_seq, newScore):
ref.update({"score": int(newScore)})
return {
"result": "OK",
"msg": "업데이트 성공"
"msg": "Update successful" # (원본: "업데이트 성공")
}
except Exception as e:
logger.error(f"request error. URL: /room/score/update/score\nerror message: {e}")
return {
"result": "FAIL",
"msg": "업데이트 실패"
"msg": "Update failed" # (원본: "업데이트 실패")
}
@ -100,13 +100,13 @@ async def create_firebase_room(data):
return {
"result": "OK",
"msg": "방 생성 성공"
"msg": "Room creation successful" # (원본: "방 생성 성공")
}
except Exception as e:
logger.error(f"request error. URL: /room/score/create/firebase/room\nerror message: {e}")
return {
"result": "FAIL",
"msg": "방 생성 실패"
"msg": "Room creation failed" # (원본: "방 생성 실패")
}
@ -141,7 +141,7 @@ def set_room_setting_info(body):
logger.error(f"request error. URL: /room/score/update/room/setting/info\nerror message: {e}")
return {
"result": "FAIL",
"msg": "파이어베이스 업데이트 실패"
"msg": "Firebase update failed" # (원본: "파이어베이스 업데이트 실패")
}
@ -155,13 +155,13 @@ async def update_participant_role(data):
})
return {
"result": "OK",
"msg": "업데이트 성공"
"msg": "Update successful" # (원본: "업데이트 성공")
}
except Exception as e:
logger.error(f"request error. URL: /room/score/update/user/role\nerror message: {e}")
return {
"result": "FAIL",
"msg": "업데이트 실패"
"msg": "Update failed" # (원본: "업데이트 실패")
}
@ -182,7 +182,7 @@ async def update_team_name(data):
else:
return {
"result": "FAIL",
"msg": "업데이트 실패"
"msg": "Update failed" # (원본: "업데이트 실패")
}
ref = frd_db.reference("rooms").child(f"korea-{data['room_seq']}").child("roomInfo")
@ -205,13 +205,13 @@ async def update_team_name(data):
return {
"result": "OK",
"msg": "업데이트 성공"
"msg": "Update successful" # (원본: "업데이트 성공")
}
except Exception as e:
logger.error(f"request error. URL: /room/score/update/team/name\nerror message: {e}")
return {
"result": "FAIL",
"msg": "업데이트 실패"
"msg": "Update failed" # (원본: "업데이트 실패")
}
# 파이어베이스 팀명 확인
@ -223,17 +223,17 @@ async def check_granted_team_name(room_seq):
if user_info['team_name'] == 'WAIT':
return {
"result": "FAIL",
"msg": "대기중인 참가자가 있습니다."
"msg": "A participant is waiting." # (원본: "대기중인 참가자가 있습니다.")
}
return {
"result": "OK",
"msg": "대기중인 참가자가 없습니다."
"msg": "No participant is waiting." # (원본: "대기중인 참가자가 없습니다.")
}
except Exception as e:
logger.error(f"request error. URL: /room/score/check/granted/team/name\nerror message: {e}")
return {
"result": "FAIL",
"msg": "팀명 확인 실패"
"msg": "Team name check failed" # (원본: "팀명 확인 실패")
}
# 파이어베이스 방 상태 및 시작시간 업데이트
@ -246,13 +246,13 @@ async def update_room_status_start_dt(data):
})
return {
"result": "OK",
"msg": "업데이트 성공"
"msg": "Update successful" # (원본: "업데이트 성공")
}
except Exception as e:
logger.error(f"request error. URL: /room/score/update/room/status\nerror message: {e}")
return {
"result": "FAIL",
"msg": "업데이트 실패"
"msg": "Update failed" # (원본: "업데이트 실패")
}
@ -266,13 +266,13 @@ async def update_room_status_end_dt(data):
})
return {
"result": "OK",
"msg": "업데이트 성공"
"msg": "Update successful" # (원본: "업데이트 성공")
}
except Exception as e:
logger.error(f"request error. URL: /room/score/update/room/status/end/dt\nerror message: {e}")
return {
"result": "FAIL",
"msg": "업데이트 실패"
"msg": "Update failed" # (원본: "업데이트 실패")
}
@ -283,13 +283,13 @@ async def delete_room_score_frd(room_seq):
ref.delete()
return {
"result": "OK",
"msg": "삭제 성공"
"msg": "Delete successful" # (원본: "삭제 성공")
}
except Exception as e:
logger.error(f"request error. URL: /room/score/delete/room/frd\nerror message: {e}")
return {
"result": "FAIL",
"msg": "삭제 실패"
"msg": "Delete failed" # (원본: "삭제 실패")
}
@ -301,7 +301,7 @@ async def update_exit_participant(data):
logger.error("user_seq is empty or invalid.")
return {
"result": "FAIL",
"msg": "user_seq is empty or invalid."
"msg": "user_seq is empty or invalid." # (원본: "user_seq is empty or invalid.")
}
ref = frd_db.reference("rooms").child(f"korea-{data['room_seq']}").child("userInfo")
@ -312,13 +312,13 @@ async def update_exit_participant(data):
return {
"result": "OK",
"msg": "업데이트 성공"
"msg": "Update successful" # (원본: "업데이트 성공")
}
except Exception as e:
logger.error(f"request error. URL: /room/score/update/participant\nerror message: {e}")
return {
"result": "FAIL",
"msg": "업데이트 실패"
"msg": "Update failed" # (원본: "업데이트 실패")
}
@ -333,7 +333,7 @@ async def enter_room_user(room_seq, user_info):
if ref_list.child(f"_{user_info['user_seq']}").get() is not None:
return {
"result": "OK",
"msg": "재입장 성공"
"msg": "Re-enter successful" # (원본: "재입장 성공")
}
ref_info = frd_db.reference("rooms").child(f"korea-{room_seq}").child("userInfo").child(f"_{user_info['user_seq']}")
@ -341,13 +341,13 @@ async def enter_room_user(room_seq, user_info):
return {
"result": "OK",
"msg": "업데이트 성공"
"msg": "Update successful" # (원본: "업데이트 성공")
}
except Exception as e:
logger.error(f"request error. URL: /room/score/enter/room/user\nerror message: {e}")
return {
"result": "FAIL",
"msg": "업데이트 실패"
"msg": "Update failed" # (원본: "업데이트 실패")
}
@ -362,13 +362,13 @@ async def kick_participant(data):
return {
"result": "OK",
"msg": "강퇴 성공"
"msg": "Kick success" # (원본: "강퇴 성공")
}
except Exception as e:
logger.error(f"request error. URL: /room/score/kick/participant\nerror message: {e}")
return {
"result": "FAIL",
"msg": "강퇴 실패"
"msg": "Kick failed" # (원본: "강퇴 실패")
}
@ -380,7 +380,7 @@ async def check_kick_user(user_seq, room_seq):
logger.error("user_seq is empty or invalid.")
return {
"result": "FAIL",
"msg": "user_seq is empty or invalid."
"msg": "user_seq is empty or invalid." # (원본: "user_seq is empty or invalid.")
}
ref = frd_db.reference("rooms").child(f"korea-{room_seq}").child("userList").child(user_seq)
@ -389,24 +389,24 @@ async def check_kick_user(user_seq, room_seq):
if user_info is None:
return {
"result": "FAIL",
"msg": "강퇴된 유저가 아님"
"msg": "Not a kicked user" # (원본: "강퇴된 유저가 아님")
}
if not user_info:
return {
"result": "OK",
"msg": "강퇴된 유저"
"msg": "Kicked user" # (원본: "강퇴된 유저")
}
else:
return {
"result": "FAIL",
"msg": "강퇴된 유저가 아님"
"msg": "Not a kicked user" # (원본: "강퇴된 유저가 아님")
}
except Exception as e:
logger.error(f"request error. URL: /room/score/check/kick/user\nerror message: {e}")
return {
"result": "FAIL",
"msg": "강퇴된 유저 확인 실패"
"msg": "Failed to check kicked user" # (원본: "강퇴된 유저 확인 실패")
}
@ -419,19 +419,18 @@ async def check_force_exit_yn(user_seq, data):
if ref.get() is True:
return {
"result": "OK",
"msg": "강제종료 된 유저",
"msg": "Force-exited user", # (원본: "강제종료 된 유저")
"room_seq": room_seq,
"room_type_name": room_type_name,
"room_title": room_title
}
return {
"result": "FAIL",
"msg": "강제종료 된 유저가 아님"
"msg": "Not a force-exited user" # (원본: "강제종료 된 유저가 아님")
}
except Exception as e:
logger.error(f"request error. URL: /room/score/check/force/exit/yn\nerror message: {e}")
return {
"result": "FAIL",
"msg": "업데이트 실패"
"msg": "Update failed" # (원본: "업데이트 실패")
}

View File

@ -17,25 +17,27 @@ async def ok_res(auth_token, data, db):
except Exception as e:
logger.error(f"ok response error: {e}")
return make_response('ERROR', 'N', 'NOMAL', '', 0, '응답 에러', '서버 장애가 발생했습니다.', data)
return make_response('ERROR', 'N', 'NOMAL', '', 0, 'Response Error', 'A server error has occurred.', data)
# 실패 응답
async def fail_res(auth_token, auth_type, msg_title, msg_content, data):
try:
# logger.error(f"response fail => msg_title: {msg_title}, msg_content: {msg_content}")
return make_response('FAIL', auth_token['renew_yn'], auth_type, auth_token['token'], auth_token['user_seq'], msg_title, msg_content, data)
except Exception as e:
logger.error(f"ok response error: {e}")
return make_response('ERROR', 'N', 'NOMAL', '', 0, '응답 에러', '서버 장애가 발생했습니다.', data)
return make_response('ERROR', 'N', 'NOMAL', '', 0, 'Response Error', 'A server error has occurred.', data)
# 에러 응답
async def error_res(auth_token, auth_type, msg_title, msg_content, data):
try:
# logger.error(f"response error => msg_title: {msg_title}, msg_content: {msg_content}")
return make_response('ERROR', auth_token['renew_yn'], auth_type, auth_token['token'], auth_token['user_seq'], msg_title, msg_content, data)
except Exception as e:
logger.error(f"ok response error: {e}")
return make_response('ERROR', 'N', 'NOMAL', '', 0, '응답 에러', '서버 장애가 발생했습니다.', data)
return make_response('ERROR', 'N', 'NOMAL', '', 0, 'Response Error', 'A server error has occurred.', data)

View File

@ -6,67 +6,59 @@ from process.logger import logger
import re
# 회원가입 입력항목 확인
# Check membership sign-up input fields # 회원가입 입력항목 확인
async def verify_create_room_data(data, db):
# room_type 체크
# Check room_type # room_type 체크
verify_room_type_result = await crud_room_score.verify_room_type(room_type=data['room_type'], db=db)
if verify_room_type_result[0][0] != 1:
return 'room_type이 정확하지 않습니다.'
return 'room_type is incorrect.' # room_type이 정확하지 않습니다.
# team전일 경우 팀수도 입력됐는지 체크
# Check if the number of teams is also entered for team match # team전일 경우 팀수도 입력됐는지 체크
if data['room_type'] == 'team':
if not 'number_of_teams' in data:
return '팀전일 경우 팀수를 입력해야 합니다.'
return 'You must enter the number of teams if it is a team match.' # 팀전일 경우 팀수를 입력해야 합니다.
if not is_non_negative_integer(data['number_of_teams']):
return '팀수는 정수이어야 하며, 1이상의 정수값만 가능합니다.'
return 'The number of teams must be an integer, and only values greater than or equal to 1 are allowed.' # 팀수는 정수이어야 하며, 1이상의 정수값만 가능합니다.
# room_title 체크
# Check room_title # room_title 체크
if not (0 < len(data['room_title']) and len(data['room_title']) < 100):
return '방 제목을 확인해주세요.'
return 'Please check the room title.' # 방 제목을 확인해주세요.
# room_intro 체크
# Check room_intro # room_intro 체크
if not (0 < len(data['room_intro']) and len(data['room_intro']) < 1000):
return '방 소개를 확인해주세요.'
return 'Please check the room introduction.' # 방 소개를 확인해주세요.
# open_yn 체크
# Check open_yn # open_yn 체크
if not (data['open_yn'] == 'Y' or data['open_yn'] == 'N'):
return '방 공개 여부를 확인해주세요.'
return 'Please check if the room is open.' # 방 공개 여부를 확인해주세요.
# room_pw 체크
# Check room_pw # room_pw 체크
if data['open_yn'] == 'Y':
if not data['room_pw'] == '':
return '공개 방입니다. 방 비밀번호를 확인해주세요.'
return 'This is a public room. Please check the room password.' # 공개 방입니다. 방 비밀번호를 확인해주세요.
if data['open_yn'] == 'N':
if not (0 < len(data['room_pw']) and len(data['room_pw']) < 100):
return '방 비밀번호를 확인해주세요.'
return 'Please check the room password.' # 방 비밀번호를 확인해주세요.
# running_time 체크
# Check running_time # running_time 체크
if not is_non_negative_integer(data['running_time']):
return '운영시간을 확인해주세요.'
return 'Please check the running time.' # 운영시간을 확인해주세요.
# room_status 체크
# Check room_status # room_status 체크
verify_room_status_result = await crud_room_score.verify_room_status(room_status=data['room_status'], db=db)
if verify_room_status_result[0][0] != 1:
return 'room_status가 정확하지 않습니다.'
return 'room_status is incorrect.' # room_status가 정확하지 않습니다.
# 이상 없으면 NONE리턴
# If there is no error, return None # 이상 없으면 NONE리턴
return None
def is_non_negative_integer(value):
try:
# 정수로 변환 시도
# Attempt converting to an integer # 정수로 변환 시도
num = int(value)
# 0 이상인지 확인
# Check if it's greater than or equal to 0 # 0 이상인지 확인
return num > 0
except (ValueError, TypeError):
return False

View File

@ -10,27 +10,27 @@ import re
def check_mandatory_insert_list(user_info):
# user_id 확인
if not validate_user_id(user_id=user_info['user_id']):
return '아이디 규칙이 맞지 않습니다.'
return 'The user ID rule is incorrect.' # (원본: "아이디 규칙이 맞지 않습니다.")
# user_pw 확인
if not validate_user_pw(user_pw=user_info['user_pw']):
return '비밀번호 암호화가 되지 않았습니다.'
return 'Password is not encrypted.' # (원본: "비밀번호 암호화가 되지 않았습니다.")
# nickname 확인
if not validate_nickname(nickname=user_info['nickname']):
return '사용자 닉네임 규칙이 맞지 않습니다.'
return 'Nickname rule is incorrect.' # (원본: "사용자 닉네임 규칙이 맞지 않습니다.")
# user_email 확인
if not validate_user_email(user_email=user_info['user_email']):
return '이메일 규칙이 맞지 않습니다.'
return 'The email rule is incorrect.' # (원본: "이메일 규칙이 맞지 않습니다.")
# introduce_myself 확인
if len(user_info['introduce_myself']) > 2000:
return '자기소개 글은 2000byte까지만 입력 가능합니다.'
return 'Self-introduction can only be up to 2000 bytes.' # (원본: "자기소개 글은 2000byte까지만 입력 가능합니다.")
# mandatory_terms 확인
if user_info['mandatory_terms_yn'] != 'Y':
return '필수약관항목에 대해 동의 하지 않았습니다.'
return 'You have not agreed to the mandatory terms.' # (원본: "필수약관항목에 대해 동의 하지 않았습니다.")
# 이상없음
return None
@ -41,45 +41,45 @@ def check_new_data(user_info):
# user_pw 확인
if user_info['user_pw_change_yn'] == 'Y':
if not validate_user_pw(user_pw=user_info['user_pw']):
return '비밀번호 암호화가 되지 않았습니다.'
return 'Password is not encrypted.' # (원본: "비밀번호 암호화가 되지 않았습니다.")
# nickname 확인
if not validate_nickname(nickname=user_info['nickname']):
return '사용자 닉네임 규칙이 맞지 않습니다.'
return 'Nickname rule is incorrect.' # (원본: "사용자 닉네임 규칙이 맞지 않습니다.")
# user_email 확인
if not validate_user_email(user_email=user_info['user_email']):
return '이메일 규칙이 맞지 않습니다.'
return 'The email rule is incorrect.' # (원본: "이메일 규칙이 맞지 않습니다.")
# profile_img 확인
if not starts_with_user_dir(user_info['profile_img']):
return '프로필 이미지 경로가 정확하지 않습니다.'
return 'The profile image path is incorrect.' # (원본: "프로필 이미지 경로가 정확하지 않습니다.")
# introduce_myself 확인
if len(user_info['introduce_myself']) > 2000:
return '자기소개 글은 2000byte까지만 입력 가능합니다.'
return 'Self-introduction can only be up to 2000 bytes.' # (원본: "자기소개 글은 2000byte까지만 입력 가능합니다.")
# 이상없음
return None
# 회원정보 수정 입력값 검증
# 회원정보 수정 입력값 검증 (소셜로그인)
def check_new_data_for_oauth(user_info):
# oauth 계정이 비밀번호 변경요청은 허용하지 않음
if user_info['user_pw_change_yn'] == 'Y':
return '소셜로그인 계정은 비밀번호 변경을 허용하지 않습니다.'
return 'Social login accounts do not allow password changes.' # (원본: "소셜로그인 계정은 비밀번호 변경을 허용하지 않습니다.")
# nickname 확인
if not validate_nickname(nickname=user_info['nickname']):
return '사용자 닉네임 규칙이 맞지 않습니다.'
return 'Nickname rule is incorrect.' # (원본: "사용자 닉네임 규칙이 맞지 않습니다.")
# profile_img 확인
if not starts_with_user_dir(user_info['profile_img']):
return '프로필 이미지 경로가 정확하지 않습니다.'
return 'The profile image path is incorrect.' # (원본: "프로필 이미지 경로가 정확하지 않습니다.")
# introduce_myself 확인
if len(user_info['introduce_myself']) > 2000:
return '자기소개 글은 2000byte까지만 입력 가능합니다.'
return 'Self-introduction can only be up to 2000 bytes.' # (원본: "자기소개 글은 2000byte까지만 입력 가능합니다.")
# 이상없음
return None
@ -137,26 +137,3 @@ def starts_with_user_dir(value: str) -> bool:
prefix = '/user/temp_dir/profile_img/'
return value.startswith(prefix)

View File

@ -51,12 +51,14 @@ async def request_inquiry(request: Request, body: bytes = Depends(get_body), db:
elif auth_token['result'] == 'TOKEN_EXPIRED':
raise token_expired_return_process(auth_token['msg'])
else:
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='토큰 에러', msg_content='토큰 정보가 정확하지 않습니다.', data={})
# return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='사용자 인증 에러', msg_content='사용자 인증 정보가 정확하지 않습니다. 관리자에게 문의해주세요.', data={})
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='User Authentication Error', msg_content='User authentication information is incorrect. Please contact the administrator.', data={})
# body에서 ID 추출
try:
body = json.loads(body)
except json.JSONDecodeError as e:
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
# return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='Data Error', msg_content='Data processing error occurred. Please check if the requested information is entered correctly.', data={})
user_seq_result = cert_process.get_user_seq_by_token(token=auth_token['token'])
if user_seq_result["result"] == 'OK':
@ -72,7 +74,8 @@ async def request_inquiry(request: Request, body: bytes = Depends(get_body), db:
else:
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='문의 저장 실패', msg_content='문의 저장 처리중 에러가 발생했습니다.', data={})
else:
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='토큰 에러', msg_content='토큰 정보가 정확하지 않습니다.', data={})
# return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='사용자 인증 에러', msg_content='사용자 인증 정보가 정확하지 않습니다. 관리자에게 문의해주세요.', data={})
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='User Authentication Error', msg_content='User authentication information is incorrect. Please contact the administrator.', data={})
except Exception as e:
logger.error(f"request error. URL: /room/score/create/room\nerror message: {e}")

View File

@ -62,7 +62,8 @@ async def google_login(request: Request, body: bytes = Depends(get_body), db: Se
try:
body = json.loads(body)
except json.JSONDecodeError as e:
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
# return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='Data Error', msg_content='Data processing error occurred. Please check if the requested information is entered correctly.', data={})
# 2) request body 파싱
id_token_str = body.get('id_token', None)
@ -115,7 +116,8 @@ async def google_signup(request: Request, body: bytes = Depends(get_body), db: S
try:
body = json.loads(body)
except json.JSONDecodeError as e:
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
# return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='Data Error', msg_content='Data processing error occurred. Please check if the requested information is entered correctly.', data={})
id_token_str = body.get('id_token', None)
@ -169,7 +171,8 @@ async def login(request: Request, body: bytes = Depends(get_body), db: Session =
try:
body = json.loads(body)
except json.JSONDecodeError as e:
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
# return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='Data Error', msg_content='Data processing error occurred. Please check if the requested information is entered correctly.', data={})
user_id = body['user_id']
user_pw = body['user_pw']
@ -212,7 +215,8 @@ async def find_id(request: Request, body: bytes = Depends(get_body), db: Session
try:
body = json.loads(body)
except json.JSONDecodeError as e:
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
# return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='Data Error', msg_content='Data processing error occurred. Please check if the requested information is entered correctly.', data={})
nickname = body['nickname']
user_email = body['user_email']
@ -265,7 +269,8 @@ async def find_receive_by_eamil(request: Request, body: bytes = Depends(get_body
try:
body = json.loads(body)
except json.JSONDecodeError as e:
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
# return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='Data Error', msg_content='Data processing error occurred. Please check if the requested information is entered correctly.', data={})
auth = body['auth']
auth_data = cert_process.decode_jwt(auth)
@ -278,7 +283,8 @@ async def find_receive_by_eamil(request: Request, body: bytes = Depends(get_body
if not(iat <= current_time and current_time <= exp):
return await response.fail_res(auth_token=auth_token, auth_type='NOMAL', msg_title='이메일 발송 실패', msg_content='토큰 유효기간이 만료되었습니다.', data={})
else:
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='토큰 에러', msg_content='토큰 정보가 정확하지 않습니다.', data={})
# return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='사용자 인증 에러', msg_content='사용자 인증 정보가 정확하지 않습니다. 관리자에게 문의해주세요.', data={})
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='User Authentication Error', msg_content='User authentication information is incorrect. Please contact the administrator.', data={})
# user_seq로 아이디 찾기 시도
find_id_result = await manage_user.find_id_by_user_seq(user_seq=user_seq, db=db)
@ -327,7 +333,8 @@ async def find_pw(request: Request, body: bytes = Depends(get_body), db: Session
try:
body = json.loads(body)
except json.JSONDecodeError as e:
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
# return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='Data Error', msg_content='Data processing error occurred. Please check if the requested information is entered correctly.', data={})
user_id = body['user_id']
user_email = body['user_email']
@ -388,7 +395,8 @@ async def signup(request: Request, body: bytes = Depends(get_body), db: Session
try:
body = json.loads(body)
except json.JSONDecodeError as e:
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
# return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='Data Error', msg_content='Data processing error occurred. Please check if the requested information is entered correctly.', data={})
logger.debug(f"body: {body}")
# user_id 유효성 검사
@ -435,13 +443,15 @@ async def update_profile_img(request: Request, body: str = Form(...), file: Uplo
elif auth_token['result'] == 'TOKEN_EXPIRED':
raise token_expired_return_process(auth_token['msg'])
else:
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='토큰 에러', msg_content='토큰 정보가 정확하지 않습니다.', data={})
# return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='사용자 인증 에러', msg_content='사용자 인증 정보가 정확하지 않습니다. 관리자에게 문의해주세요.', data={})
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='User Authentication Error', msg_content='User authentication information is incorrect. Please contact the administrator.', data={})
# body에서 ID 추출
try:
body = json.loads(body)
except json.JSONDecodeError as e:
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
# return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='Data Error', msg_content='Data processing error occurred. Please check if the requested information is entered correctly.', data={})
# 파일 읽기
content = await file.read()
@ -485,7 +495,8 @@ async def update_profile_img(request: Request, body: str = Form(...), file: Uplo
else:
return await response.fail_res(auth_token=auth_token, auth_type='NOMAL', msg_title='이미지 업로드 실패', msg_content='이미지 업로드에 실패했습니다.', data={})
else:
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='토큰 에러', msg_content='토큰 정보가 정확하지 않습니다.', data={})
# return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='사용자 인증 에러', msg_content='사용자 인증 정보가 정확하지 않습니다. 관리자에게 문의해주세요.', data={})
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='User Authentication Error', msg_content='User authentication information is incorrect. Please contact the administrator.', data={})
except Exception as e:
logger.error(f"request error. URL: /user/update/profile/img\nerror message: {e}")
@ -505,12 +516,14 @@ async def update_user_info(request: Request, body: bytes = Depends(get_body), db
elif auth_token['result'] == 'TOKEN_EXPIRED':
raise token_expired_return_process(auth_token['msg'])
else:
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='토큰 에러', msg_content='토큰 정보가 정확하지 않습니다.', data={})
# return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='사용자 인증 에러', msg_content='사용자 인증 정보가 정확하지 않습니다. 관리자에게 문의해주세요.', data={})
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='User Authentication Error', msg_content='User authentication information is incorrect. Please contact the administrator.', data={})
# body에서 ID 추출
try:
body = json.loads(body)
except json.JSONDecodeError as e:
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
# return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='Data Error', msg_content='Data processing error occurred. Please check if the requested information is entered correctly.', data={})
user_seq_result = cert_process.get_user_seq_by_token(token=auth_token['token'])
if user_seq_result["result"] == 'OK':
@ -542,12 +555,14 @@ async def update_user_info(request: Request, body: bytes = Depends(get_body), db
elif auth_token['result'] == 'TOKEN_EXPIRED':
raise token_expired_return_process(auth_token['msg'])
else:
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='토큰 에러', msg_content='토큰 정보가 정확하지 않습니다.', data={})
# return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='사용자 인증 에러', msg_content='사용자 인증 정보가 정확하지 않습니다. 관리자에게 문의해주세요.', data={})
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='User Authentication Error', msg_content='User authentication information is incorrect. Please contact the administrator.', data={})
# body에서 ID 추출
try:
body = json.loads(body)
except json.JSONDecodeError as e:
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
# return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='Data Error', msg_content='Data processing error occurred. Please check if the requested information is entered correctly.', data={})
user_seq_result = cert_process.get_user_seq_by_token(token=auth_token['token'])
if user_seq_result["result"] == 'OK':
@ -607,7 +622,8 @@ async def update_user_info(request: Request, body: bytes = Depends(get_body), db
return await response.fail_res(auth_token=auth_token, auth_type='NOMAL', msg_title='회원정보 변경 실패', msg_content='회원정보 변경 실패했습니다. 관리자에게 문의해주세요.', data={})
else:
logger.error(f"request error. URL: /user/update/user/info\nerror message: {e}")
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='토큰 에러', msg_content='토큰 정보가 정확하지 않습니다.', data={})
# return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='사용자 인증 에러', msg_content='사용자 인증 정보가 정확하지 않습니다. 관리자에게 문의해주세요.', data={})
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='User Authentication Error', msg_content='User authentication information is incorrect. Please contact the administrator.', data={})
@ -629,12 +645,14 @@ async def withdraw_user(request: Request, body: bytes = Depends(get_body), db: S
elif auth_token['result'] == 'TOKEN_EXPIRED':
raise token_expired_return_process(auth_token['msg'])
else:
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='토큰 에러', msg_content='토큰 정보가 정확하지 않습니다.', data={})
# return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='사용자 인증 에러', msg_content='사용자 인증 정보가 정확하지 않습니다. 관리자에게 문의해주세요.', data={})
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='User Authentication Error', msg_content='User authentication information is incorrect. Please contact the administrator.', data={})
# body에서 ID 추출
try:
body = json.loads(body)
except json.JSONDecodeError as e:
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
# return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='Data Error', msg_content='Data processing error occurred. Please check if the requested information is entered correctly.', data={})
user_pw = body['user_pw']
oauth_type = body['oauth_type']
@ -655,7 +673,8 @@ async def withdraw_user(request: Request, body: bytes = Depends(get_body), db: S
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='회원탈퇴 에러', msg_content='회원탈퇴 처리중 에러가 발생헀습니다. 관리자에게 문의해주세요.', data={})
else:
logger.error(f"request error. URL: /user/withdraw/user\nerror message: {e}")
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='토큰 에러', msg_content='토큰 정보가 정확하지 않습니다.', data={})
# return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='사용자 인증 에러', msg_content='사용자 인증 정보가 정확하지 않습니다. 관리자에게 문의해주세요.', data={})
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='User Authentication Error', msg_content='User authentication information is incorrect. Please contact the administrator.', data={})
except Exception as e:

File diff suppressed because it is too large Load Diff

View File

@ -51,12 +51,14 @@ async def collect_survey(request: Request, body: bytes = Depends(get_body), db:
elif auth_token['result'] == 'TOKEN_EXPIRED':
raise token_expired_return_process(auth_token['msg'])
else:
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='토큰 에러', msg_content='토큰 정보가 정확하지 않습니다.', data={})
# return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='사용자 인증 에러', msg_content='사용자 인증 정보가 정확하지 않습니다. 관리자에게 문의해주세요.', data={})
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='User Authentication Error', msg_content='User authentication information is incorrect. Please contact the administrator.', data={})
# body에서 ID 추출
try:
body = json.loads(body)
except json.JSONDecodeError as e:
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
# return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='데이터 에러', msg_content='데이터 처리 장애가 발생했습니다. 요청정보를 정확히 입력했는지 확인해주세요.', data={})
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='Data Error', msg_content='Data processing error occurred. Please check if the requested information is entered correctly.', data={})
user_seq_result = cert_process.get_user_seq_by_token(token=auth_token['token'])
if user_seq_result["result"] == 'OK':
@ -80,7 +82,8 @@ async def collect_survey(request: Request, body: bytes = Depends(get_body), db:
else:
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='설문조사 저장 실패', msg_content='설문조사 저장 처리중 에러가 발생했습니다.', data={})
else:
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='토큰 에러', msg_content='토큰 정보가 정확하지 않습니다.', data={})
# return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='사용자 인증 에러', msg_content='사용자 인증 정보가 정확하지 않습니다. 관리자에게 문의해주세요.', data={})
return await response.error_res(auth_token=auth_token, auth_type='NOMAL', msg_title='User Authentication Error', msg_content='User authentication information is incorrect. Please contact the administrator.', data={})
except Exception as e:
logger.error(f"request error. URL: /room/score/create/room\nerror message: {e}")