Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

1.3 KB
Raw Blame
// SiYuan - https://github.com/siyuan-note/siyuan
// Copyright (c) 2020-present, b3log.org
// SPDX-License-Identifier: AGPL-3.0-or-later

package apicontract

import "mime/multipart"

type PutFileRequest struct {
	IsDir   string                `json:"isDir" api:"optional"`
	App     string                `json:"app" api:"optional"`
	Path    string                `json:"path" api:"optional"`
	File    *multipart.FileHeader `json:"file" api:"optional,nonnullable"`
	ModTime string                `json:"modTime" api:"optional"`
}

type CopyFileRequest struct {
	Src  string `json:"src" api:"trim"`
	Dest string `json:"dest" api:"trim"`
}

type CopyFilesRequest struct {
	Srcs    []string `json:"srcs"`
	DestDir string   `json:"destDir"`
}

type FilePathRequest struct {
	Path string `json:"path" api:"trim"`
}
type FilePathData struct {
	Path string `json:"path"`
}
type ReadDirectoryRequest struct {
	Path string `json:"path"`
}
type DirectoryEntry struct {
	Name      string `json:"name"`
	IsDir     bool   `json:"isDir"`
	IsSymlink bool   `json:"isSymlink"`
	Updated   int64  `json:"updated"`
}
type RenameFileRequest struct {
	Path    string `json:"path" api:"trim"`
	NewPath string `json:"newPath" api:"trim"`
}
type RemoveFileRequest struct {
	App  string `json:"app" api:"optional,nullable"`
	Path string `json:"path" api:"trim"`
}