manito42 / backend Goto Github PK
View Code? Open in Web Editor NEW42 Manito Backend Repository
Home Page: https://42manito.com
42 Manito Backend Repository
Home Page: https://42manito.com
Description
Todo
VPC에 Manito vpc있던데, 따로 VPC생성해서 하나요?
@JuneParkCode
/search/mentor/{search_string}을 검색하게 되면 여기서
search_by_user_nickname, search_by_hashtag_name 이 있는데 이걸 제가 hashtag인지 nickname 검색인지 알 수 있는 방법은 있지만 여러 콜을 하고 판정하는데 비용이 생각보다 발생할 것 같습니다!
그래서 이걸 search/mentor/{search_string}일때 search_string으로 nickname, hashtag 에 해당하는 개체를 받을 수 있는지 궁금합니다 ㅎㅎ
/user/id/reservations
경로를 앞으로 .
라고 하겠습니다..
./requests
./in_progress
or ./active
./done
.
에서 모두 제공name: AWS S3 Upload and CodeBuild
on:
push:
branches:
- develop
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2
- name: Install dependencies and build
uses: actions/setup-node@v3
with:
node-version: 18.16.1
- run: npm install
- run: npm run build
- name: Deploy to AWS CodeDeploy
run: |
# Use AWS CLI or SDK to deploy to CodeDeploy
# Update the commands to suit your deployment process
Describe the bug
backend/src/database/repository/reservation.repository.ts
Lines 218 to 271 in 9fec13a
To Reproduce
Expected behavior
Additional context
현재는 만약 존재하는 hashtag면 409 already exists를 주고 있습니다!
여기서 필요하다고 생각되는 부분은 409보다는 200으로 있는 개체를 주시면 편할 것 같습니다!
{
"id": 0,
"name": "string"
}
/reservations
에서 POST, PATCH 관련 요청은 ADMIN
에 한하여 사용할 수 있도록 제한할 것입니다./reservations
에서 수행할 수 있는 요청이나, 사용자 측에서의 요청을 세분화하고 정확하게 수행하는데 목적이 있습니다.POST /reservations
REQUEST
, ACCEPT
상태의 예약을 찾아봅니다.REQUEST
가 됩니다.PATCH /reservations/{id}/cancel
REQUEST
상태의 예약을 취소합니다.REQUEST
상황에서 멘티, 멘토 모두 신청할 수 있습니다.CANCEL
이 됩니다.PATCH /reservations/{id}/accept
REQUEST
상태의 예약에 대해서 멘토가 확정을 합니다.REQUEST
상태에서만 이루어질 수 있습니다.ACCEPT
상태가 됩니다.PATCH /reservations/{id}/mentor_completion
ACCEPT
입니다.Feedback
을 작성해야하며, 이 관련 내용이 해당 요청의 body 에 포함됩니다.PENDING
상태가 됩니다.PATCH /reservations/{id}/mentee_completion
PENDING
입니다.Feedback
을 작성해야하며, 이 관련 내용이 해당 요청의 body 에 포함됩니다.COMPLETE
가 됩니다.ssh forwarding set in config
how to access private subnet instances
ForwardAgent yes
설정.프로젝트 신규 투입 인원을 위한 prisma 안내 wiki 작성
현재 reservation을 Post를 하면 나오는 개체를 결국 나중에 상태를 업데이트하는것 까지는 알겠는데... 음,,,
Enroll을 가져와야하는 상황에서 저에게 reservation의 id들을 가지고 있지 않아서..?
User에 해당하는 reservation들을 가져올 수 없는 상황입니다!
지금 GetAll 같은경우는 현재 ADMIN만 가능하고,,, 음... 어떻게 해야할지 모르겠습니다 ...하하하
User에 해당하는 reservation 정보는 REQUEST와 ACCEPT, PENDING 인데 이걸 Uid로 검색하면 reservation[]로 받을 수 있는 라우팅이 따로 있을까요? 아니면 새로 만들어야하는 상황인가요?
스웨거에 나와있는 자료로 DTO를 만들어보면
interface UserDefaultDto {
id: number;
email: string;
nickname: string;
profileImage: string;
isMentor: boolean;
role: string; // default: 'USER'
createdAt: string;
updatedAt: string;
mentorProfile: {
id: number;
shortDescription: string;
description: string;
isHide: boolean;
mentoringCount: number;
createdAt: string;
updatedAt: string;
hashtags: HashtagResponseDto[];
categories: CategoriesResponseDto[];
};
}
이렇게 나와야하는데 지금 Response를 보면
{
"id": 1,
"email": "[email protected]",
"nickname": "Rachel Huel",
"profileImage": "https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/961.jpg",
"role": false,
"creataAt": "2007-01-04T02:32:12.350Z",
"updateAt": "2091-10-15T15:48:50.850Z",
"objectId": "1",
"mettorProfile": [
{
"id": 87,
"shortDescription": "Dolore corporis aperiam magnam eaque doloribus. Modi animi animi. Eligendi nam modi facilis voluptatum. Eaque exercitationem fugiat et illum quasi quidem autem vel maiores. Veniam est illo numquam accusamus fugiat eaque quibusdam sed ea. Fuga in blanditiis.",
"description": "eveniet",
"creatAt": "2018-12-02T01:52:19.178Z",
"updateAt": "2087-03-12T16:20:23.735Z",
"objId": "1",
"userId": "1"
}
]
}
이렇게 주는데 조금 많이 다르기도하고, 그리고 mentorProfile이여야하는데 mettorProfile로 오타도 있습니다! ㅎㅎㅎ
Description
Todo
Description
https://github.com/orgs/manito42/discussions/133#discussion-5638282 에서 언급된 API수정사항입니다.
Todo
etc
{
"id": 0,
"mentorId": 0,
"menteeId": 0,
"categoryId": 0,
"requestMessage": "string",
"status": "REQUESTED",
"createdAt": "2023-07-06T08:03:03.773Z",
"updatedAt": "2023-07-06T08:03:03.773Z",
"hashtags": [
{
"id": 0,
"name": "string"
}
]
}
현재 받는 DTO 인거 같은데 일단 배열로 받는다는건 알겠지만,
Enroll Page 구성중에 Mentor state, Mentee state를 작업하려고 하는 중에
URL/reservation/을 하면 Mentor, Mentee 개체를 주거나,
URL/reservation/mentor, URL/reservation/mentee 같은게 필요할 것 같습니다!
만약에 받더라도 status가 "ACCEPT", "REQUEST"만 받을 수 있게 하면 될 것 같습니다!
그리고 CANCEL에 대한 API, REQUEST API, ACCEPT API 가 필요할 것 같습니다!
#AWS SES
현재 코드는 거의 모든 API 에서 무제한 접근이 가능합니다.
JWT Token 인증 후 접근해야하는 API 선정이 필요합니다.
backend/src/database/repository/reservation.repository.ts
Lines 241 to 259 in 251ad44
Line 251
프론트쪽 개발을 하다보니.. Pagination 을 하는데 현재 API 응답 방식에 문제가 있다는 걸 알게됐습니다.
take / page 를 통해서 백엔드에서는 알아서 response 를 해주고 있는데요.
응답을 받는 입장에서는 총 몇 페이지가 있는지 알 수가 없습니다.
그래서
< 1 2 3 4 5 >
이런 형태로 구현하는게 애매하더라구요.
다른 사이트의 response 를 살펴보니
content : {
...
}
page : {
requestSize : 20,
requestPage : 2,
totalPage : 3,
currentPage : 2,
isLast: false
}
이런 식으로 response 가 오더라구요.
home 의 경우에는 무한스크롤로 해결할 수 있었으나, 예약 정보를 모아두는 페이지에서는 pagination 이 필요해보입니다.
(home 에서도 페이지로 할 수 있으면 좋을 것 같기도 하구요..)
전체적으로 적용을 해봐야할지... 아니면 일부분 ( Reservation 관련 부분) 만 적용을 해야할지 한번 이야기를 해봐야할 것 같습니다.
Description
https://github.com/orgs/manito42/discussions/133#discussion-5638282 에서 언급된 API수정사항입니다.
Todo
dto의 minlength 0으로 변경.
제가 알기론, database에서 NULL의 사용을 지양해야하는 이유가, 값이 상태가 애매모호 하기때문으로 알고 있습니다.
저희의 경우에는 NULL이 초기상태인지/사용자가 입력 빈 상태를 원하는건지/NULL과 ""의 의미 차이가 모호하기 때문인 것 같습니다.
scheme의 default value를 ''로 변경.
TEXT에 default value할당불가
Error: P3018
A migration failed to apply. New migrations cannot be applied before the error is recovered from. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve
Migration name: 20230917160953_feature_change_profile_description_95
Database error code: 1101
Database error:
BLOB, TEXT, GEOMETRY or JSON column 'description' can't have a default value
Please check the query number 1 from the migration file.
https://stackoverflow.com/questions/3466872/why-cant-a-text-column-have-a-default-value-in-mysql
현재는 다중 프로필을 고려하여 1:n 구조를 가지고 있음. 이를 1:1 구조를 가지도록 변경하고 mentor profile 을 user 의 정규화된 데이터 테이블로 이용하도록 함.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.