27 lines
476 B
Go
27 lines
476 B
Go
package handler
|
|
|
|
import (
|
|
"errors"
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
"myschools.me/campus/campus-core/campus"
|
|
)
|
|
|
|
func HealthCheck(c *gin.Context) {
|
|
|
|
c.JSON(http.StatusOK, nil)
|
|
}
|
|
|
|
func TokenVerify(c *gin.Context) {
|
|
|
|
reqid := campus.NewRequestID(nil)
|
|
token := c.GetHeader("Authorization")
|
|
if token != "112233" {
|
|
campus.RespBadRequest(c, "token err", errors.New("token err"), &reqid)
|
|
} else {
|
|
campus.RespSuccess(c, "helo_word", token+"helo_word", &reqid)
|
|
}
|
|
|
|
}
|