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

Feat: 메인 식물 리스트 조회 API #40

Merged
merged 10 commits into from
Dec 17, 2023
Merged

Conversation

seohyun-106
Copy link
Member

@seohyun-106 seohyun-106 commented Nov 4, 2023

📚 PR 요약 / Linked Issue

메인 식물 리스트 조회 API입니다
close #32

💡 변경 사항

  • 랜덤 description을 반환하는 함수가 추가되었습니다

✅ PR check list

  • 커밋 컨벤션, 제목 등을 확인했나요?
  • 알맞은 라벨을 달았나요?
  • 셀프 코드리뷰를 작성했나요?

@seohyun-106 seohyun-106 requested a review from jokj624 November 4, 2023 11:12
@seohyun-106 seohyun-106 self-assigned this Nov 4, 2023
@jokj624 jokj624 linked an issue Nov 4, 2023 that may be closed by this pull request
1 task
loveGauge: number;

// @ApiProperty({description: DTO_RESPONSE_DESCRIPTION.PLANTS.IS_WATERED})
// isWatered: boolean;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오늘 물을 줬는지 체크하는 isWatered가 DB에서 빠져있어서 우선 주석처리해두었습니다. 추후 수정하겠습니다

@ApiOperation(READ_PLANTS.API_OPERATION)
@ApiOkResponse( {type: ResponseUserPlantsDto})
async getUserPlants(): Promise<ResponseUserPlantsDto> {
const data = await this.plantsService.getUserPlants(1);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auth 관련 세팅 전이라 userId 임의로 하드코딩해두었습니다. 추후 수정하겠습니다

Copy link
Member Author

@seohyun-106 seohyun-106 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

일단 끝 ..

Copy link
Member

@jokj624 jokj624 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prettier 한번 돌려주세요 .. ✨

src/plants/plants.controller.ts Outdated Show resolved Hide resolved
@ApiOperation(READ_PLANTS.API_OPERATION)
@ApiOkResponse( {type: ResponseUserPlantsDto})
async getUserPlants(): Promise<ResponseUserPlantsDto> {
const data = await this.plantsService.getUserPlants(1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

전에 같이 논의했던
유저의 메인 식물 리스트 조회를/plants 가 아니라 /users/userId/plants 로 가는 방향 @junjuning 랑도 한번 논의해보면 좋을 것 같아요.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -177,4 +178,84 @@ export class PlantsService {

return { reviews: result };
}

async getUserPlants(userId: number): Promise<ResponseUserPlantsData> {
const userPlants = await this.prisma.userPlant.findMany({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ㅋㅋㅋ ㅠㅠ repository 파일 빼는게 가독성이 10394배는 늘거 같아요 ㅇㅈ?
이건 제가 한번에 다 repository 파일로 빼는 작업 할게요..

src/plants/plants.service.ts Outdated Show resolved Hide resolved
@seohyun-106 seohyun-106 merged commit 3cc8379 into feature/34 Dec 17, 2023
@seohyun-106 seohyun-106 deleted the feature/32 branch December 17, 2023 11:13
seohyun-106 added a commit that referenced this pull request Dec 17, 2023
* Feat: 식물 카드 상세 조회 API (#33)

* Docs: update PR template (add swagger)

* Refactor: file name kebab-case 적용

* Feat: plant util 함수

* Feat: plant 상세 조회 API

* Docs: update PR template (add checklist)

* Feat: plant 상세 조회 service 로직 unit test

* Feat: plant 상세 조회 controller unit test

* Fix: plants service 로직 time mocking

* Feat: env test 환경 설정

* Feat: e2e test 격리된 docker 환경 구축

* Feat: plants e2e test

* Feat: 식물 카드 수정 api (#39)

* Feat: 식물 카드 수정 api

* Feat: 식물 카드 수정 api 상수 파일

* Feat: global exception 에 prisma 에러 처리 추가

* Feat: 식물 카드 수정 테스트 코드

* Feat: 메인 식물 리스트 조회 API (#40)

* Feat: 메인 식물 리스트 조회 응닶값 세팅

* Update issue templates

* Feat: 메인 화면 랜덤 description 함수 추가

* Chore: Gauge로 통일

* Feat: 메인 식물 리스트 전체 조회 API

* Chore: getUserPlants로 함수 이름 변경

* Chore: class 대문자로 변경

* Chore: 프리티어 적용

---------

Co-authored-by: 장서현 <[email protected]>

---------

Co-authored-by: Chae Jeong Ah <[email protected]>
Co-authored-by: 장서현 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

메인 식물 전체 리스트 조회 API
2 participants