package main

import (
	"log"
	"verification-platform-backend/internal/database"
	"verification-platform-backend/internal/model"
)

func main() {
	database.Init()

	log.Println("=== 更新云端函数文档 ===")

	var doc model.Doc
	if err := database.DB.Where("slug = ?", "dynamic-code").First(&doc).Error; err != nil {
		log.Printf("未找到文档: %v", err)
		return
	}

	doc.Title = "云端函数接口"
	doc.Slug = "cloud-function"
	doc.Summary = "云端函数允许开发者为应用创建自定义的业务逻辑，通过JavaScript代码实现灵活的数据处理和业务规则"

	if err := database.DB.Save(&doc).Error; err != nil {
		log.Printf("更新文档失败: %v", err)
		return
	}

	log.Println("云端函数文档更新成功")
}
