Created
January 19, 2020 21:17
This file contains 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
package controller | |
import ( | |
"errors" | |
"github.com/gin-gonic/gin" | |
"net/http" | |
"username_across_platforms/server/service" | |
) | |
func Username(c *gin.Context) { | |
var urls []string | |
if err := c.ShouldBindJSON(&urls); err != nil { | |
c.JSON(http.StatusUnprocessableEntity, errors.New("invalid json body")) | |
return | |
} | |
matchedUrls := service.UsernameService.UsernameCheck(urls) | |
c.JSON(http.StatusOK, matchedUrls) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment