更换 web 框架
This commit is contained in:
@@ -1,23 +1,27 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo"
|
||||
"github.com/gin-gonic/gin"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const version = "/api/v1"
|
||||
const group = "/user"
|
||||
|
||||
type Controller struct {
|
||||
client *gorm.DB
|
||||
group string
|
||||
}
|
||||
|
||||
func (*Controller) GetLogin(ctx echo.Context) error {
|
||||
return ctx.String(http.StatusOK, "success")
|
||||
type PostLoginParam struct {
|
||||
account string `binding:"required"`
|
||||
password string `binding:"required"`
|
||||
}
|
||||
|
||||
func (s *Controller) RegisterRoute(echo *echo.Echo) {
|
||||
echo.GET("/login", s.GetLogin)
|
||||
func (c *Controller) PostLogin(ctx *gin.Context) {
|
||||
param := &PostLoginParam{}
|
||||
if err := ctx.ShouldBindJSON(¶m); err != nil {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// New 获取用户模块的控制器
|
||||
|
||||
Reference in New Issue
Block a user