package initialize

import (
	"context"

	"gorm.io/gorm"
	"kra/internal/data/model"
	"kra/internal/plugin/plugin-tool/utils"
)

func Api(ctx context.Context, db *gorm.DB) {
	entities := []model.SysAPI{
		{
			Path:        "/info/createInfo",
			Description: "新建公告",
			APIGroup:    "公告",
			Method:      "POST",
		},
		{
			Path:        "/info/deleteInfo",
			Description: "删除公告",
			APIGroup:    "公告",
			Method:      "DELETE",
		},
		{
			Path:        "/info/deleteInfoByIds",
			Description: "批量删除公告",
			APIGroup:    "公告",
			Method:      "DELETE",
		},
		{
			Path:        "/info/updateInfo",
			Description: "更新公告",
			APIGroup:    "公告",
			Method:      "PUT",
		},
		{
			Path:        "/info/findInfo",
			Description: "根据ID获取公告",
			APIGroup:    "公告",
			Method:      "GET",
		},
		{
			Path:        "/info/getInfoList",
			Description: "获取公告列表",
			APIGroup:    "公告",
			Method:      "GET",
		},
	}
	utils.RegisterApis(db, entities...)
}
