Files
Crimson-Gatekeeper/srv/internal/user/controller.go

37 lines
642 B
Go
Raw Normal View History

2026-01-13 00:08:49 +08:00
package user
import (
2026-01-13 23:15:16 +08:00
"github.com/gin-gonic/gin"
2026-01-13 13:02:27 +08:00
"gorm.io/gorm"
2026-01-13 00:08:49 +08:00
)
2026-01-13 23:15:16 +08:00
const version = "/api/v1"
const group = "/user"
2026-01-13 13:02:27 +08:00
type Controller struct {
client *gorm.DB
}
2026-01-13 00:08:49 +08:00
2026-01-13 23:15:16 +08:00
type PostLoginParam struct {
account string `binding:"required"`
password string `binding:"required"`
2026-01-13 00:08:49 +08:00
}
2026-01-13 23:15:16 +08:00
func (c *Controller) PostLogin(ctx *gin.Context) {
param := &PostLoginParam{}
if err := ctx.ShouldBindJSON(&param); err != nil {
}
2026-01-13 13:02:27 +08:00
}
// New 获取用户模块的控制器
//
// 参数
// - gorm.DB 该模块所使用的数据库链接
//
// 返回值
// - Controller 控制器的实例指针
func New(client *gorm.DB) *Controller {
return &Controller{client}
2026-01-13 00:08:49 +08:00
}