cmd

package
v0.0.0-...-dacdfb6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Main = gcmd.Command{
		Name:  "main",
		Usage: "main",
		Brief: "start http server",
		Func: func(ctx context.Context, parser *gcmd.Parser) (err error) {
			s := g.Server()
			s.Group("/", func(group *ghttp.RouterGroup) {

				group.Middleware(middleware.Response)
				group.Group("/admin", func(group *ghttp.RouterGroup) {
					group.Group("/", func(group *ghttp.RouterGroup) {
						group.Bind(login.NewV1())
					})
					group.Group("/", func(group *ghttp.RouterGroup) {
						group.Middleware(middleware.Auth)
						group.Group("/v1", func(group *ghttp.RouterGroup) {
							group.Bind(
								account.NewV1(),
								article.NewV1(),
								article_grp.NewV1(),
								file.NewV1(),
								saying.NewV1(),
								link.NewV1(),
								reply.NewV1(),
							)
						})
					})
				})

				group.Group("/app", func(group *ghttp.RouterGroup) {
					group.Bind(
						article.NewApp(),
						article_grp.NewApp(),
						reply.NewApp(),
						other.NewApp(),
					)
				})
			})
			s.Run()
			return nil
		},
	}
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL