Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

ci: more refined workflow. #103

Merged
merged 4 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: server deploy

on:
workflow_run:
workflows: [build and push docker image to aliyun]
types:
- completed

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.ACCESSKEYID }}
key: ${{ secrets.ACCESSKEYSECRET }}
port: ${{ secrets.PORT }}
script: |
cd /deploy
sh restart-service-all.sh
3 changes: 2 additions & 1 deletion .github/workflows/push-image.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: push-to-Aliyun
name: build and push docker image to aliyun

on:
push:
Expand All @@ -7,6 +7,7 @@ on:
pull_request:
branches:
- main
types: [closed]

jobs:
push-aliyun:
Expand Down
76 changes: 59 additions & 17 deletions cmd/api/biz/router/api/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions cmd/api/biz/router/api/middleware.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cmd/user/dal/db/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func GetUserByUsername(ctx context.Context, username string) (*User, error) {
// add some logs

if errors.Is(err, gorm.ErrRecordNotFound) {
return nil, err
return nil, errors.New("User not found")
}
return nil, err
}
Expand All @@ -76,7 +76,7 @@ func GetUserByID(ctx context.Context, userid int64) (*User, error) {
// add some logs

if errors.Is(err, gorm.ErrRecordNotFound) {
return nil, errors.New("User not found")
return nil, errno.UserNotFoundError
}
return nil, err
}
Expand Down
30 changes: 15 additions & 15 deletions idl/api.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -250,30 +250,30 @@ struct MessageActionResponse {


service BasicService {
FeedResponse Feed(1: FeedRequest req) (api.get="/douyin/feed")
FeedResponse Feed(1: FeedRequest req) (api.get="/douyin/feed/")

UserRegisterResponse UserRegister(1: UserRegisterRequest req) (api.post="/douyin/user/register")
UserLoginResponse UserLogin(1: UserLoginRequest req) (api.post="/douyin/user/login")
UserResponse UserInfo(1: UserRequest req) (api.get="/douyin/user")
UserRegisterResponse UserRegister(1: UserRegisterRequest req) (api.post="/douyin/user/register/")
UserLoginResponse UserLogin(1: UserLoginRequest req) (api.post="/douyin/user/login/")
UserResponse UserInfo(1: UserRequest req) (api.get="/douyin/user/")

PublishActionResponse PublishAction(1: PublishActionRequest req) (api.post="/douyin/publish/action")
PublishListResponse PublishList(1: PublishListRequest req) (api.get="/douyin/publish/list")
PublishActionResponse PublishAction(1: PublishActionRequest req) (api.post="/douyin/publish/action/")
PublishListResponse PublishList(1: PublishListRequest req) (api.get="/douyin/publish/list/")
}

service InteractionService {
FavoriteActionResponse FavoriteAction(1: FavoriteActionRequest req) (api.post="/douyin/favorite/action")
FavoriteListResponse FavoriteList(1: FavoriteListRequest req) (api.get="/douyin/favorite/list")
FavoriteActionResponse FavoriteAction(1: FavoriteActionRequest req) (api.post="/douyin/favorite/action/")
FavoriteListResponse FavoriteList(1: FavoriteListRequest req) (api.get="/douyin/favorite/list/")

CommentActionResponse CommentAction(1: CommentActionRequest req) (api.post="/douyin/comment/action")
CommentListResponse CommentList(1: CommentListRequest req) (api.get="/douyin/comment/list")
CommentActionResponse CommentAction(1: CommentActionRequest req) (api.post="/douyin/comment/action/")
CommentListResponse CommentList(1: CommentListRequest req) (api.get="/douyin/comment/list/")
}

service SocialService {
RelationActionResponse RelationAction(1: RelationActionRequest req) (api.post="/douyin/relation/action/")
RelationFollowListResponse RelationFollowList(1: RelationFollowListRequest req) (api.get="/douyin/relation/follow/list")
RelationFollowerListResponse RelationFollowerList(1: RelationFollowerListRequest req) (api.get="/douyin/relation/follower/list")
RelationFriendListResponse RelationFriendList(1: RelationFriendListRequest req) (api.get="/douyin/relation/friend/list")
RelationFollowListResponse RelationFollowList(1: RelationFollowListRequest req) (api.get="/douyin/relation/follow/list/")
RelationFollowerListResponse RelationFollowerList(1: RelationFollowerListRequest req) (api.get="/douyin/relation/follower/list/")
RelationFriendListResponse RelationFriendList(1: RelationFriendListRequest req) (api.get="/douyin/relation/friend/list/")

MessageActionResponse MessageAction(1: MessageActionRequest req) (api.post="/douyin/message/action")
MessageChatResponse MessageChat(1: MessageChatRequest req) (api.get="/douyin/message/chat")
MessageActionResponse MessageAction(1: MessageActionRequest req) (api.post="/douyin/message/action/")
MessageChatResponse MessageChat(1: MessageChatRequest req) (api.get="/douyin/message/chat/")
}
Loading