v1

package
v0.0.0-...-1a7f21c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DelAnnounce

func DelAnnounce(c *gin.Context)

DelAnnounce is handler for endpoint DELETE /announce/{id} @Summary Delete announce @Description Delete announce by announce id @Description Permission : **announce.delete** @Accept json @Produce json @Param id path string true "Announce ID" @Success 200 {object} docmodels.ResponseSuccess "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 403 {object} docmodels.ResponseNotFound "You don't have permission" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @Security ApiKeyAuth @tags api/v1/announce @Router /v1/announce/{id} [delete]

func DelImage

func DelImage(c *gin.Context)

DelImage is handler for endpoint DELETE /image/{id} @Summary Delete image @Description Delete image by image id. @Description Permission : **image.delete** @Accept json @Produce json @Param id path string true "Image ID" @Success 200 {object} docmodels.ResponseSuccess "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 403 {object} docmodels.ResponseNotFound "You don't have permission" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @Security ApiKeyAuth @tags api/v1/image @Router /v1/image/{id} [delete]

func GetAllAnnounceList

func GetAllAnnounceList(c *gin.Context)

GetAllAnnounceList is handler for endpoint GET /announces/all @Summary Get all announce list @Description Get all announce list sorted by creation time @Description Permission : **announces.get** @Accept json @Produce json @Success 200 {object} docmodels.ResponseSuccess{list=[]models.Announce} "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 403 {object} docmodels.ResponseNotFound "You don't have permission" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @Security ApiKeyAuth @tags api/v1/announce @Router /v1/announces/all [get]

func GetAnnounce

func GetAnnounce(c *gin.Context)

GetAnnounce is handler for endpoint GET /announce/{id} @Summary Get announce @Description Get specific announce by announce id @Description Permission : **announce.get** @Accept json @Produce json @Param id path string true "Announce ID" @Success 200 {object} docmodels.ResponseSuccess{announce=models.Announce} "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 403 {object} docmodels.ResponseNotFound "You don't have permission" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @Security ApiKeyAuth @tags api/v1/announce @Router /v1/announce/{id} [get]

func GetAnnounceList

func GetAnnounceList(c *gin.Context)

GetAnnounceList is handler for endpoint GET /announces/user/{id} @Summary Get announce list by user id @Description Get announce list written by user @Description Permission : **announces.get** @Accept json @Produce json @Param id path string true "User ID" @Success 200 {object} docmodels.ResponseSuccess{list=[]models.Announce} "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @Security ApiKeyAuth @tags api/v1/announce @Router /v1/announces/user/{id} [get]

func GetAnnounceListMe

func GetAnnounceListMe(c *gin.Context)

GetAnnounceListMe is handler for endpoint GET /announces/me @Summary Get own announce list @Description get announce list written by me @Description Permission : **announces.get** @Accept json @Produce json @Success 200 {object} docmodels.ResponseSuccess{list=[]models.Announce} "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 403 {object} docmodels.ResponseNotFound "You don't have permission" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @Security ApiKeyAuth @tags api/v1/announce @Router /v1/announces/me [get]

func GetCurrentAnnounceList

func GetCurrentAnnounceList(c *gin.Context)

GetCurrentAnnounceList is handler for endpoint GET /announces/current @Summary Get current announce list @Description Get announce list greater then target-date from NOW sorted by creation time @Description Permission : **announces.get** @Accept json @Produce json @Success 200 {object} docmodels.ResponseSuccess{list=[]models.Announce} "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 403 {object} docmodels.ResponseNotFound "You don't have permission" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @Security ApiKeyAuth @tags api/v1/announce @Router /v1/announces/current [get]

func GetImage

func GetImage(c *gin.Context)

GetImage is handler for endpoint GET /image/{id} @Summary Get image by id @Description Get Image. When Success it provide image @Accept json @Produce png @Produce jpeg @Produce gif @Param id path string true "Image ID" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 403 {object} docmodels.ResponseNotFound "You don't have permission" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @tags api/v1/image @Router /v1/image/{id} [get]

func GetImageList

func GetImageList(c *gin.Context)

GetImageList is handler for endpoint GET /images @Summary Get my image list @Description Get Image list uploaded from me. @Description Permission : **imagelist.get** @Accept json @Produce json @Success 200 {object} docmodels.ResponseSuccess{images=[]docmodels.ResponseImageElement} "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 403 {object} docmodels.ResponseNotFound "You don't have permission" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @Security ApiKeyAuth @tags api/v1/image @Router /v1/images [get]

func GetLolHistory

func GetLolHistory(c *gin.Context)

GetLolHistory is handler for endpoint GET /lol/history/{id} @Summary Get lol history @Description Find game after the timestamp and store to DB @Accept json @Produce json @Param id path string true "Game ID" @Success 200 {object} docmodels.ResponseSuccess{game=interface{}} "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 403 {object} docmodels.ResponseNotFound "You don't have permission" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @tags api/v1/lol/history @Router /v1/lol/history/{id} [get]

func GetLolHistoryList

func GetLolHistoryList(c *gin.Context)

GetLolHistoryList is handler for endpoint GET /lol/histories @Summary Get lol histories @Description Get game histories @Accept json @Produce json @Success 200 {object} docmodels.ResponseSuccess{games=[]docmodels.ResponseLoLHistory} "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 403 {object} docmodels.ResponseNotFound "You don't have permission" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @tags api/v1/lol/history @Router /v1/lol/histories [get]

func GetLolHistoryPerDate

func GetLolHistoryPerDate(c *gin.Context)

GetLolHistoryPerDate is handler for endpoint GET /lol/datelogs @Summary Get game counts and win rate per date @Description Game count per date and calculate win count by queue id @Accept json @Produce json @Success 200 {object} docmodels.ResponseSuccess{games=[]docmodels.ResponseDateLog} "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 403 {object} docmodels.ResponseNotFound "You don't have permission" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @tags api/v1/lol/history @Router /v1/lol/datelogs [get]

func GetMe

func GetMe(c *gin.Context)

GetMe is handler for endpoint GET /user @Summary Get My User Information @Description Get me @Description Permission : **user.get** @Accept json @Produce json @Success 200 {object} docmodels.ResponseSuccess{user=models.User} "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 403 {object} docmodels.ResponseNotFound "You don't have permission" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @Security ApiKeyAuth @tags api/v1/user @Router /v1/user [get]

func GetOwnStateHistory

func GetOwnStateHistory(c *gin.Context)

GetOwnStateHistory is handler for endpoint GET /states @Summary Get my state history @Description Get my state change history @Description Permission : **states.get** @Accept json @Produce json @Success 200 {object} docmodels.ResponseSuccess{history=[]models.DFDHistory} "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 403 {object} docmodels.ResponseNotFound "You don't have permission" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @Security ApiKeyAuth @tags api/v1/state @Router /v1/states [get]

func GetStateHistory

func GetStateHistory(c *gin.Context)

GetStateHistory is handler for endpoint GET /states/{id} @Summary Get state history @Description Get user's state change history @Description Permission : **states.get** @Accept json @Produce json @Param id path string true "User ID" @Success 200 {object} docmodels.ResponseSuccess{history=[]models.DFDHistory} "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 403 {object} docmodels.ResponseNotFound "You don't have permission" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @Security ApiKeyAuth @tags api/v1/state @Router /v1/states/{id} [get]

func GetUser

func GetUser(c *gin.Context)

GetUser is handler for endpoint GET /user/{id} @Summary Get User Information @Description Get user by user id @Description Permission : **user.get** @ID get-string-by-string @Accept json @Produce json @Param id path string true "User ID" @Success 200 {object} docmodels.ResponseSuccess{user=models.User} "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 403 {object} docmodels.ResponseNotFound "You don't have permission" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @Security ApiKeyAuth @tags api/v1/user @Router /v1/user/{id} [get]

func GetUserList

func GetUserList(c *gin.Context)

GetUserList is handler for endpoint GET /userlist @Summary Get User List @Description Get userlinst who is not guest. @Description Permission : **user.get** @Accept json @Produce json @Success 200 {object} docmodels.ResponseSuccess{user=[]primitive.ObjectID} "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 403 {object} docmodels.ResponseNotFound "You don't have permission" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @Security ApiKeyAuth @tags api/v1/user @Router /v1/userlist [get]

func Initialize

func Initialize(router *gin.RouterGroup)

Initialize all routes for v1 apis

func PatchAnnounce

func PatchAnnounce(c *gin.Context)

PatchAnnounce is handler for endpoint PATCH /announce/{id} @Summary Patch Announce @Description Edit spcific announce written by me @Description Permission : **announce.get** @Accept json @Produce json @Param id path string true "Announce ID" @Param body body docmodels.RequestBodyAnnouncePost true "body" @Success 200 {object} docmodels.ResponseSuccess "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @Security ApiKeyAuth @tags api/v1/announce @Router /v1/announce/{id} [patch]

func PatchRiotAccessToken

func PatchRiotAccessToken(c *gin.Context)

PatchRiotAccessToken is handler for endpoint PATCH /application/riot/access @Summary Patch Riot Token @Description Riot token updator (This api only available on "Riot development token". If I get application token, This endpoint will be deleted) @Description Permission : **admin.token.create** @Accept json @Produce json @Param body body docmodels.RequestBodyToken true "body" @Success 200 {object} docmodels.ResponseSuccess "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @Security ApiKeyAuth @tags api/v1/admin @Router /v1/application/riot/access [patch]

func PatchUser

func PatchUser(c *gin.Context)

PatchUser is handler for endpoint PATCH /userlist @Summary Edit user information @Description edit userfield. @Description Permission : **user.patch** @Accept json @Produce json @Param username body docmodels.RequestBodyPatchUser true "username" @Success 200 {object} docmodels.ResponseSuccess "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 403 {object} docmodels.ResponseNotFound "You don't have permission" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @Security ApiKeyAuth @tags api/v1/user @Router /v1/user [patch]

func PatchUserLolName

func PatchUserLolName(c *gin.Context)

PatchUserLolName is handler for endpoint PATCH /user/lol @Summary Patch LOL Information @Description Update LOL user informations @Description Permission : **user.patch** @Accept json @Produce json @Param lol_username body docmodels.RequestEmpty{lol_username=string} true "league of legends username" @Success 200 {object} docmodels.ResponseSuccess "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 403 {object} docmodels.ResponseNotFound "You don't have permission" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @Security ApiKeyAuth @tags api/v1/user @Router /v1/user/lol [patch]

func PostAnnounce

func PostAnnounce(c *gin.Context)

PostAnnounce is handler for endpoint POST /announce @Summary Write announce @Description write announce @Description Permission : **announce.post** @Accept json @Produce json @Param bodymap body docmodels.RequestBodyAnnouncePost true "username" @Success 200 {object} docmodels.ResponseSuccess{id=primitive.ObjectId} "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 403 {object} docmodels.ResponseNotFound "You don't have permission" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @Security ApiKeyAuth @tags api/v1/announce @Router /v1/announce [post]

func PostAppicationToken

func PostAppicationToken(c *gin.Context)

PostAppicationToken is handler for endpoint POST /application/token @Summary Create new application token @Description 1st party application token. @Description Permission : **admin.token.create** @Accept json @Produce json @Success 200 {object} docmodels.ResponseSuccess{token=string} "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @Security ApiKeyAuth @tags api/v1/admin @Router /v1/application/token [post]

func PostImage

func PostImage(c *gin.Context)

PostImage is handler for endpoint POST /image @Summary Post image @Description Upload Image by base64 image. It supports **png, jpeg, gif** @Description Permission : **image.post** @Accept json @Produce json @Param img body docmodels.RequestBodyImagePost true "base64 image" @Success 200 {object} docmodels.ResponseSuccess{id=string} "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 403 {object} docmodels.ResponseNotFound "You don't have permission" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @Security ApiKeyAuth @tags api/v1/image @Router /v1/image [post]

func PostLolHistoryUpdate

func PostLolHistoryUpdate(c *gin.Context)

PostLolHistoryUpdate is handler for endpoint POST /lol/history/updater @Summary Update lol history @Description Find game after the timestamp and store to DB @Description **Application Token** is required. @Accept json @Produce json @Param X-Dfd-App-Auth header string true "application access token" @Success 200 {object} docmodels.ResponseSuccess{results=[]primitive.ObjectID} "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 403 {object} docmodels.ResponseNotFound "You don't have permission" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @tags api/v1/lol/history @Router /v1/lol/history/updater [post]

func PostMigrationHistoryFrom

func PostMigrationHistoryFrom(c *gin.Context)

PostMigrationHistoryFrom is handler for endpoint POST /lol/history/migration @Summary Migration lol history from 2021-01-01. @Description migration and store to DB. @Description **Application Token** is required. @Accept json @Produce json @Param X-Dfd-App-Auth header string true "application access token" @Success 200 {object} docmodels.ResponseSuccess{results=[]primitive.ObjectID} "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 403 {object} docmodels.ResponseNotFound "You don't have permission" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @tags api/v1/lol/history @Router /v1/lol/history/migration [post]

func PostState

func PostState(c *gin.Context)

PostState is handler for endpoint POST /state @Description Create state @Description Permission : **states.post** @Accept json @Produce json @Param state body docmodels.RequestBodyStatePost true "Create user state" @Success 200 {object} docmodels.ResponseSuccess "success" @Failure 500 {object} docmodels.ResponseInternalServerError "Internal Server Error" @Failure 404 {object} docmodels.ResponseNotFound "Cannt found user" @Failure 403 {object} docmodels.ResponseNotFound "You don't have permission" @Failure 401 {object} docmodels.ResponseUnauthorized "Unauthorized Request. If token is expired, **token_expired** filed must be set true" @Failure 400 {object} docmodels.ResponseBadRequest "Bad request" @Security ApiKeyAuth @tags api/v1/state @Router /v1/state [post]

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL