Skip to content

Commit

Permalink
사용자 아바타 사진의 경우 고화질의 카카오톡 프로필 사진을 사용하도록 변경, k8s 스케일 업 (#31)
Browse files Browse the repository at this point in the history
* formatter: 코드 인덴트

* up: 고화질의 프로필 사진을 저장할 수 있도록 저장하는 url 변경

* up: 고화질의 이미지 처리시 느려지는 현상을 파악하여 스케일 업

* up: api spec

* up: 프로그램 버전 업
  • Loading branch information
parkgang committed Dec 16, 2021
1 parent e4d8d7f commit 74b5578
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/aks-qa-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ jobs:
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_MESSAGE: ${{ github.repository }}가 ${{ env.NAMESPACE }} 환경에 배포되었습니다 🚀
SLACK_MESSAGE: ${{ github.repository }}가 ${{ env.NAMESPACE }} 환경에 배포되었습니다 🚀
2 changes: 1 addition & 1 deletion .github/workflows/aks-test-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ jobs:
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_MESSAGE: ${{ github.repository }}가 ${{ env.NAMESPACE }} 환경에 배포되었습니다 🚀
SLACK_MESSAGE: ${{ github.repository }}가 ${{ env.NAMESPACE }} 환경에 배포되었습니다 🚀
6 changes: 5 additions & 1 deletion docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,12 @@ var doc = `{
"nickName": {
"type": "string"
},
"profileImageUrl": {
"description": "카카오톡에 실제로 저장된 프로필 사진 (고화질), 이미지의 url을 저장하기 위한 최대 크기로 잡아놓았습니다.",
"type": "string"
},
"thumbnailImageUrl": {
"description": "이미지의 url을 저장하기 위한 최대 크기로 잡아놓았습니다.",
"description": "카카오톡에 저장된 프로필 사진 미리보기 (저화질), 이미지의 url을 저장하기 위한 최대 크기로 잡아놓았습니다.",
"type": "string"
}
}
Expand Down
6 changes: 5 additions & 1 deletion docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -603,8 +603,12 @@
"nickName": {
"type": "string"
},
"profileImageUrl": {
"description": "카카오톡에 실제로 저장된 프로필 사진 (고화질), 이미지의 url을 저장하기 위한 최대 크기로 잡아놓았습니다.",
"type": "string"
},
"thumbnailImageUrl": {
"description": "이미지의 url을 저장하기 위한 최대 크기로 잡아놓았습니다.",
"description": "카카오톡에 저장된 프로필 사진 미리보기 (저화질), 이미지의 url을 저장하기 위한 최대 크기로 잡아놓았습니다.",
"type": "string"
}
}
Expand Down
5 changes: 4 additions & 1 deletion docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ definitions:
type: integer
nickName:
type: string
profileImageUrl:
description: 카카오톡에 실제로 저장된 프로필 사진 (고화질), 이미지의 url을 저장하기 위한 최대 크기로 잡아놓았습니다.
type: string
thumbnailImageUrl:
description: 이미지의 url을 저장하기 위한 최대 크기로 잡아놓았습니다.
description: 카카오톡에 저장된 프로필 사진 미리보기 (저화질), 이미지의 url을 저장하기 위한 최대 크기로 잡아놓았습니다.
type: string
type: object
entitys.User:
Expand Down
3 changes: 2 additions & 1 deletion internal/app/entitys/kakao-talk-social.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ type KakaoTalkSocial struct {
Id uint `gorm:"primary_key;" json:"id"`
Email string `gorm:"unique;not null;size:50;" json:"email"`
NickName string `gorm:"not null;size:20;" json:"nickName"`
ThumbnailImageUrl string `gorm:"size:2083;" json:"thumbnailImageUrl"` // 이미지의 url을 저장하기 위한 최대 크기로 잡아놓았습니다.
ProfileImageUrl string `gorm:"size:2083;" json:"profileImageUrl"` // 카카오톡에 실제로 저장된 프로필 사진 (고화질), 이미지의 url을 저장하기 위한 최대 크기로 잡아놓았습니다.
ThumbnailImageUrl string `gorm:"size:2083;" json:"thumbnailImageUrl"` // 카카오톡에 저장된 프로필 사진 미리보기 (저화질), 이미지의 url을 저장하기 위한 최대 크기로 잡아놓았습니다.
}
3 changes: 2 additions & 1 deletion internal/app/handlers/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ func UserKakaoLoginCallBack(c *gin.Context) {
Id: kakaoUserInformation.Id,
Email: kakaoUserInformation.KakaoAccount.Email,
NickName: kakaoUserInformation.KakaoAccount.Profile.Nickname,
ProfileImageUrl: kakaoUserInformation.KakaoAccount.Profile.ProfileImageUrl,
ThumbnailImageUrl: kakaoUserInformation.KakaoAccount.Profile.ThumbnailImageUrl,
}
if err := orm.Client.Create(&kakaoTalkSocial).Error; err != nil {
Expand All @@ -203,7 +204,7 @@ func UserKakaoLoginCallBack(c *gin.Context) {
}

// kakao 프로필 사진 바이너리로 전환
url := kakaoTalkSocial.ThumbnailImageUrl
url := kakaoTalkSocial.ProfileImageUrl
res, err := http.Get(url)
if err != nil {
c.JSON(http.StatusInternalServerError, models.ErrResponse{
Expand Down
1 change: 1 addition & 0 deletions internal/app/models/kakao-user-information.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type kakaoAccount struct {
Profile profile `json:"profile"`
}

// 프로필 사진의 경우 kakao_account.profile 과 properties 2곳에서 조회가 가능한데 가장 fresh한 데이터는 kakao_account.profile 에 존재합니다. properties 에서 프로필 사진 사용시 이전 프로필 사진이 사용될 수 있습니다.
type profile struct {
Nickname string `json:"nickname"`
ProfileImageUrl string `json:"profile_image_url"`
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package project

const (
AppName string = "oauth-server"
AppVersion string = "1.0.0"
AppVersion string = "1.1.0"
)
2 changes: 1 addition & 1 deletion k8s/prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
cpu: 5m
memory: 100Mi
limits:
cpu: 5m
cpu: 100m
memory: 100Mi
env:
- name: STAGES
Expand Down
2 changes: 1 addition & 1 deletion k8s/qa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
cpu: 5m
memory: 100Mi
limits:
cpu: 5m
cpu: 100m
memory: 100Mi
env:
- name: STAGES
Expand Down

0 comments on commit 74b5578

Please sign in to comment.