1234567891011121314151617181920 |
- package Controllers
- import (
- "github.com/gin-gonic/gin"
- "goLoad1/Config"
- "net/http"
- )
- type loginInfo struct {
- }
- func (con loginInfo) loginController(c *gin.Context) {
- userID := 1
- token, err := Config.CreateToken(userID)
- if err != nil {
- c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
- return
- }
- c.JSON(http.StatusOK, gin.H{"token": token})
- }
|