Implement getElectionResults
This commit is contained in:
@ -42,7 +42,9 @@ type CreateVotesRequest struct {
|
||||
}
|
||||
|
||||
// ElectionResultsResponse defines model for ElectionResultsResponse.
|
||||
type ElectionResultsResponse = map[string]interface{}
|
||||
type ElectionResultsResponse struct {
|
||||
Results *[]VotesForChoice `json:"results,omitempty"`
|
||||
}
|
||||
|
||||
// ErrorResponse defines model for ErrorResponse.
|
||||
type ErrorResponse struct {
|
||||
@ -56,6 +58,12 @@ type ErrorResponse struct {
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
// VotesForChoice defines model for VotesForChoice.
|
||||
type VotesForChoice struct {
|
||||
Choice string `json:"choice"`
|
||||
Votes int `json:"votes"`
|
||||
}
|
||||
|
||||
// CreateElectionJSONRequestBody defines body for CreateElection for application/json ContentType.
|
||||
type CreateElectionJSONRequestBody = CreateElectionRequest
|
||||
|
||||
|
Reference in New Issue
Block a user