Zeus/handler/category.go

21 lines
371 B
Go

package handler
import (
"bgm/consts"
bgm "bgm/helper"
"bgm/model"
"bgm/service"
"github.com/gofiber/fiber/v2"
"github.com/rs/xid"
)
func CreateCategoryH(ctx *fiber.Ctx, mysqlMap bgm.MysqlMap) error {
category := &model.Category{
Key: 1,
Value: "默认",
Gid: xid.New().String(),
}
return service.CreateCategory(category, mysqlMap[consts.TestDB])
}