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
package models | |
// Todo ... | |
type Todo struct { | |
ID uint `json:"id"` | |
Title string `json:"title"` | |
Description string `json:"description"` | |
} | |
// TableName use to specific table |
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
package main | |
import "fmt" | |
// Soldier use for all case here | |
type Soldier struct { | |
name string | |
corrupt bool | |
} |
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
package main | |
import "fmt" | |
type Soldier struct { | |
name string | |
corrupt bool | |
} | |
func buggyLoop(soldiers []Soldier) { |
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
package main | |
import ( | |
"github.com/gin-gonic/gin" | |
"github.com/krittawatcode/go-soldier-mvc/controller" | |
"github.com/krittawatcode/go-soldier-mvc/service" | |
) | |
func main() { | |
server := gin.Default() |
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
package cores | |
type Solider struct { | |
Rank string `json:"rank"` | |
Wife int `json:"wife"` | |
Salary int `json:"salary"` | |
Home bool `json:"home"` | |
Car bool `json:"car"` | |
Corruption bool `json:"corruption"` | |
} |
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
package service | |
import ( | |
"net/http" | |
"github.com/gin-gonic/gin" | |
"github.com/krittawatcode/go-soldier-mvc/cores" | |
) | |
// DutyService for define all service |
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
package controller | |
import ( | |
"strconv" | |
"github.com/gin-gonic/gin" | |
"github.com/krittawatcode/go-soldier-mvc/service" | |
) | |
type SoldierController interface { |
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
package middleware | |
import ( | |
"fmt" | |
"github/krittawatcode/go-jwt/src/service" | |
"net/http" | |
"github.com/dgrijalva/jwt-go" | |
"github.com/gin-gonic/gin" | |
) |
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
package main | |
import ( | |
"github/krittawatcode/go-jwt/src/controller" | |
"github/krittawatcode/go-jwt/src/middleware" | |
"github/krittawatcode/go-jwt/src/service" | |
"net/http" | |
"github.com/gin-gonic/gin" | |
) |
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
package controller | |
import ( | |
"github/krittawatcode/go-jwt/src/dto" | |
"github/krittawatcode/go-jwt/src/service" | |
"github.com/gin-gonic/gin" | |
) | |
//login contorller interface |