Documentation ¶
Index ¶
- Constants
- func CreateLog(userID string, logType string, logDescription string, logMessage ...string) (err error)
- func CreateMapDiscussion(c *gin.Context)
- func CreateMapDiscussionComment(c *gin.Context)
- func CreateMapSummary(c *gin.Context)
- func CreateRecordWithDemo(c *gin.Context)
- func DeleteCookie(c *gin.Context)
- func DeleteMapDiscussion(c *gin.Context)
- func DeleteMapSummary(c *gin.Context)
- func DeleteRecord(c *gin.Context)
- func DownloadDemoWithID(c *gin.Context)
- func EditMapDiscussion(c *gin.Context)
- func EditMapImage(c *gin.Context)
- func EditMapSummary(c *gin.Context)
- func FetchChapterMaps(c *gin.Context)
- func FetchChapters(c *gin.Context)
- func FetchGames(c *gin.Context)
- func FetchMapDiscussion(c *gin.Context)
- func FetchMapDiscussions(c *gin.Context)
- func FetchMapLeaderboards(c *gin.Context)
- func FetchMapSummary(c *gin.Context)
- func FetchMaps(c *gin.Context)
- func FetchUser(c *gin.Context)
- func GetCookie(c *gin.Context)
- func GetPlayerSummaries(steamId, apiKey string) (models.PlayerSummaries, error)
- func Login(c *gin.Context)
- func ModLogs(c *gin.Context)
- func Profile(c *gin.Context)
- func Rankings(c *gin.Context)
- func ScoreLogs(c *gin.Context)
- func SearchWithQuery(c *gin.Context)
- func UpdateCountryCode(c *gin.Context)
- func UpdateUser(c *gin.Context)
- type ChapterMapsResponse
- type ChaptersResponse
- type CreateMapDiscussionCommentRequest
- type CreateMapDiscussionRequest
- type CreateMapSummaryRequest
- type DeleteMapSummaryRequest
- type EditMapDiscussionRequest
- type EditMapImageRequest
- type EditMapSummaryRequest
- type GameMapsResponse
- type Log
- type LoginResponse
- type LogsResponse
- type LogsResponseDetails
- type MapDiscussion
- type MapDiscussionComment
- type MapDiscussionResponse
- type MapDiscussionsResponse
- type MapLeaderboardsResponse
- type MapShortWithGame
- type MapSummaryResponse
- type ProfileRankings
- type ProfileRankingsDetails
- type ProfileRecords
- type ProfileResponse
- type ProfileScores
- type RankingsResponse
- type RecordMultiplayer
- type RecordRequest
- type RecordResponse
- type RecordSingleplayer
- type ScoreLogsResponse
- type ScoreLogsResponseDetails
- type ScoreResponse
- type SearchResponse
Constants ¶
View Source
const ( LogTypeMod string = "Mod" LogTypeUser string = "User" LogTypeRecord string = "Record" LogDescriptionUserLoginSuccess string = "LoginSuccess" LogDescriptionUserLoginFailToken string = "LoginTokenFail" LogDescriptionUserLoginFailValidate string = "LoginValidateFail" LogDescriptionUserLoginFailSummary string = "LoginSummaryFail" LogDescriptionUserUpdateSuccess string = "UpdateSuccess" LogDescriptionUserUpdateFail string = "UpdateFail" LogDescriptionUserUpdateSummaryFail string = "UpdateSummaryFail" LogDescriptionUserUpdateCountrySuccess string = "UpdateCountrySuccess" LogDescriptionUserUpdateCountryFail string = "UpdateCountryFail" LogDescriptionMapSummaryCreateSuccess string = "MapSummaryCreateSuccess" LogDescriptionMapSummaryCreateFail string = "MapSummaryCreateFail" LogDescriptionMapSummaryEditSuccess string = "MapSummaryEditSuccess" LogDescriptionMapSummaryEditFail string = "MapSummaryEditFail" LogDescriptionMapSummaryEditImageSuccess string = "MapSummaryEditImageSuccess" LogDescriptionMapSummaryEditImageFail string = "MapSummaryEditImageFail" LogDescriptionMapSummaryDeleteSuccess string = "MapSummaryDeleteSuccess" LogDescriptionMapSummaryDeleteFail string = "MapSummaryDeleteFail" LogDescriptionCreateRecordSuccess string = "CreateRecordSuccess" LogDescriptionCreateRecordInsertRecordFail string = "InsertRecordFail" LogDescriptionCreateRecordInsertDemoFail string = "InsertDemoFail" LogDescriptionCreateRecordProcessDemoFail string = "ProcessDemoFail" LogDescriptionCreateRecordCreateDemoFail string = "CreateDemoFail" LogDescriptionCreateRecordOpenDemoFail string = "OpenDemoFail" LogDescriptionCreateRecordSaveDemoFail string = "SaveDemoFail" LogDescriptionCreateRecordInvalidRequestFail string = "InvalidRequestFail" LogDescriptionDeleteRecordSuccess string = "DeleteRecordSuccess" LogDescriptionDeleteRecordFail string = "DeleteRecordFail" )
Variables ¶
This section is empty.
Functions ¶
func CreateMapDiscussion ¶
POST Map Discussion
@Description Create map discussion with specified map id. @Tags maps / discussions @Produce json @Param Authorization header string true "JWT Token" @Param mapid path int true "Map ID" @Param request body CreateMapDiscussionRequest true "Body" @Success 200 {object} models.Response{data=CreateMapDiscussionRequest} @Router /maps/{mapid}/discussions [post]
func CreateMapDiscussionComment ¶
POST Map Discussion Comment
@Description Create map discussion comment with specified map id. @Tags maps / discussions @Produce json @Param Authorization header string true "JWT Token" @Param mapid path int true "Map ID" @Param discussionid path int true "Discussion ID" @Param request body CreateMapDiscussionCommentRequest true "Body" @Success 200 {object} models.Response{data=CreateMapDiscussionCommentRequest} @Router /maps/{mapid}/discussions/{discussionid} [post]
func CreateMapSummary ¶
POST Map Summary
@Description Create map summary with specified map id. @Tags maps / summary @Produce json @Param Authorization header string true "JWT Token" @Param mapid path int true "Map ID" @Param request body CreateMapSummaryRequest true "Body" @Success 200 {object} models.Response{data=CreateMapSummaryRequest} @Router /maps/{mapid}/summary [post]
func CreateRecordWithDemo ¶
POST Record
@Description Post record with demo of a specific map. @Tags maps / leaderboards @Accept mpfd @Produce json @Param mapid path int true "Map ID" @Param Authorization header string true "JWT Token" @Param host_demo formData file true "Host Demo" @Param partner_demo formData file false "Partner Demo" @Param is_partner_orange formData boolean false "Is Partner Orange" @Param partner_id formData string false "Partner ID" @Success 200 {object} models.Response{data=RecordResponse} @Router /maps/{mapid}/record [post]
func DeleteCookie ¶
DELETE Token
@Description Deletes the token cookie from the user. @Tags auth @Produce json @Success 200 {object} models.Response{data=LoginResponse} @Failure 404 {object} models.Response @Router /token [delete]
func DeleteMapDiscussion ¶
DELETE Map Discussion
@Description Delete map discussion with specified map id. @Tags maps / discussions @Produce json @Param Authorization header string true "JWT Token" @Param mapid path int true "Map ID" @Param discussionid path int true "Discussion ID" @Success 200 {object} models.Response @Router /maps/{mapid}/discussions/{discussionid} [delete]
func DeleteMapSummary ¶
DELETE Map Summary
@Description Delete map summary with specified map id. @Tags maps / summary @Produce json @Param Authorization header string true "JWT Token" @Param mapid path int true "Map ID" @Param request body DeleteMapSummaryRequest true "Body" @Success 200 {object} models.Response{data=DeleteMapSummaryRequest} @Router /maps/{mapid}/summary [delete]
func DeleteRecord ¶
DELETE Record
@Description Delete record with specified map and record id. @Tags maps / leaderboards @Produce json @Param mapid path int true "Map ID" @Param recordid path int true "Record ID" @Param Authorization header string true "JWT Token" @Success 200 {object} models.Response @Router /maps/{mapid}/record/{recordid} [delete]
func DownloadDemoWithID ¶
GET Demo
@Description Get demo with specified demo uuid. @Tags demo @Accept json @Produce octet-stream @Param uuid query string true "Demo UUID" @Success 200 {file} binary "Demo File" @Router /demos [get]
func EditMapDiscussion ¶
PUT Map Discussion
@Description Edit map discussion with specified map id. @Tags maps / discussions @Produce json @Param Authorization header string true "JWT Token" @Param mapid path int true "Map ID" @Param discussionid path int true "Discussion ID" @Param request body EditMapDiscussionRequest true "Body" @Success 200 {object} models.Response{data=EditMapDiscussionRequest} @Router /maps/{mapid}/discussions/{discussionid} [put]
func EditMapImage ¶
PUT Map Image
@Description Edit map image with specified map id. @Tags maps / summary @Produce json @Param Authorization header string true "JWT Token" @Param mapid path int true "Map ID" @Param request body EditMapImageRequest true "Body" @Success 200 {object} models.Response{data=EditMapImageRequest} @Router /maps/{mapid}/image [put]
func EditMapSummary ¶
PUT Map Summary
@Description Edit map summary with specified map id. @Tags maps / summary @Produce json @Param Authorization header string true "JWT Token" @Param mapid path int true "Map ID" @Param request body EditMapSummaryRequest true "Body" @Success 200 {object} models.Response{data=EditMapSummaryRequest} @Router /maps/{mapid}/summary [put]
func FetchChapterMaps ¶
GET Maps of a Chapter
@Description Get maps from the specified chapter id. @Tags games & chapters @Produce json @Param chapterid path int true "Chapter ID" @Success 200 {object} models.Response{data=ChapterMapsResponse} @Failure 400 {object} models.Response @Router /chapters/{chapterid} [get]
func FetchChapters ¶
GET Chapters of a Game
@Description Get chapters from the specified game id. @Tags games & chapters @Produce json @Param gameid path int true "Game ID" @Success 200 {object} models.Response{data=ChaptersResponse} @Router /games/{gameid} [get]
func FetchGames ¶
GET Games
@Description Get games from the leaderboards. @Tags games & chapters @Produce json @Success 200 {object} models.Response{data=[]models.Game} @Failure 400 {object} models.Response @Router /games [get]
func FetchMapDiscussion ¶
GET Map Discussion
@Description Get map discussion with specified map and discussion id. @Tags maps / discussions @Produce json @Param mapid path int true "Map ID" @Param discussionid path int true "Discussion ID" @Success 200 {object} models.Response{data=MapDiscussionResponse} @Router /maps/{mapid}/discussions/{discussionid} [get]
func FetchMapDiscussions ¶
GET Map Discussions
@Description Get map discussions with specified map id. @Tags maps / discussions @Produce json @Param mapid path int true "Map ID" @Success 200 {object} models.Response{data=MapDiscussionsResponse} @Router /maps/{mapid}/discussions [get]
func FetchMapLeaderboards ¶
GET Map Leaderboards
@Description Get map leaderboards with specified id. @Tags maps / leaderboards @Produce json @Param mapid path int true "Map ID" @Param page query int false "Page Number (default: 1)" @Param pageSize query int false "Number of Records Per Page (default: 20)" @Success 200 {object} models.Response{data=MapLeaderboardsResponse} @Router /maps/{mapid}/leaderboards [get]
func FetchMapSummary ¶
GET Map Summary
@Description Get map summary with specified id. @Tags maps / summary @Produce json @Param mapid path int true "Map ID" @Success 200 {object} models.Response{data=MapSummaryResponse} @Router /maps/{mapid}/summary [get]
func FetchMaps ¶
GET Maps of a Game
@Description Get maps from the specified game id. @Tags games & chapters @Produce json @Param gameid path int true "Game ID" @Success 200 {object} models.Response{data=ChaptersResponse} @Router /games/{gameid}/maps [get]
func FetchUser ¶
GET User
@Description Get profile page of another user. @Tags users @Accept json @Produce json @Param userid path int true "User ID" @Success 200 {object} models.Response{data=ProfileResponse} @Router /users/{userid} [get]
func GetCookie ¶
GET Token
@Description Gets the token cookie value from the user. @Tags auth @Produce json @Success 200 {object} models.Response{data=LoginResponse} @Failure 404 {object} models.Response @Router /token [get]
func GetPlayerSummaries ¶
func GetPlayerSummaries(steamId, apiKey string) (models.PlayerSummaries, error)
func Login ¶
Login
@Description Get (redirect) login page for Steam auth. @Tags login @Accept json @Produce json @Success 200 {object} models.Response{data=LoginResponse} @Router /login [get]
func ModLogs ¶
GET Mod Logs
@Description Get mod logs. @Tags logs @Produce json @Param Authorization header string true "JWT Token" @Success 200 {object} models.Response{data=LogsResponse} @Router /logs/mod [get]
func Profile ¶
GET Profile
@Description Get profile page of session user. @Tags users @Accept json @Produce json @Param Authorization header string true "JWT Token" @Success 200 {object} models.Response{data=ProfileResponse} @Router /profile [get]
func Rankings ¶
GET Rankings
@Description Get rankings of every player. @Tags rankings @Produce json @Success 200 {object} models.Response{data=RankingsResponse} @Router /rankings [get]
func ScoreLogs ¶
GET Score Logs
@Description Get score logs of every player. @Tags logs @Produce json @Success 200 {object} models.Response{data=ScoreLogsResponse} @Router /logs/score [get]
func SearchWithQuery ¶
GET Search With Query
@Description Get all user and map data matching to the query. @Tags search @Produce json @Param q query string false "Search user or map name." @Success 200 {object} models.Response{data=SearchResponse} @Router /search [get]
func UpdateCountryCode ¶
PUT Profile/CountryCode
@Description Update country code of session user. @Tags users @Accept json @Produce json @Param Authorization header string true "JWT Token" @Param country_code query string true "Country Code [XX]" @Success 200 {object} models.Response @Router /profile [put]
func UpdateUser ¶
PUT Profile
@Description Update profile page of session user. @Tags users @Accept json @Produce json @Param Authorization header string true "JWT Token" @Success 200 {object} models.Response{data=ProfileResponse} @Router /profile [post]
Types ¶
type ChapterMapsResponse ¶
type ChaptersResponse ¶
type CreateMapDiscussionCommentRequest ¶
type CreateMapDiscussionCommentRequest struct {
Comment string `json:"comment" binding:"required"`
}
type CreateMapSummaryRequest ¶
type CreateMapSummaryRequest struct { CategoryID int `json:"category_id" binding:"required"` Description string `json:"description" binding:"required"` Showcase string `json:"showcase"` UserName string `json:"user_name" binding:"required"` ScoreCount *int `json:"score_count" binding:"required"` RecordDate time.Time `json:"record_date" binding:"required"` }
type DeleteMapSummaryRequest ¶
type DeleteMapSummaryRequest struct {
RouteID int `json:"route_id" binding:"required"`
}
type EditMapImageRequest ¶
type EditMapImageRequest struct {
Image string `json:"image" binding:"required"`
}
type EditMapSummaryRequest ¶
type EditMapSummaryRequest struct { RouteID int `json:"route_id" binding:"required"` Description string `json:"description" binding:"required"` Showcase string `json:"showcase"` UserName string `json:"user_name" binding:"required"` ScoreCount *int `json:"score_count" binding:"required"` RecordDate time.Time `json:"record_date" binding:"required"` }
type GameMapsResponse ¶
type LoginResponse ¶
type LoginResponse struct {
Token string `json:"token"`
}
type LogsResponse ¶
type LogsResponse struct {
Logs []LogsResponseDetails `json:"logs"`
}
type LogsResponseDetails ¶
type MapDiscussion ¶
type MapDiscussion struct { ID int `json:"id"` Creator models.UserShortWithAvatar `json:"creator"` Title string `json:"title"` Content string `json:"content"` // Upvotes int `json:"upvotes"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Comments []MapDiscussionComment `json:"comments"` }
type MapDiscussionComment ¶
type MapDiscussionComment struct { User models.UserShortWithAvatar `json:"user"` Comment string `json:"comment"` Date time.Time `json:"date"` }
type MapDiscussionResponse ¶
type MapDiscussionResponse struct {
Discussion MapDiscussion `json:"discussion"`
}
type MapDiscussionsResponse ¶
type MapDiscussionsResponse struct {
Discussions []MapDiscussion `json:"discussions"`
}
type MapLeaderboardsResponse ¶
type MapLeaderboardsResponse struct { Map models.Map `json:"map"` Records any `json:"records"` Pagination models.Pagination `json:"pagination"` }
type MapShortWithGame ¶
type MapSummaryResponse ¶
type MapSummaryResponse struct { Map models.Map `json:"map"` Summary models.MapSummary `json:"summary"` }
type ProfileRankings ¶
type ProfileRankings struct { Overall ProfileRankingsDetails `json:"overall"` Singleplayer ProfileRankingsDetails `json:"singleplayer"` Cooperative ProfileRankingsDetails `json:"cooperative"` }
type ProfileRankingsDetails ¶
type ProfileRecords ¶
type ProfileResponse ¶
type ProfileResponse struct { Profile bool `json:"profile"` SteamID string `json:"steam_id"` UserName string `json:"user_name"` AvatarLink string `json:"avatar_link"` CountryCode string `json:"country_code"` Titles []models.Title `json:"titles"` Links models.Links `json:"links"` Rankings ProfileRankings `json:"rankings"` Records []ProfileRecords `json:"records"` Pagination models.Pagination `json:"pagination"` }
type ProfileScores ¶
type RankingsResponse ¶
type RankingsResponse struct { Overall []models.UserRanking `json:"rankings_overall"` Singleplayer []models.UserRanking `json:"rankings_singleplayer"` Multiplayer []models.UserRanking `json:"rankings_multiplayer"` }
type RecordMultiplayer ¶
type RecordMultiplayer struct { Placement int `json:"placement"` RecordID int `json:"record_id"` ScoreCount int `json:"score_count"` ScoreTime int `json:"score_time"` Host models.UserShortWithAvatar `json:"host"` Partner models.UserShortWithAvatar `json:"partner"` HostDemoID string `json:"host_demo_id"` PartnerDemoID string `json:"partner_demo_id"` RecordDate time.Time `json:"record_date"` }
type RecordRequest ¶
type RecordRequest struct { HostDemo *multipart.FileHeader `json:"host_demo" form:"host_demo" binding:"required" swaggerignore:"true"` PartnerDemo *multipart.FileHeader `json:"partner_demo" form:"partner_demo" swaggerignore:"true"` IsPartnerOrange bool `json:"is_partner_orange" form:"is_partner_orange"` PartnerID string `json:"partner_id" form:"partner_id"` }
type RecordResponse ¶
type RecordSingleplayer ¶
type ScoreLogsResponse ¶
type ScoreLogsResponse struct {
Logs []ScoreLogsResponseDetails `json:"scores"`
}
type ScoreResponse ¶
type SearchResponse ¶
type SearchResponse struct { Players []models.UserShortWithAvatar `json:"players"` Maps []MapShortWithGame `json:"maps"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.