mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-05 16:56:22 +00:00
⚡ add middleware for authentication and captcha, implement initial API routes for user, post, label, and page
This commit is contained in:
1
internal/controller/v1/comment.go
Normal file
1
internal/controller/v1/comment.go
Normal file
@ -0,0 +1 @@
|
||||
package v1
|
1
internal/controller/v1/file.go
Normal file
1
internal/controller/v1/file.go
Normal file
@ -0,0 +1 @@
|
||||
package v1
|
30
internal/controller/v1/label.go
Normal file
30
internal/controller/v1/label.go
Normal file
@ -0,0 +1,30 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/cloudwego/hertz/pkg/app"
|
||||
)
|
||||
|
||||
type labelType struct{}
|
||||
|
||||
var Label = new(labelType)
|
||||
|
||||
func (l *labelType) Create(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: Impl
|
||||
}
|
||||
|
||||
func (l *labelType) Delete(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: Impl
|
||||
}
|
||||
|
||||
func (l *labelType) Get(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: Impl
|
||||
}
|
||||
|
||||
func (l *labelType) Update(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: Impl
|
||||
}
|
||||
|
||||
func (l *labelType) List(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: Impl
|
||||
}
|
30
internal/controller/v1/page.go
Normal file
30
internal/controller/v1/page.go
Normal file
@ -0,0 +1,30 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/cloudwego/hertz/pkg/app"
|
||||
)
|
||||
|
||||
type pageType struct{}
|
||||
|
||||
var Page = new(pageType)
|
||||
|
||||
func (p *pageType) Create(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: Impl
|
||||
}
|
||||
|
||||
func (p *pageType) Delete(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: Impl
|
||||
}
|
||||
|
||||
func (p *pageType) Get(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: Impl
|
||||
}
|
||||
|
||||
func (p *pageType) Update(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: Impl
|
||||
}
|
||||
|
||||
func (p *pageType) List(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: Impl
|
||||
}
|
30
internal/controller/v1/post.go
Normal file
30
internal/controller/v1/post.go
Normal file
@ -0,0 +1,30 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/cloudwego/hertz/pkg/app"
|
||||
)
|
||||
|
||||
type postType struct{}
|
||||
|
||||
var Post = new(postType)
|
||||
|
||||
func (p *postType) Create(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: Impl
|
||||
}
|
||||
|
||||
func (p *postType) Delete(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: Impl
|
||||
}
|
||||
|
||||
func (p *postType) Get(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: Impl
|
||||
}
|
||||
|
||||
func (p *postType) Update(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: Impl
|
||||
}
|
||||
|
||||
func (p *postType) List(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: Impl
|
||||
}
|
42
internal/controller/v1/user.go
Normal file
42
internal/controller/v1/user.go
Normal file
@ -0,0 +1,42 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/cloudwego/hertz/pkg/app"
|
||||
)
|
||||
|
||||
type userType struct{}
|
||||
|
||||
var User = new(userType)
|
||||
|
||||
func (u *userType) Login(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: Impl
|
||||
}
|
||||
|
||||
func (u *userType) Register(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: Impl
|
||||
}
|
||||
|
||||
func (u *userType) Logout(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: Impl
|
||||
}
|
||||
|
||||
func (u *userType) OidcList(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: Impl
|
||||
}
|
||||
|
||||
func (u *userType) OidcLogin(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: Impl
|
||||
}
|
||||
|
||||
func (u *userType) Get(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: Impl
|
||||
}
|
||||
|
||||
func (u *userType) Update(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: Impl
|
||||
}
|
||||
|
||||
func (u *userType) Delete(ctx context.Context, c *app.RequestContext) {
|
||||
// TODO: Impl
|
||||
}
|
Reference in New Issue
Block a user