2021-12-13 21:39:15 +08:00
|
|
|
package handler
|
|
|
|
|
|
|
|
import (
|
2021-12-14 14:31:18 +08:00
|
|
|
"bgm/consts"
|
|
|
|
bgm "bgm/helper"
|
2021-12-13 21:39:15 +08:00
|
|
|
"bgm/model"
|
|
|
|
"bgm/service"
|
|
|
|
"github.com/gofiber/fiber/v2"
|
|
|
|
"github.com/rs/xid"
|
|
|
|
)
|
|
|
|
|
2021-12-14 14:31:18 +08:00
|
|
|
func CreateCategoryH(ctx *fiber.Ctx, mysqlMap bgm.MysqlMap) error {
|
2021-12-13 21:39:15 +08:00
|
|
|
category := &model.Category{
|
|
|
|
Key: 1,
|
|
|
|
Value: "默认",
|
|
|
|
Gid: xid.New().String(),
|
|
|
|
}
|
2021-12-14 14:31:18 +08:00
|
|
|
return service.CreateCategory(category, mysqlMap[consts.TestDB])
|
|
|
|
|
2021-12-13 21:39:15 +08:00
|
|
|
}
|