Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback #1

Open
wants to merge 36 commits into
base: feedback
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
8562a09
Setting up GitHub Classroom Feedback
github-classroom[bot] Jan 29, 2024
a92a1e9
Feat : Add gitignore
taeyang916 Mar 27, 2024
d65d8ac
Feat : version 1
taeyang916 Mar 27, 2024
d713efc
Feat : version 1
Mar 27, 2024
aadd572
Feat : version 1
jouhy Mar 27, 2024
cf2433c
Merge pull request #4 from boostcampaitech6/feat/web-frontend
taeyang916 Mar 27, 2024
a571787
Feat : version 1
Mar 27, 2024
e167a68
Merge pull request #5 from boostcampaitech6/feat/data
taeyang916 Mar 27, 2024
c4d8d96
Feat : Add data V1 OLKAVS refine function
carboxaminoo Mar 27, 2024
855ffb0
Feat : version 1
jouhy Mar 27, 2024
4d02e3a
Merge pull request #7 from boostcampaitech6/feat/data
taeyang916 Mar 27, 2024
643df33
Feat : First Commit
jouhy Mar 27, 2024
82c3a46
Update readme.md
dlatjgus0612 Mar 27, 2024
ada7a14
Update readme.md
dlatjgus0612 Mar 27, 2024
85dcd5b
Feat : modify readme
taeyang916 Mar 27, 2024
245dbb5
Update readme.md
dlatjgus0612 Mar 27, 2024
e94140a
Update readme.md
dlatjgus0612 Mar 27, 2024
2f1f396
Update README.md
taeyang916 Mar 27, 2024
2b9f388
Update readme.md
dlatjgus0612 Mar 27, 2024
f1f3b13
Update readme.md
taeyang916 Mar 28, 2024
12fabe7
[FEAT] Readme Code Merge (#9)
soyoonjeong Mar 28, 2024
7d46b61
Update readme.md
internationalwe Mar 28, 2024
5ea85c1
Modify : 팀원 역할
soyoonjeong Mar 28, 2024
006ea08
Update readme.md
internationalwe Mar 28, 2024
fdfcdbe
[Docs] Add Web-Frontend README code (#10)
carboxaminoo Mar 30, 2024
c99e344
Create README.md
dlatjgus0612 Mar 28, 2024
81f5f99
Docs : modify README
dlatjgus0612 Mar 28, 2024
e399ea0
Docs : Modify files & README
dlatjgus0612 Mar 28, 2024
32c1581
feat : modify readme
jouhy Mar 30, 2024
8cbf432
Docs : Modify member info
soyoonjeong Mar 30, 2024
2181597
[Docs] Add modeling README code (#11)
taeyang916 Mar 30, 2024
f4285e8
[Docs] Adding Links in frontend README (#13)
carboxaminoo Mar 30, 2024
df4ff90
Merge branch 'main' into feat/readme
taeyang916 Mar 30, 2024
7584354
Merge pull request #14 from boostcampaitech6/feat/readme
taeyang916 Mar 30, 2024
90f7869
Docs : Fix juhy's image
soyoonjeong Mar 30, 2024
95638f0
Update readme.md
dlatjgus0612 Mar 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 11 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
__pycache__

migrations

.env
.env.dev
.env.prod
data/
*.conf
.sh
certbot/
19 changes: 19 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM python:latest

RUN mkdir /backend
WORKDIR /backend

COPY . /backend/

RUN apt-get update && apt-get install -y ffmpeg
RUN pip install --upgrade pip
RUN pip install -r requirements.txt

# Set environment variables for ffmpeg and ffprobe
ENV FFMPEG_PATH /usr/bin/ffmpeg
ENV FFPROBE_PATH /usr/bin/ffprobe

# for error message
ENV PYTHONUNBUFFERED 1

# CMD ["flask", "run", "--host=0.0.0.0", "--port=5001"]
245 changes: 245 additions & 0 deletions backend/apis_v1/MzRequest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
from flask import Response
import json
from module import crud_module
from flask_restx import Resource, Namespace
from werkzeug.datastructures import FileStorage

####################################생성 전 정보#######################################

MzRequest = Namespace(
name="MzRequest",
description="MzRequest CRUD를 작성하기 위해 사용하는 API.",
)

common_parser = MzRequest.parser()
common_parser.add_argument('token', location='headers')

post_parser = common_parser.copy()
post_parser.add_argument('age', location='form', required=False)
post_parser.add_argument('gender', location='form', required=False)
post_parser.add_argument('file', type=FileStorage, location='files', required=False)
# celery 받는거, post&get설정, crud_module에 함수 추가, db_module에 함수 추가

@MzRequest.route('', methods=['POST', 'GET'])
@MzRequest.doc(responses={200: 'Success'})
@MzRequest.doc(responses={404: 'Failed'})
class MzRequestClass(Resource):

@MzRequest.expect(post_parser)
def post(self):
"""
# mz 요청 정보 저장
# @header : token
# @return : {id: "id"}
"""
try:
result, message = crud_module.upload_mz_request()
return Response(
response = json.dumps(message),
status = result,
mimetype = "application/json"
)
except Exception as ex:
print("******************")
print(ex)
print("******************")

@MzRequest.expect(common_parser)
def get(self):
"""
# mz 요청 정보 리스트 가져오기
# @header : token
# @return : {"mz_request_list": result_list}
"""
try:
result, message = crud_module.get_mz_request_list()
return Response(
response = json.dumps(message),
status = result,
mimetype = "application/json"
)
except Exception as ex:
print("******************")
print(ex)
print("******************")

@MzRequest.route('/<int:mzRequestId>', methods=['GET'])
@MzRequest.doc(responses={200: 'Success'})
@MzRequest.doc(responses={404: 'Failed'})
class MzRequestClass(Resource):

@MzRequest.expect(common_parser)
def get(self, mzRequestId):
"""
# mz 요청 정보 가져오기
# @header : token
# @return : {"mz_request": result_data}
"""
try:
result, message = crud_module.get_mz_request(mzRequestId)
return Response(
response = json.dumps(message),
status = result,
mimetype = "application/json"
)
except Exception as ex:
print("******************")
print(ex)
print("******************")


@MzRequest.route('/<int:mzRequestId>/status/<taskId>')
@MzRequest.doc(responses={200: 'Success'})
@MzRequest.doc(responses={404: 'Failed'})
class MzRequestClass(Resource):

@MzRequest.expect(common_parser)
def get(self, mzRequestId, taskId):
"""
# celery 상태값 가져오기
# @header : token
# @return : {"mz_request": result_data}
"""
try:
result, message = crud_module.get_celery_task_status(mzRequestId, taskId)
return Response(
response = json.dumps(message),
status = result,
mimetype = "application/json"
)
except Exception as ex:
print("******************")
print(ex)
print("******************")

@MzRequest.route('/<int:mzRequestId>/result/<taskId>')
@MzRequest.doc(responses={200: 'Success'})
@MzRequest.doc(responses={404: 'Failed'})
class MzRequestClass(Resource):

@MzRequest.expect(common_parser)
def get(self, mzRequestId, taskId):
"""
# celery 결과값 가져오기
# @header : token
# @return : {"mz_request": result_data}
"""
try:
result, message = crud_module.get_celery_result_done(mzRequestId, taskId)
return Response(
response = json.dumps(message),
status = result,
mimetype = "application/json"
)
except Exception as ex:
print("******************")
print(ex)
print("******************")

####################################생성된 결과#######################################

patch_parser = common_parser.copy()
patch_parser.add_argument('type', location='form', required=False)
patch_parser.add_argument('rating', location='form', required=False)
# parser.add_argument('file', type=FileStorage, location='files', required=False)

survey_parser = common_parser.copy()
survey_parser.add_argument('user_phone', location='form', required=False)
survey_parser.add_argument('sns_time', location='form', required=False)
survey_parser.add_argument('image_rating_reason', location='form', required=False)
survey_parser.add_argument('voice_to_face_rating', location='form', required=False)
survey_parser.add_argument('dissatisfy_reason', location='form', required=False)
survey_parser.add_argument('additional_function', location='form', required=False)
survey_parser.add_argument('face_to_gif_rating', location='form', required=False)
survey_parser.add_argument('more_gif', location='form', required=False)
survey_parser.add_argument('more_gif_type', location='form', required=False)
survey_parser.add_argument('waiting', location='form', required=False)
survey_parser.add_argument('waiting_improvement', location='form', required=False)
survey_parser.add_argument('recommend', location='form', required=False)
survey_parser.add_argument('opinion', location='form', required=False)

@MzRequest.route('/<int:mzRequestId>/mz-result', methods=['POST'])
@MzRequest.doc(responses={200: 'Success'})
@MzRequest.doc(responses={404: 'Failed'})
class MzResultClass(Resource):

@MzRequest.expect(common_parser)
def post(self, mzRequestId):
"""
# mz 결과 재생성
# @header : token
# @return : {id: "id"}
"""
try:
result, message = crud_module.regenerate_mz_result(mzRequestId)
return Response(
response = json.dumps(message),
status = result,
mimetype = "application/json"
)
except Exception as ex:
print("******************")
print(ex)
print("******************")

@MzRequest.route('/<int:mzRequestId>/mz-result/<int:mzResultId>', methods=['GET', 'POST', 'PATCH'])
@MzRequest.doc(responses={200: 'Success'})
@MzRequest.doc(responses={404: 'Failed'})
class MzResultClass(Resource):

@MzRequest.expect(common_parser)
def get(self, mzRequestId, mzResultId):
"""
# mz 결과 정보 가져오기
# @header : token
# @return : {"mz_result": result_data}
"""
try:
result, message = crud_module.get_mz_result(mzRequestId, mzResultId)
return Response(
response = json.dumps(message),
status = result,
mimetype = "application/json"
)
except Exception as ex:
print("******************")
print(ex)
print("******************")

@MzRequest.expect(survey_parser)
def post(self, mzRequestId, mzResultId):
"""
# mz 설문조사 결과 정보 저장하기
# @header : token
# @return : {"mz_result_id": "id", "mz_survey_id": "id"}
"""
try:
result, message = crud_module.upload_mz_survey(mzRequestId, mzResultId)
return Response(
response = json.dumps(message),
status = result,
mimetype = "application/json"
)
except Exception as ex:
print("******************")
print(ex)
print("******************")

@MzRequest.expect(patch_parser)
def patch(self, mzRequestId, mzResultId):
"""
# mz 결과 별점 수정
# @header : token
# @return : {"message": "rating updated successfully"}
"""
try:
result, message = crud_module.update_mz_result_rating(mzRequestId, mzResultId)
return Response(
response = json.dumps(message),
status = result,
mimetype = "application/json"
)
except Exception as ex:
print("******************")
print(ex)
print("******************")
Loading