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.

42 lines
976 B
Go

3 years ago
/**
* @Author: jager
* @Email: lhj168os@gmail.com
* @File: api
* @Date: 2021/12/31 2:34
* @package: api
* @Version: v1.0.0
*
* @Description:
*
*/
package api
import (
3 years ago
"github.com/gin-gonic/gin"
3 years ago
"github.com/jageros/hawox/jwt"
"idata/internal/service/almanac"
3 years ago
"idata/internal/service/dirty"
3 years ago
"idata/internal/service/network"
3 years ago
"idata/internal/service/soup"
"idata/internal/service/user"
)
func Registry(engine *gin.Engine) {
r := engine.Group("/haw")
ur := r.Group("/user")
ur.POST("/register", user.Register)
ur.POST("/login", user.Login)
3 years ago
ur.GET("/info", jwt.CheckToken, user.Info)
ur.GET("/secret", jwt.CheckToken, user.Secret)
3 years ago
ur.GET("/openapi", jwt.CheckToken, user.OpenApi)
3 years ago
apiR := r.Group("/api")
3 years ago
apiR.GET("/soup", soup.GetRandSoup)
3 years ago
apiR.GET("/almanac", almanac.Almanac)
3 years ago
apiR.GET("/dirty_word", dirty.IsDirtyWord)
3 years ago
apiR.GET("/my-ip", network.MyIp)
apiR.GET("/dns", network.Domain2IP)
apiR.GET("/domain", network.IP2Domain)
3 years ago
}