Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
README.md
go.mod
go.sum
service.go
service_impl.go

README.md

QSC BOX SDK V2

This is a demo project for impler.

Usage

This package supports upload/download functions of single file.

Interface

/*
@Base https://box.zjuqsc.com/item
 */
type Service interface {
	/*
	@Desc upload a file by file path
	@Post /add_item
	@File(file) {path}
	@Param(PHP_SESSION_UPLOAD_PROGRESS) qscbox
	@Param(filecount) 1
	@Param(callback) handleUploadCallback
	@Param(is_ie9) 0
	@Body multipart
	 */
	Upload(path string) (result *UploadResult, statusCode int, err error)

	/*
	@Desc change file status
	@Post /change_item
	@Param(new_token) {newToken}
	@Param(old_token) {oldToken}
	@Param(secure_id) {secureId}
	@Param(token_sec) {tokenSec}
	@Param(old_sec)   {oldSec}
	@Body form
	 */
	Change(newToken, jiami, oldToken, secureId, tokenSec, oldSec string, expiration int) (result *ChangeResult, statusCode int, err error)

	/*
	@Desc get file status
	@Get issec/{token}
	 */
	Stat(token string) (*http.Response, error)

	/*
	@Desc verify secure token
	@Get verify/{token}/{secToken}
	 */
	Verify(token, secToken string) (*http.Response, error)

	/*
	@Desc download a file
	@Get get/{token}
	 */
	Download(token string) (*http.Response, error)

	/*
	@Desc download a secure file
	@Get get/{token}/{secToken}
	 */
	DownloadSec(token, secToken string) (*http.Response, error)
}

Implement

service_impl.go is generated by impler

Get service by NewService()

result, statusCode, err := box.NewService().Upload("testAssets/avatar.jpg")
if err == nil {
    Deal(result)...	
}
You can’t perform that action at this time.