mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-05 16:56:22 +00:00
⚡ implement user authentication and database initialization, add models for user, comment, label, and OIDC configuration
This commit is contained in:
@ -3,6 +3,8 @@ package v1
|
||||
import (
|
||||
"context"
|
||||
"github.com/cloudwego/hertz/pkg/app"
|
||||
"github.com/snowykami/neo-blog/internal/dto"
|
||||
"github.com/snowykami/neo-blog/pkg/resps"
|
||||
)
|
||||
|
||||
type userType struct{}
|
||||
@ -10,11 +12,13 @@ type userType struct{}
|
||||
var User = new(userType)
|
||||
|
||||
func (u *userType) Login(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: Impl
|
||||
var userLoginReq dto.UserLoginReq
|
||||
if err := c.BindAndValidate(&userLoginReq); err != nil {
|
||||
resps.BadRequest(c, resps.ErrParamInvalid)
|
||||
}
|
||||
}
|
||||
|
||||
func (u *userType) Register(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: Impl
|
||||
}
|
||||
|
||||
func (u *userType) Logout(ctx context.Context, c *app.RequestContext) {
|
||||
|
Reference in New Issue
Block a user