add backend tpl

This commit is contained in:
Rogee
2024-11-28 23:18:11 +08:00
parent 77e962b668
commit f7d95418a2
86 changed files with 3229 additions and 135 deletions

View File

@@ -0,0 +1,7 @@
package medias
import "github.com/gofiber/fiber/v3"
func GetMedias(c fiber.Ctx) error {
return c.SendString("medias")
}

View File

@@ -0,0 +1,7 @@
package medias
import "github.com/gofiber/fiber/v3"
func RegisterRoutes(app fiber.App) {
app.Get("/medias", GetMedias)
}

View File

@@ -0,0 +1,15 @@
package users
import "github.com/gofiber/fiber/v3"
type UserController struct {
userSvc *UserService
}
func GetUsers(c fiber.Ctx) error {
return c.SendString("users")
}
func GetCurrentUserInfo(c fiber.Ctx) error {
return c.SendString("current user info")
}

View File

@@ -0,0 +1,6 @@
package users
type CurrentUserInfo struct {
OpenID string `json:"open_id"`
Balance int8 `json:"balance"`
}

View File

@@ -0,0 +1 @@
package users

View File

@@ -0,0 +1,10 @@
package users
import "github.com/gofiber/fiber/v3"
func RegisterRoutes(app *fiber.App) {
group := app.Group("users")
// 获取当前用户信息
group.Get("/self", GetCurrentUserInfo)
}

View File

@@ -0,0 +1,7 @@
package users
type UserService struct{}
func (svc *UserService) GetUsers() string {
return "users"
}