更换 web 框架

This commit is contained in:
des
2026-01-13 23:15:16 +08:00
parent a289a90676
commit c0054a9608
4 changed files with 116 additions and 20 deletions

View File

@@ -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(&param); err != nil {
}
}
// New 获取用户模块的控制器