mbfa

package
v0.15.108 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClaimantAsset added in v0.15.0

func ClaimantAsset(param ClaimantParam) error

func CreateAsset added in v0.15.0

func CreateAsset(param Asset) error

func CreateAssetType added in v0.15.0

func CreateAssetType(param Type) error

func CreateTemplate added in v0.15.0

func CreateTemplate(param Template) error

func DelAssetType added in v0.15.0

func DelAssetType(tangentId, id string) error

func DeleteAsset added in v0.15.0

func DeleteAsset(tangentId, id string) error

func DeleteTemplate added in v0.15.0

func DeleteTemplate(tangentId, id string) error

func Destroy

func Destroy()

func ExportData added in v0.15.0

func ExportData(param ExportParam) ([]byte, error)

func ExportTemplate added in v0.15.0

func ExportTemplate(param ExportParam) ([]byte, error)

func HandoverAsset added in v0.15.0

func HandoverAsset(param HandoverParam) error

func Import added in v0.15.0

func Import(param ImportParam) error

func ImportOwnerNames added in v0.15.0

func ImportOwnerNames(param ImportOwnerNamesParam) ([]string, error)

func Init

func Init(baseUrl string, timeoutSec time.Duration)

func ScrapAsset added in v0.15.0

func ScrapAsset(param ScrapParam) error

func SetAssetState added in v0.15.0

func SetAssetState(param SetStateParam) error

func UpdateAsset added in v0.15.0

func UpdateAsset(param Asset) error

func UpdateTemplate added in v0.15.0

func UpdateTemplate(param Template) error

Types

type Asset added in v0.15.0

type Asset struct {
	Id         string      `form:"id" json:"id,omitempty"`
	Code       string      `validator:"required,min=1,max=100" form:"code" json:"code,omitempty"`
	Name       string      `validator:"required,min=1,max=100" form:"name" json:"name,omitempty"`
	OwnerId    string      `form:"ownerId" json:"ownerId,omitempty"`
	OwnerName  string      `form:"ownerName" json:"ownerName,omitempty"`
	Pics       []string    `form:"pics" json:"pics,omitempty"`
	TangentId  string      `validator:"required,len=32" form:"tangentId" json:"tangentId,omitempty"`
	Items      []AssetItem `validator:"required" form:"items" json:"items,omitempty"`
	TemplateId string      `validator:"required,len=32" form:"templateId" json:"templateId,omitempty"`
	State      uint8       `json:"state,omitempty"`
}

type AssetInfo added in v0.15.0

type AssetInfo struct {
	Id         string      `json:"id"`
	Code       string      `json:"code"`
	Name       string      `json:"name"`
	OwnerId    string      `json:"ownerId"`
	OwnerName  string      `json:"ownerName"`
	Pics       []OssObj    `json:"pics"`
	TangentId  string      `json:"tangentId"`
	Items      []AssetItem `json:"items"`
	TemplateId string      `form:"templateId" json:"templateId"`
	State      uint8       `json:"state"`
}

type AssetItem added in v0.15.0

type AssetItem struct {
	TemplateItemId string `json:"templateItemId"`
	Label          string `json:"label"`
	V              string `json:"v"`
}

type Claimant added in v0.15.0

type Claimant struct {
	Id           string `json:"id"`
	AssetId      string `json:"assetId"`
	AssetCode    string `json:"assetCode"`
	AssetName    string `json:"assetName"`
	ClaimantId   string `json:"claimantId"`
	ClaimantName string `json:"claimantName"`
	Desc         string `json:"desc"`
	CreatedAt    string `json:"createdAt"`
}

type ClaimantParam added in v0.15.0

type ClaimantParam struct {
	TangentId string `validator:"required,len=32" json:"tangentId"`
	Id        string `validator:"required,len=32" json:"id"`
	OwnerId   string `validator:"required,len=32" json:"ownerId"`
	OwnerName string `validator:"required,max=20" json:"ownerName"`
	Desc      string `validator:"max=200" json:"desc"`
}

type ExportParam added in v0.15.0

type ExportParam struct {
	TangentId   string   `json:"tangentId"`
	TemplateIds []string `json:"templateIds"`
}

type GetAssetParam added in v0.15.0

type GetAssetParam struct {
	Asset
	State    string `form:"state"`
	PageNo   int    `form:"pageNo"`
	PageSize int    `form:"pageSize"`
}

type GetAssetTypesParams added in v0.15.0

type GetAssetTypesParams struct {
	Type
	PageNo   int `form:"pageNo"`
	PageSize int `form:"pageSize"`
}

type GetTemplateParam added in v0.15.0

type GetTemplateParam struct {
	TangentID string `form:"tangentId"`
	ID        string `form:"id"`
	Name      string `form:"name"`
	PageNo    int    `form:"pageNo"`
	PageSize  int    `form:"pageSize"`
}

type Handover added in v0.15.0

type Handover struct {
	Id           string `json:"id"`
	AssetId      string `json:"assetId"`
	AssetCode    string `json:"assetCode"`
	AssetName    string `json:"assetName"`
	ClaimantId   string `json:"claimantId"`
	ClaimantName string `json:"claimantName"`
	Handover     string `json:"handover"`
	HandoverName string `json:"handoverName"`
	Desc         string `json:"desc"`
	CreatedAt    string `json:"createdAt"`
}

type HandoverParam added in v0.15.0

type HandoverParam struct {
	TangentId string `validator:"required,len=32" json:"tangentId"`
	Id        string `validator:"required,len=32" json:"id"`
	OwnerId   string `validator:"required,len=32" json:"ownerId"`
	OwnerName string `validator:"required,max=20" json:"ownerName"`
	Desc      string `validator:"max=200" json:"desc"`
}

type ImportAsset added in v0.15.0

type ImportAsset struct {
	Id        string             `json:"id"`
	Name      string             `json:"name"`
	Code      string             `json:"code"`
	State     uint8              `json:"state"`
	OwnerName string             `json:"ownerName"`
	Items     []ImportAssetParam `json:"items"`
	Increment bool               `json:"increment"`
}

type ImportAssetParam added in v0.15.0

type ImportAssetParam struct {
	Label string `json:"label"`
	V     string `json:"v"`
}

type ImportOwnerNamesParam added in v0.15.0

type ImportOwnerNamesParam struct {
	TangentId string   `json:"tangentId"`
	ImportId  string   `json:"importId"`
	IgnoreIds []string `json:"ignoreIds"`
}

type ImportParam added in v0.15.0

type ImportParam struct {
	TangentId  string            `json:"tangentId"`
	ImportId   string            `json:"importId"`
	OwnerIdMap map[string]string `json:"ownerIdMap"`
	IgnoreIds  []string          `json:"ignoreIds"`
	Mode       uint8             `json:"mode"`
}

type LedgerParam added in v0.15.0

type LedgerParam struct {
	Name     string `form:"name"`
	Code     string `form:"code"`
	PageNo   int    `form:"pageNo"`
	PageSize int    `form:"pageSize"`
}

type OssObj added in v0.15.0

type OssObj struct {
	Url     string `json:"url"`
	ObjName string `json:"objName"`
}

type PreviewParam added in v0.15.0

type PreviewParam struct {
	TangentId string `json:"tangentId"`
	ObjName   string `json:"objName"`
}

type PreviewResult added in v0.15.0

type PreviewResult struct {
	ImportId string   `json:"importId"`
	Sheets   []string `json:"sheets"`
}

func Preview added in v0.15.0

func Preview(param PreviewParam) (*PreviewResult, error)

type Resp added in v0.15.0

type Resp[T any] struct {
	Data T      `json:"data"`
	Code int    `json:"code"`
	Suc  bool   `json:"success"`
	Msg  string `json:"msg"`
}

type Result added in v0.15.0

type Result[T any] struct {
	Info       []T `json:"info"`
	TotalCount int `json:"totalCount"`
	PageNo     int `json:"pageNo"`
}

func ClaimantLedger added in v0.15.0

func ClaimantLedger(param LedgerParam) (Result[Claimant], error)

func GetAsset added in v0.15.0

func GetAsset(param GetAssetParam) (Result[AssetInfo], error)

func GetAssetType added in v0.15.0

func GetAssetType(params GetAssetTypesParams) (Result[Type], error)

func GetTemplate added in v0.15.0

func GetTemplate(param GetTemplateParam) (Result[TemplateInfo], error)

func HandoverLedger added in v0.15.0

func HandoverLedger(param LedgerParam) (Result[Handover], error)

func PreviewImportAsset added in v0.15.0

func PreviewImportAsset(param SheetAssetsParam) (Result[ImportAsset], error)

func ScrapLedger added in v0.15.0

func ScrapLedger(param LedgerParam) (Result[Scrap], error)

func StateLedger added in v0.15.0

func StateLedger(param LedgerParam) (Result[State], error)

type Scrap added in v0.15.0

type Scrap struct {
	Id        string `json:"id"`
	AssetId   string `json:"assetId"`
	AssetCode string `json:"assetCode"`
	AssetName string `json:"assetName"`
	UserId    string `json:"userId"`
	UserName  string `json:"userName"`
	Desc      string `json:"desc"`
	CreatedAt string `json:"createdAt"`
}

type ScrapParam added in v0.15.0

type ScrapParam struct {
	TangentId string `validator:"required,len=32" json:"tangentId"`
	Id        string `validator:"required,len=32" json:"id"`
	Desc      string `validator:"max=200" json:"desc"`
}

type SetStateParam added in v0.15.0

type SetStateParam struct {
	TangentId string `validator:"required,len=32" json:"tangentId"`
	Id        string `validator:"required,len=32" json:"id"`
	Desc      string `validator:"max=200" json:"desc"`
	State     uint8  `validator:"required" json:"state"`
}

type SheetAssetsParam added in v0.15.0

type SheetAssetsParam struct {
	TangentId string `form:"tangentId"`
	ImportId  string `form:"importId"`
	Sheet     string `form:"sheet"`
	PageNo    int    `form:"pageNo"`
	PageSize  int    `form:"pageSize"`
}

type State added in v0.15.0

type State struct {
	Id          string `json:"id"`
	AssetId     string `json:"assetId"`
	AssetCode   string `json:"assetCode"`
	AssetName   string `json:"assetName"`
	BeforeState string `json:"beforeState"`
	AfterState  string `json:"afterState"`
	Desc        string `json:"desc"`
	CreatedAt   string `json:"createdAt"`
}

type Template added in v0.15.0

type Template struct {
	Id        string   `form:"id" json:"id"`
	Name      string   `form:"name" json:"name"`
	AssetType string   `form:"assetType" json:"assetType"`
	TangentId string   `form:"tangentId" json:"tangentId"`
	Desc      string   `validator:"max=80" form:"desc" json:"desc"`
	Items     []string `json:"items"`
}

type TemplateInfo added in v0.15.0

type TemplateInfo struct {
	Id        string         `form:"id" json:"id"`
	Name      string         `form:"name" json:"name"`
	AssetType string         `form:"assetType" json:"assetType"`
	TangentId string         `form:"tangentId" json:"tangentId"`
	Desc      string         `validator:"max=80" form:"desc" json:"desc"`
	Items     []TemplateItem `json:"items"`
}

type TemplateItem added in v0.15.0

type TemplateItem struct {
	Id    string `json:"id"`
	Label string `json:"label"`
}

type Type added in v0.15.0

type Type struct {
	Id        string `form:"id" json:"id"`
	Name      string `validator:"required,min=1,max=80" form:"name" json:"name"`
	Order     int    `form:"order" json:"order"`
	CanDel    bool   `form:"canDel" json:"canDel"`
	TangentId string `form:"tangentId" json:"tangentId"`
}

Jump to

Keyboard shortcuts

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