Skip to content

Commit 2134e88

Browse files
committed
start work on attach user to team with history #39
1 parent b34fadc commit 2134e88

File tree

4 files changed

+111
-27
lines changed

4 files changed

+111
-27
lines changed

api/openapi.yaml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ paths:
503503
responses:
504504
'200':
505505
description: Team deleted successfully
506-
/api/v1/teams/{teamId}/join/{userId}:
506+
/api/v1/teams/{teamId}/users/{userId}:
507507
post:
508508
tags:
509509
- Teams
@@ -533,8 +533,36 @@ paths:
533533
properties:
534534
message:
535535
type: string
536-
/api/v1/teams/{teamId}/leave/{userId}:
537-
post:
536+
put:
537+
tags:
538+
- Teams
539+
summary: Approve connected user with team lead
540+
parameters:
541+
- in: path
542+
name: teamId
543+
required: true
544+
schema:
545+
type: string
546+
format: uuid
547+
description: The ID of the team
548+
- in: path
549+
name: userId
550+
required: true
551+
schema:
552+
type: string
553+
format: uuid
554+
description: The ID of the user
555+
responses:
556+
'200':
557+
description: Approve successfully
558+
content:
559+
application/json:
560+
schema:
561+
type: object
562+
properties:
563+
message:
564+
type: string
565+
delete:
538566
tags:
539567
- Teams
540568
summary: Leave user from team

internal/app/handlers/interface.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,14 @@ func (siw *ServerInterfaceWrapper) PostApiV1ServicesServiceIdUploadService(w htt
136136
siw.handlers.PostApiV1ServicesUuidUploadService(w, r, id)
137137
}
138138

139-
func (siw *ServerInterfaceWrapper) PostApiV1TeamsTeamIdJoinUserId(w http.ResponseWriter, r *http.Request, teamId openapi_types.UUID, userId openapi_types.UUID) {
140-
siw.handlers.PostApiV1TeamsTeamIdJoinUserId(w, r, teamId, userId)
139+
func (siw *ServerInterfaceWrapper) PostApiV1TeamsTeamIdUsersUserId(w http.ResponseWriter, r *http.Request, teamId openapi_types.UUID, userId openapi_types.UUID) {
140+
siw.handlers.JoinTeamUser(w, r, teamId, userId)
141141
}
142142

143-
func (siw *ServerInterfaceWrapper) PostApiV1TeamsTeamIdLeaveUserId(w http.ResponseWriter, r *http.Request, teamId openapi_types.UUID, userId openapi_types.UUID) {
144-
siw.handlers.PostApiV1TeamsTeamIdLeaveUserId(w, r, teamId, userId)
143+
func (siw *ServerInterfaceWrapper) DeleteApiV1TeamsTeamIdUsersUserId(w http.ResponseWriter, r *http.Request, teamId openapi_types.UUID, userId openapi_types.UUID) {
144+
siw.handlers.LeaveTeamUser(w, r, teamId, userId)
145+
}
146+
147+
func (siw *ServerInterfaceWrapper) PutApiV1TeamsTeamIdUsersUserId(w http.ResponseWriter, r *http.Request, teamId openapi_types.UUID, userId openapi_types.UUID) {
148+
siw.handlers.ApproveTeamUser(w, r, teamId, userId)
145149
}

internal/app/handlers/teams.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,17 @@ func (h *Handlers) UpdateTeam(w http.ResponseWriter, r *http.Request, id openapi
9494
api_helpers.RespondWithJSON(w, http.StatusOK, map[string]string{"data": "Team updated successfully"})
9595
}
9696

97-
func (h *Handlers) PostApiV1TeamsTeamIdJoinUserId(w http.ResponseWriter, r *http.Request, teamId openapi_types.UUID, userId openapi_types.UUID) {
97+
func (h *Handlers) JoinTeamUser(w http.ResponseWriter, r *http.Request, teamId openapi_types.UUID, userId openapi_types.UUID) {
9898
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
9999
w.WriteHeader(http.StatusNotImplemented)
100100
}
101101

102-
func (h *Handlers) PostApiV1TeamsTeamIdLeaveUserId(w http.ResponseWriter, r *http.Request, teamId openapi_types.UUID, userId openapi_types.UUID) {
102+
func (h *Handlers) LeaveTeamUser(w http.ResponseWriter, r *http.Request, teamId openapi_types.UUID, userId openapi_types.UUID) {
103+
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
104+
w.WriteHeader(http.StatusNotImplemented)
105+
}
106+
107+
func (h *Handlers) ApproveTeamUser(w http.ResponseWriter, r *http.Request, teamId openapi_types.UUID, userId openapi_types.UUID) {
103108
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
104109
w.WriteHeader(http.StatusNotImplemented)
105110
}

internal/app/server/server.gen.go

Lines changed: 65 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)