Created
June 23, 2018 16:31
-
-
Save mohashari/36198abdad554790e7344090d1587896 to your computer and use it in GitHub Desktop.
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
| func fetchSingleStuden(c *gin.Context) { | |
| var model student | |
| var vo transformedStudent | |
| modelID := c.Param("id") | |
| db.Find(&model, modelID) | |
| if model.ID == 0 { | |
| c.JSON(http.StatusNotFound, gin.H{"message": http.StatusNotFound, "result": "Data Tidak Ada"}) | |
| } | |
| vo = transferModelToVo(model) | |
| c.JSON(http.StatusOK, gin.H{"message": http.StatusOK, "result": vo}) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment