Loading...
Loading...
A professional guide that instructs developers on how to introduce and use the official SDK (@lazycatcloud/sdk) in Lazycat MicroServer applications, register file type associations (file_handler), and implement basic integrations.
npx skill4agent add whoamihappyhacking/lazycat-skills lazycat-sdk-devgrpc-webnpm install @lazycatcloud/sdkimport { lzcAPIGateway } from "@lazycatcloud/sdk"
// 初始化网关,使用当前页面的 origin (如 https://myapp.heiyu.space)
const lzcapi = new lzcAPIGateway(window.location.origin, false)
// 示例:获取微服内的应用列表
async function fetchApps() {
const apps = await lzcapi.pkgm.QueryApplication({ appidList: [] })
console.log(apps)
}go get -u gitee.com/linakesi/lzc-sdk/lang/goimport (
lzcsdk "gitee.com/linakesi/lzc-sdk/lang/go"
"gitee.com/linakesi/lzc-sdk/lang/go/common"
)
// 初始化 API
lzcapi, err := lzcsdk.NewAPIGateway(context.TODO())
// 示例:获取设备列表
request := &common.ListEndDeviceRequest{Uid: "admin"}
devices, err := lzcapi.Devices.ListEndDevices(ctx, request)file_handlerlzc-manifest.ymlfile_handlerapplicationapplication:
file_handler:
mime:
- text/markdown # 标准的 mime type
- x-lzc-extension/md # 或者指定具体的文件后缀 (懒猫特有语法)
# - */* # (高危) 匹配所有文件,适合"MD5计算器"等工具
actions:
# 当用户在网盘打开该文件时触发。%u 会被自动替换为实际的网盘文件路径。
open: /edit?filepath=%uhttps://your application domain/edit?filepath=/user/documents/test.mdfilepath/lzcapp/run/mnt/homelzc-file-pickerslzc-minidbreferences/