mbfa

package
v0.15.4-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAsset added in v0.15.0

func CreateAsset(param Asset) error

func CreateTemplate added in v0.15.0

func CreateTemplate(param Template) 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 Init

func Init(baseUrl string, timeoutSec time.Duration)

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"`
	FixedType  string      `validator:"required,min=1,max=50" json:"fixedType"`
	Items      []AssetItem `validator:"required" form:"items" json:"items,omitempty"`
	TemplateId string      `validator:"required,len=32" form:"templateId" json:"templateId,omitempty"`
	State      uint8       `form:"state" 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"`
	FixedType  string      `json:"fixedType"`
	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 GetAssetParam added in v0.15.0

type GetAssetParam struct {
	Asset
	State    []uint8 `form:"state"`
	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 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 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 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 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 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"`
	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"`
	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"`
}

Jump to

Keyboard shortcuts

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