onebox

package module
v1.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APIEndpointGetAccount ใช้ค้นหาบัชญีผู้ใช้ด้วย User id เพื่อดูว่าผู้ใช้นั้นๆอยู่ใน Business อะไร
	APIEndpointGetAccount = `/onebox_uploads/api/v2/get_account_byuserid`
	// APIEndpointGetAccount ใช้สร้าง folder ใน onebox
	APIEndpointCreateFolder = `/onebox_uploads/api/create_folder`
	// APIEndpointGetAccount ใช้ ีupload base64 ขึ้นไปยัง onebox
	APIEndpointSaveBase64 = `/onebox_uploads/api/save_base64`
	// APIEndpointDownload ใช้ download เอกสาร
	APIEndpointDownload = `/onebox_downloads/api/v2/download_file`
	// APIEndpointDownload ใช้ download เอกสารเป็น base64
	APIEndpointDownloadBase64 = `/onebox_uploads/api/downloads_files_as_base64`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context interface {
	GetAccount(oneIDToken string, res *ResponseAccount) error
	CreateFolder(accountID string, parentFolderID string, folderName string, res *ResponseCreateFolder) error
	SavePDFbase64(data SavePDFBody, res *ResponseSaveFileBase64) error
	DownloadFile(string) (string, error)
	DownloadFileBase64(fileID string, accID string) (string, error)
}

func Init

func Init(host string, bearer string) Context

type Response

type Response struct {
	Result string `json:"result"`
	Data   struct {
		Download string `json:"download"`
	} `json:"data"`
	ErrorMessage    interface{} `json:"errorMessage"`
	Code            int         `json:"code"`
	ErrorCode       string      `json:"errorCode"`
	TransactionCode string      `json:"transaction_code"`
}

type ResponseAccount

type ResponseAccount struct {
	Result          []Result `json:"result"`
	Status          string   `json:"status"`
	TransactionCode string   `json:"transaction_code"`
	ErrorCode       string   `json:"errorCode"`
	ErrorMessage    string   `json:"errorMessage"`
}

type ResponseCreateFolder

type ResponseCreateFolder struct {
	Data struct {
		CreDtm         string `json:"cre_dtm"`
		FolderID       string `json:"folder_id"`
		FolderName     string `json:"folder_name"`
		ParentFolderID string `json:"parent_folder_id"`
	} `json:"data"`
	Message         string `json:"message"`
	Status          string `json:"status"`
	ErrorCode       string `json:"errorCode"`
	ErrorMessage    string `json:"errorMessage"`
	TransactionCode string `json:"transaction_code"`
}

type ResponseSaveFileBase64

type ResponseSaveFileBase64 struct {
	Data struct {
		SizeFile   string `json:"size_file"`
		ID         string `json:"id"`
		FolderName string `json:"folder_name"`
		StatusFile string `json:"status_file"`
	} `json:"data"`
	Message         string `json:"message"`
	Status          string `json:"status"`
	ErrorCode       string `json:"errorCode"`
	ErrorMessage    string `json:"errorMessage"`
	TransactionCode string `json:"transaction_code"`
}

type Result

type Result struct {
	AccountID   string      `json:"account_id"`
	AccountName string      `json:"account_name"`
	BranchNo    interface{} `json:"branch_no"`
	BusinessID  interface{} `json:"business_id"`
	Email       string      `json:"email"`
	Taxid       interface{} `json:"taxid"`
}

type SavePDFBody added in v1.0.2

type SavePDFBody struct {
	AccountID     string `json:"account_id"`
	FileName      string `json:"fileName"`
	FileExtension string `json:"fileExtension"`
	Base64        string `json:"base64"`
	FolderID      string `json:"folder_id"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL