@@ -6,17 +6,18 @@ import (
66)
77
88type RawWorkspace struct {
9- Id int `json:"id" db:"id"`
10- Name string `json:"name" db:"name"`
11- ProfileUrl string `json:"profileUrl" db:"profile_url"`
12- CreatedAt time.Time `json:"createdAt" db:"created_at"`
13- OwnerName string `json:"ownerName" db:"owner_name"`
14- OwnerProfileUrl string `json:"ownerProfileUrl" db:"owner_profile_url"`
15- ParticipantCount int `json:"participantCount" db:"participant_count"`
16- TotalAssignment int `json:"totalAssignment" db:"total_assignment"`
17- IsArchived bool `json:"isArchived" db:"is_archived"`
18- IsOpenScoreboard bool `json:"-" db:"is_open_scoreboard"`
19- IsDeleted bool `json:"-" db:"is_deleted"`
9+ Id int `json:"id" db:"id"`
10+ Name string `json:"name" db:"name"`
11+ ProfileUrl string `json:"profileUrl" db:"profile_url"`
12+ CreatedAt time.Time `json:"createdAt" db:"created_at"`
13+ OwnerName string `json:"ownerName" db:"owner_name"`
14+ OwnerProfileUrl string `json:"ownerProfileUrl" db:"owner_profile_url"`
15+ ParticipantCount int `json:"participantCount" db:"participant_count"`
16+ TotalAssignment int `json:"totalAssignment" db:"total_assignment"`
17+ IsArchived bool `json:"isArchived" db:"is_archived"`
18+ IsScoreboardEnabled bool `json:"is_scoreboard_enabled" db:"is_scoreboard_enabled"`
19+ IsOpenScoreboard bool `json:"-" db:"is_open_scoreboard"`
20+ IsDeleted bool `json:"-" db:"is_deleted"`
2021}
2122
2223type Workspace struct {
@@ -100,6 +101,7 @@ type WorkspaceRepository interface {
100101 GetRaw (id int ) (* RawWorkspace , error )
101102 GetRole (userId string , workspaceId int ) (* WorkspaceRole , error )
102103 GetScoreboard (workspaceId int ) ([]WorkspaceRank , error )
104+ ToggleScoreboard (workspaceId int , enabled bool ) error
103105 List (userId string ) ([]Workspace , error )
104106 ListParticipant (workspaceId int ) ([]WorkspaceParticipant , error )
105107 Update (userId string , workspace * Workspace ) error
@@ -123,6 +125,7 @@ type WorkspaceUsecase interface {
123125 GetRaw (id int ) (* RawWorkspace , error )
124126 GetRole (userId string , workspaceId int ) (* WorkspaceRole , error )
125127 GetScoreboard (workspaceId int ) ([]WorkspaceRank , error )
128+ ToggleScoreboard (workspaceId int , enabled bool ) error
126129 CheckPerm (userId string , workspaceId int ) (bool , error )
127130 CheckPermRole (userId string , workspaceId int , roles []WorkspaceRole ) (bool , error )
128131 List (userId string ) ([]Workspace , error )
0 commit comments