尝试引入 go-spring
This commit is contained in:
24
srv/internal/module/userpak/controller.go
Normal file
24
srv/internal/module/userpak/controller.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package userpak
|
||||
|
||||
import (
|
||||
"Crimson-Gatekeeper/internal/query"
|
||||
"fmt"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type UserCtl struct {
|
||||
q *query.Query
|
||||
}
|
||||
|
||||
func NewUserCtl(q *query.Query) *UserCtl {
|
||||
return &UserCtl{q}
|
||||
}
|
||||
|
||||
func (u *UserCtl) login(ctx *gin.Context) {
|
||||
lp := loginParam{}
|
||||
err := ctx.ShouldBindBodyWithJSON(&lp)
|
||||
if err != nil {
|
||||
fmt.Println("出错啦")
|
||||
}
|
||||
}
|
||||
6
srv/internal/module/userpak/param.go
Normal file
6
srv/internal/module/userpak/param.go
Normal file
@@ -0,0 +1,6 @@
|
||||
package userpak
|
||||
|
||||
type loginParam struct {
|
||||
Account string `json:"account"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
Reference in New Issue
Block a user