Created
September 22, 2018 12:58
-
-
Save dertajora/c3d13caae2ddd5346407916edb9928a6 to your computer and use it in GitHub Desktop.
Example of beego function in controller. Created for submitting an issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @Title GetContestants | |
// @Description Get list contestant for specific campaign | |
// @Success 200 success | |
// @Param X-Tenant=>tenantID header string true "tenant id" | |
// @Param page query int 1 false "active page" | |
// @router /:campaignID/contestants [get] | |
func (c *AdminContestantController) GetContestants(page int, tenantID string, campaignID int) *jsonapi.JsonAPIResponse { | |
totalPage, err := c.contestantHandler.GetTotalPage(campaignID) | |
contestants, err := c.contestantHandler.GetListContestant(page, campaignID) | |
if err != nil { | |
return c.jsonAPIResponse.Success().WithErrorMessage(err.Error()) | |
} | |
return nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment