You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
753 B
Go
37 lines
753 B
Go
/**
|
|
* @Author: jager
|
|
* @Email: lhj168os@gmail.com
|
|
* @File: api
|
|
* @Date: 2021/12/31 2:34 下午
|
|
* @package: api
|
|
* @Version: v1.0.0
|
|
*
|
|
* @Description:
|
|
*
|
|
*/
|
|
|
|
package api
|
|
|
|
import (
|
|
"github.com/jageros/hawox/jwt"
|
|
"idata/internal/service/almanac"
|
|
"idata/internal/service/soup"
|
|
"idata/internal/service/user"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func Registry(engine *gin.Engine) {
|
|
r := engine.Group("/haw")
|
|
ur := r.Group("/user")
|
|
ur.POST("/register", user.Register)
|
|
ur.POST("/login", user.Login)
|
|
ur.GET("/info", jwt.CheckToken, user.Info)
|
|
ur.GET("/secret", jwt.CheckToken, user.Secret)
|
|
ur.GET("/open", jwt.CheckToken, user.OpenApi)
|
|
|
|
apiR := r.Group("/api")
|
|
apiR.GET("/soup", soup.GetRandSoup)
|
|
apiR.GET("/almanac", almanac.Almanac)
|
|
}
|