Documentation ¶
Overview ¶
Copyright 2018. box.la authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2018. box.la authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2018. box.la authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2018. box.la authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func AddBranch(name string, createdBy int64) error
- func AddRegistration(regid, applyer, captain, msg, applicant_account, password string) (err error)
- func AddTempTransferArrivedInfo(wdhash, txid string, arrived int64) error
- func AddTransferArrivedInfo(txInfo TradeInfo, wdhash, txid string, arrived int64) (err error)
- func ApplyTransfer(orderNumber, applyInfo, sign string, approversInfo FlowInfo, ...) error
- func ApprovalTransfer(transID, mAccID int64, progress int, signature, reason string) error
- func AttemptFrozen(appid string) (bool, int, error)
- func CancelTxApply(transID, accID int64, reason string) error
- func CaptainApprovalRegInfo(regid, consent string) error
- func ChangeAccBranch(appid, bid string) error
- func ChangeBranchIndex(index int64, branchInfo Branch) error
- func ChangeBranchName(bid, name string) error
- func ChangeEmployee(appid string, underEmployee []AccountInfo) error
- func DelBranch(bid string) error
- func DelRegistrationInfoByDateTime(start, end int64) error
- func DepositHistory(orderNum, toAddr, amount, txID string, currencyID int64, fromArry []string) error
- func DisableFlows() error
- func DisuseFlow(flowID string) error
- func FlowHashExist(hash string) (bool, error)
- func GenAccount(accountInfo AccountInfo, is_uploaded int) error
- func GenBusinessFlow(flowID, flowHash, flowName, flow, sign, singleLimit string, founderID int64, ...) (int, error)
- func GetRegistrationByRegIDWithAcc(regid string) (regInfoWithAcc, error)
- func GetTxInfoByApprover(appID string, transID int64) (int64, error)
- func GetTxProgress(flowContent []Approvalinfo, transID int64) (int, error)
- func InitManagerComments(flowContent []Approvalinfo, transID int64, location Location) error
- func InitTxAmount(currencyID, frozenTo int64, flowID string, amount_left float64) error
- func InvalidTx(flowid string) error
- func ModifyPwd(appid, newpwd string) error
- func ReleaseAmount(period string, currencyID int64, flowID string, amount float64) error
- func ReplaceEmployee(oAppid, dAppid string) error
- func ResetAttempts(appid string) error
- func ResetTxAmount(currencyID int64, flowID string, amount float64) error
- func TransferFailed(transID int64) error
- func UpdateAccountsPubkeyUploadInfo(accInfos []AccountInfo) error
- func UpdateCaptainApprovalInfo(regid, consent string) error
- func UpdateFlowAmount(timestamp int64) error
- func UpdateFlowStatus(id string, status int) error
- func UpdateFlowStatusByRPC() (bool, error)
- func UpdateTxAmount(currencyID int64, flowID string, new_amount_left float64, amountExp string) error
- func UpdateTxProgress(transID, progress int64) error
- type AccBriefInfo
- type AccountInfo
- func ChangeCipherInfo(employeeAccInfo []AccountInfo, cipherTexts []AccountInfo) []AccountInfo
- func GetAccDetailByAppID(appid string) (accountinfo AccountInfo, err error)
- func GetAccountInfoByAppID(appid string) (accountinfo AccountInfo, err error)
- func GetEmployeeEnPubKeyInfo(appid string) (AccountInfo, error)
- func GetEmployeeEnPubKeyInfoList(captainID string) ([]AccountInfo, error)
- func GetRootAccountByUnderlingAcc(lft, rgt int64) (AccountInfo, error)
- func GetUnderlingInfoByManagerAccountID(depth, lft, rgt int64) ([]AccountInfo, error)
- type AmountLeftInfo
- type Approvalinfo
- type Approver
- type Asset
- type Branch
- type CoinListInfo
- type CoinStatu
- type CurrencyInfo
- type EmployeeList
- type FlowContent
- type FlowInfo
- type FlowListInfo
- type Location
- type OpLog
- type PageCount
- type RPCFlowInfo
- type RegistrationInfo
- type TokenInfo
- type TokenListInfo
- type TradeHistory
- type TradeInfo
- type TransferContent
- type TransferInfo
- type TransferRecordInfo
- type TxApprovalInfo
- type TxRecordInfo
- type TxSignInfo
Constants ¶
const ( MAX_ATTEMPTS = 5 // 密码最多尝试次数 FROZEN_HOUR = 8 // 账户冻结周期 TOKEN_EXP = 24 // token有效周期 )
const ( TXTYPE_ID = 0 // 根据id获取转账信息 TXTYPE_ORDERNUM = 1 // 根据uuid获取转账信息 )
const ( FLOW_PENDING = 0 // 待审批 FLOW_REJECTED = 2 // 被拒绝 FLOW_APPROVALED = 3 // 审批通过 FLOW_INVALID = 4 // 作废 )
审批流状态
const ( TX_ALL = -1 // 所有状态 TX_WAITING = 0 // 待审批 TX_DOING = 1 // 审批中,转账中 TX_REJECTED = 2 // 拒绝 TX_APPROVALED = 3 // 审批通过 TX_CANCEL = 4 // 撤销 TX_INVALID = 5 // 作废 TX_END = -1 // 审批拒绝,转账失败 )
转账审批进度
Variables ¶
This section is empty.
Functions ¶
func AddRegistration ¶
记录注册申请
func AddTransferArrivedInfo ¶
记录提现到账信息
func ApplyTransfer ¶
func ApplyTransfer(orderNumber, applyInfo, sign string, approversInfo FlowInfo, transferContent TransferContent, applyerAccInfo AccountInfo, currencyInfo CurrencyInfo) error
提交转账申请
func ApprovalTransfer ¶
提交审批意见
func DelRegistrationInfoByDateTime ¶
删除多余的注册申请记录
func DepositHistory ¶
func DepositHistory(orderNum, toAddr, amount, txID string, currencyID int64, fromArry []string) error
记录充值记录
func DisableFlows ¶
func DisableFlows() error
func GenBusinessFlow ¶
func GenBusinessFlow(flowID, flowHash, flowName, flow, sign, singleLimit string, founderID int64, flowLimit []flowLimit, period string) (int, error)
生成审批流
func GetRegistrationByRegIDWithAcc ¶
账户对应的注册信息
func GetTxInfoByApprover ¶
获取员工待审批的转账信息
func GetTxProgress ¶
func GetTxProgress(flowContent []Approvalinfo, transID int64) (int, error)
func InitManagerComments ¶
func InitManagerComments(flowContent []Approvalinfo, transID int64, location Location) error
func InitTxAmount ¶
初始化额度
func ReleaseAmount ¶
释放转账额度
func UpdateAccountsPubkeyUploadInfo ¶
func UpdateAccountsPubkeyUploadInfo(accInfos []AccountInfo) error
func UpdateCaptainApprovalInfo ¶
记录上级审批记录结果
func UpdateFlowStatusByRPC ¶
Types ¶
type AccBriefInfo ¶
type AccBriefInfo struct { ID int64 AppID string Account string Depth int64 EmployeeNum int64 BranchID int64 }
账号简要信息
func GetAccountsListByBid ¶
func GetAccountsListByBid(bid string, lft, rgt int64) ([]AccBriefInfo, error)
type AccountInfo ¶
type AccountInfo struct { RegID string `json:"reg_id,omitempty"` Pubkey string `json:"pub_key,omitempty"` EnPubkey string `json:"msg,omitempty"` CipherText string `json:"cipher_text,omitempty"` AccLft int64 `json:"lft,omitempty"` AccRgt int64 `json:"rgt,omitempty"` Uploaded bool `json:"is_uploaded,omitempty"` Departured bool `json:"departured,omitempty"` ManagerAppID string `json:"manager_account_id"` ID int64 `json:"id,omitempty"` AppID string `json:"app_account_id,omitempty"` Account string `json:"account,omitempty"` Depth int64 `json:"depth,omitempty"` EmployeeNum int64 `json:"employee_num"` BranchID int64 BranchName string Frozen bool Attempts int FrozenTo int64 // contains filtered or unexported fields }
user ================================================================= 账户信息
func ChangeCipherInfo ¶
func ChangeCipherInfo(employeeAccInfo []AccountInfo, cipherTexts []AccountInfo) []AccountInfo
更新摘要信息
func GetAccDetailByAppID ¶
func GetAccDetailByAppID(appid string) (accountinfo AccountInfo, err error)
获取用户账号详情
func GetAccountInfoByAppID ¶
func GetAccountInfoByAppID(appid string) (accountinfo AccountInfo, err error)
根据appID获取账号信息
func GetEmployeeEnPubKeyInfo ¶
func GetEmployeeEnPubKeyInfo(appid string) (AccountInfo, error)
func GetEmployeeEnPubKeyInfoList ¶
func GetEmployeeEnPubKeyInfoList(captainID string) ([]AccountInfo, error)
func GetRootAccountByUnderlingAcc ¶
func GetRootAccountByUnderlingAcc(lft, rgt int64) (AccountInfo, error)
获取账号对应的根节点账号
func GetUnderlingInfoByManagerAccountID ¶
func GetUnderlingInfoByManagerAccountID(depth, lft, rgt int64) ([]AccountInfo, error)
上级获取下属账号信息
type AmountLeftInfo ¶
type AmountLeftInfo struct { FlowID string CurrencyID int64 Frozen bool FrozenTo int64 AmountLeft string Period int64 Amount string }
func TransferLimitByCurrencyID ¶
func TransferLimitByCurrencyID(currencyID int64, flowID string) (AmountLeftInfo, error)
查询转账额度
type Approvalinfo ¶
type Approver ¶
type Branch ¶
type Branch struct { ID int64 Name string Index int64 Employees int64 CreatedAt string UpdatedAt string EmployeesList []AccBriefInfo }
部门
type CurrencyInfo ¶
type CurrencyInfo struct { CurrencyID int64 `json:"currency_id"` Factor string `json:"factor"` Currency string `json:"currency"` Balance string `json:"balance"` Addr string `json:"address"` TokenAddr string `json:"tokenAddr"` }
币种信息
func GetCurrencyInfoByID ¶
func GetCurrencyInfoByID(currencyID string) (currencyInfo CurrencyInfo, err error)
func GetCurrencyInfoByName ¶
func GetCurrencyInfoByName(currency string) (currencyInfo CurrencyInfo, err error)
获取币种信息
func GetCurrencyList ¶
func GetCurrencyList(keywords string) (result []CurrencyInfo, err error)
获取币种列表
type EmployeeList ¶
type EmployeeList struct { PageCount List []AccountInfo `json:"list"` }
api struct =================================================================
func GetEmployeeAccInfoByCaptainID ¶
func GetEmployeeAccInfoByCaptainID(depth, c_lft, c_rgt, page, limit int64) (EmployeeList, error)
根据直属上级appid获取下属账号信息
func SearchAccountInfoByAccount ¶
func SearchAccountInfoByAccount(keywords string, page, limit int64) (data EmployeeList, err error)
搜索获取下属员工账号列表
type FlowContent ¶
type FlowContent struct { Name string `json:"flow_name"` SingleLimit string `json:"single_limit"` ApprovalInfo []Approvalinfo `json:"approval_info"` }
type FlowInfo ¶
type FlowInfo struct { ID string `json:"id"` FlowID string `json:"flow_id"` Hash string `json:"flow_hash"` Name string `json:"flow_name"` Progress int64 `json:"progress"` FounderID int64 `json:"founder_id"` ApprovalInfo []Approvalinfo `json:"approval_info"` SingleLimit string `json:"single_limit"` Period string `json:"period"` CreatedAt string `json:"created_at"` CreatedBy string `json:"createdBy"` UpdatedAt string `json:"updated_at"` ApprovalAt string `json:"approval_at"` FlowLimit []flowLimit `json:"flow_limit"` PendingTxNum int64 `json:"pending_tx_num"` }
business ================================================================= 审批流信息
type FlowListInfo ¶
func GetFlowList ¶
func GetFlowList(founderID, page, limit, statu int64, currencyName, currencyID string) (FlowListInfo, error)
func SearchFlowByName ¶
func SearchFlowByName(keywords string, founderID, page, limit, statu int64, currencyName, currencyID string) (FlowListInfo, error)
type Location ¶
func GetManagerLocation ¶
func GetManagerLocation(flowContent []Approvalinfo, appID string) Location
获取审批者在审批流中的位置
type OpLog ¶
func GetTxOperationHistoryByNum ¶
获取指定转账申请的操作记录
type RPCFlowInfo ¶
type RegistrationInfo ¶
type RegistrationInfo struct { ID int64 `json:"id,omitempty"` RegID string `json:"reg_id,omitempty"` Msg string `json:"msg,omitempty"` ApplicantID string `json:"applyer_id,omitempty"` CaptainID string `json:"manager_id,omitempty"` ApplicantAccount string `json:"applyer_account,omitempty"` Consent string `json:"consent,omitempty"` // contains filtered or unexported fields }
注册信息
func GetRegistrationByRegID ¶
func GetRegistrationByRegID(regid string, is_deleted int) (reginfo RegistrationInfo, err error)
根据registration_id获取注册申请
type TradeHistory ¶
func GetTradeHistoryListByAppID ¶
func GetTradeHistoryListByAppID(name string, id, page, limit int64) (TradeHistory, error)
获取交易记录
type TradeInfo ¶
type TradeInfo struct { Amount string `json:"amount"` Currency string `json:"currency"` ApplyAt int64 `json:"apply_at"` TradeType int64 `json:"type"` CurrencyID int64 `json:"currency_id"` // contains filtered or unexported fields }
func GetTransferInfoByWdHash ¶
获取转账记录详情
type TransferContent ¶
type TransferContent struct { TxInfo string `json:"tx_info"` // 申请理由 ToAddr string `json:"to_address"` // 目的地址 Miner string `json:"miner"` // 矿工费 Amount string `json:"amount"` // 转账金额 Currency string `json:"currency"` // 币种 ApplyTimestamp string `json:"timestamp"` // 申请时间戳 }
转账内容
type TransferInfo ¶
type TransferInfo struct { TxID int64 `json:"trans_id"` TxHash string `json:"transfer_hash"` Applyer string `json:"applyer"` ApplyerAppID string `json:"applyer_uid"` ApplyInfo string `json:"apply_info"` SingleLimit string `json:"single_limit"` ApprovalInfo []TxApprovalInfo `json:"approvaled_info"` CurrencyID int64 `json:"currency_id"` Amount string `json:"amount"` FlowName string `json:"flow_name"` // contains filtered or unexported fields }
转账信息
func GetTransferInfo ¶
func GetTransferInfo(orderNum string, orderType int) (flow_id string, txInfo TransferInfo, err error)
type TransferRecordInfo ¶
type TransferRecordInfo struct { PageCount List []TxRecordInfo `json:"list"` }
func GetTransferRecordListByCaptainID ¶
func GetTransferRecordListByCaptainID(accid, progress int64, page, limit string) (result TransferRecordInfo, err error)
根据审批者获取转账记录
func GetTransferRecordsListByApplyerID ¶
func GetTransferRecordsListByApplyerID(accid, progress int64, page, limit string) (result TransferRecordInfo, err error)
根据申请者获取转账记录
type TxApprovalInfo ¶
type TxApprovalInfo struct { Approvalinfo CurrentProgress int `json:"current_progress"` }
func GetApprovalInfoByTxID ¶
func GetApprovalInfoByTxID(flowInfo FlowInfo, txID int64) (approvalInfo []TxApprovalInfo, err error)
获取指定订单的审批详情
type TxRecordInfo ¶
type TxRecordInfo struct { Amount string `json:"amount"` Currency string `json:"currency"` ApplyAt int64 `json:"apply_at"` // contains filtered or unexported fields }
capital ================================================================= 转账记录
type TxSignInfo ¶
获取各级人员审批信息
func GetTxApproversSign ¶
func GetTxApproversSign(approvalInfo []Approvalinfo, transID int64) []TxSignInfo