Documentation ¶
Overview ¶
Copyright 2018. bolaxy.org 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. bolaxy.org 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. bolaxy.org 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. bolaxy.org 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. bolaxy.org 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. bolaxy.org 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. bolaxy.org 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. bolaxy.org 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. bolaxy.org 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. bolaxy.org 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. bolaxy.org 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. bolaxy.org 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. bolaxy.org 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. bolaxy.org 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. bolaxy.org 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. bolaxy.org 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. bolaxy.org 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
- Variables
- type AccDBService
- func (*AccDBService) AccountByID(acc_id int) (*Account, error)
- func (*AccDBService) AccountByName(name string) ([]Account, error)
- func (*AccDBService) AccoutIsFrozen(name string) (int, time.Time, error)
- func (*AccDBService) AddAccount(account *Account) error
- func (*AccDBService) AddAdmin(accountID int) error
- func (*AccDBService) DelAdmin(accountID int) error
- func (*AccDBService) DelayTaskNum() (task DelayTask)
- func (*AccDBService) DisableAcc(accID int) error
- func (*AccDBService) ExistAccount(name string) (*Account, error)
- func (*AccDBService) FindAccountByAppId(appId string) (*Account, error)
- func (*AccDBService) FindAllUsers() ([]Account, error)
- func (*AccDBService) GetAccountsByType(userType int) ([]Account, error)
- func (*AccDBService) GetAdminCount() (count int, err error)
- func (*AccDBService) GetAllUsers() ([]Account, error)
- func (*AccDBService) GetPubkeys(name string) ([]Account, error)
- func (*AccDBService) GetSalt(name string) (string, string, error)
- func (*AccDBService) GetUserByID(id int) ([]Account, error)
- func (*AccDBService) IsOwner(name string) (bool, error)
- func (*AccDBService) Login(name string, pwd string) (bool, *Account, error)
- func (*AccDBService) ModifyPassword(name, new_pwd string) error
- func (*AccDBService) RecordAttempts(name string) (result int, frozentime time.Time)
- func (*AccDBService) ReplaceMsg(rep string, appId string) error
- func (*AccDBService) ResetAccount(appid string) (bool, error)
- func (*AccDBService) ResetAttempts(name string) error
- func (*AccDBService) SavePubkeySign(account *Account) error
- func (*AccDBService) SetUser(authID string, depID int, accID int, userType int) error
- func (*AccDBService) VerifyUser(account *Account, reg *Registration) bool
- type AccManageService
- func (*AccManageService) AddChildAccount(coinId, amount int, tag string, adds, deeps []string) int
- func (*AccManageService) AddressList(id int, condition string, page, tp int) ([]AsCapital, string, error)
- func (*AccManageService) AddressTopTen(id int) ([]AsCapital, string, error)
- func (*AccManageService) ApplyForContract() error
- func (*AccManageService) ChildStatistical(id int) (int, int)
- func (*AccManageService) ContractAddr() (*output, error)
- func (*AccManageService) CountAllChild(id int) (string, int, error)
- func (*AccManageService) FindAddressByAddress(addr string, coinName string) bool
- func (*AccManageService) FindAddressByBTCAddress(addr []string, coinId int) ([]Address, bool)
- func (*AccManageService) FindAddressById(id int) (*Address, error)
- func (*AccManageService) GetMasterAddress() []Address
- func (*AccManageService) MainAccAssets() (string, error)
- func (*AccManageService) MergeAccount(coinId, mold int, ids []int) int
- func (*AccManageService) SaveMasterAddress(address *Address) bool
- func (*AccManageService) SetTag(id int, tag string) int64
- func (*AccManageService) Statistical() []CoinAccount
- func (*AccManageService) TokenList(id int) ([]TokenBalance, error)
- func (*AccManageService) TokenRecord(id, coinId int) ([]TrRecord, error)
- func (*AccManageService) TransferRecord(id int) ([]TrRecord, error)
- func (*AccManageService) UpdateBalance(capital *Capital) bool
- type Account
- type Address
- type AddressJson
- type AddressSign
- type AddressSigns
- type ApprovalInfo
- type Approvers
- type AsCapital
- type AsyncBlockChain
- type Auth
- type AuthMap
- type AuthService
- func (*AuthService) AddAuthToAccount(add []int, id int) int
- func (*AuthService) AuthCheck(authType string, accountID int) error
- func (*AuthService) DelAuthFromAccount(authID int, accountID int) error
- func (*AuthService) GetAuthAccounts(id int) ([]Account, error)
- func (*AuthService) GetAuthAccountsCount(id int) int
- func (*AuthService) GetAuthByID(authID int) ([]Auth, error)
- func (*AuthService) GetAuthList() ([]Auth, error)
- func (*AuthService) GetAuthMapByAccID(accountID int) ([]AuthMap, error)
- type BalanceEntity
- type BaseServer
- type Capital
- type Coin
- type CoinAccount
- type CoinBalance
- type CoinService
- func (*CoinService) AddCoin(symbol, name string, precise int, tokenAddress string) error
- func (*CoinService) CoinBalance() ([]CoinBalance, error)
- func (*CoinService) CoinIsExist(address, name string) (bool, error)
- func (*CoinService) CoinList(typecoin int) ([]Coin, error)
- func (*CoinService) CoinListByTransfer() ([]CoinVo, error)
- func (*CoinService) CoinStauts(id, status int) (*Coin, error)
- func (*CoinService) GetCoinById(id int) (*Coin, error)
- func (*CoinService) GetCoins() ([]Coin, error)
- func (*CoinService) GetETH() (*Coin, error)
- func (*CoinService) QRcode(id int) (map[string]string, error)
- type CoinVo
- type Configs
- type ConfigsService
- type Content
- type DelayTask
- type DelayTasks
- type DepService
- func (d *DepService) AddDepartment(depName string, creatorID int) error
- func (*DepService) DelDepartment(id int) error
- func (*DepService) DepartmentList() ([]Department, error)
- func (*DepService) DepartmentNameExists(departmentName string, id int) (bool, error)
- func (*DepService) EditDepartment(dep *Department) error
- func (*DepService) GetAccountByDepartment(id int, authID int) ([]Account, []AuthMap, error)
- func (*DepService) GetDepAccCount(depID int) int
- func (*DepService) GetDepByID(id int) ([]Department, error)
- func (*DepService) GetDepCount() int
- func (d *DepService) SortDep(depID []string) error
- type Department
- type Deposit
- type DepositEntity
- type EthBalance
- type LogService
- type Logger
- type MergeAccount
- type Message
- type MessageService
- func (*MessageService) AddAdmin(ids []int, accountId int) error
- func (*MessageService) AddAuth(add, authIds []int, userType int, operator string) (err error)
- func (*MessageService) AysncBlockChainStatus(types int) (err error)
- func (*MessageService) CancelTemplate(opername, userAcc, name, id string) (err error)
- func (*MessageService) CancelTransfer(ApplyerId int, CoinName, Amount, id string, isCalcelUser bool) (err error)
- func (*MessageService) ChangeNode() (err error)
- func (*MessageService) DelAdmin(accountID, id int) (err error)
- func (*MessageService) DelAuth(authId, accountId, userType int, account string) (err error)
- func (*MessageService) FailVerifyTemp(opername, name, id string, creatorId int) (err error)
- func (*MessageService) FailVerifyTrans(CoinName, Amount, reason string, ApplyerId int, id string) (err error)
- func (*MessageService) GetMessageById(id int) (Message, error)
- func (*MessageService) LetterList() (msgListAsc []Message, msgListDesc []Message, err error)
- func (*MessageService) ReadLetter(id int, readers string) error
- func (*MessageService) SuccessVerifyTemp(name, id string, creatorId int) (err error)
- func (*MessageService) SuccessVerifyTrans(CoinName, Amount string, ApplyerId int, id string) (err error)
- func (*MessageService) TransferApprovalTimeOut(coinName, amount, transferId string, applyerId, warnType int) (err error)
- func (*MessageService) TransferFail(coinName, amount, transferId string, applyerId, warnType int) (err error)
- func (*MessageService) TransferFailOutOfDate(coinName, amount, transferId string, applyerId, warnType int) (err error)
- func (*MessageService) TransferPartialSuccessful(coinName, amount, orderId string, applyerId int) (err error)
- func (*MessageService) TransferSuccess(coinName, amount, orderId string, applyerId int) (err error)
- func (*MessageService) VoucherWarn(accountId, warnNum, pageType int, param_json string) (*Message, error)
- type MessageTitle
- type OrderDetail
- type OwnerOper
- type OwnerReg
- type RegDBService
- func (*RegDBService) ActiveRecovery(name string, regID int) error
- func (*RegDBService) AddReg(ownerReg *OwnerReg) (int, error)
- func (*RegDBService) AddUser(reg *Registration) error
- func (*RegDBService) AppIdExists(appId string) (bool, error)
- func (*RegDBService) CancelRecovery(account string) error
- func (*RegDBService) CheckRecovStatus(appID string) (int, error)
- func (*RegDBService) DuplicateName(account string) (bool, error)
- func (*RegDBService) EditUser(reg *Registration) error
- func (*RegDBService) FindUserByAppId(appId string) (*Registration, error)
- func (*RegDBService) GetRegList() ([]Registration, error)
- func (*RegDBService) HasRecovery(account string) (int, error)
- func (*RegDBService) NameExists(name string) (bool, error)
- func (*RegDBService) OperateStatus(account string, regID int) (int, error)
- func (*RegDBService) ReSignUp(appID string) error
- func (*RegDBService) RecoveryList() ([]OwnerReg, error)
- func (*RegDBService) RecoveryResult(regID int, appID string) ([]OwnerOper, error)
- func (*RegDBService) RegList(reg *Registration) ([]Registration, error)
- func (*RegDBService) RegStatus(regID int) (int, string, error)
- func (*RegDBService) ResetRecovery(account string) error
- func (*RegDBService) Sign(reg *Registration) error
- func (*RegDBService) SubRecovery(appID string, acc string, regID int) error
- func (*RegDBService) UpdateMsg(msg string, regID int) error
- func (*RegDBService) UpdateRecoveryStatus(regID int) error
- func (*RegDBService) VerifyRecovery(account string, status int, regID int, voucherStatus int) error
- type Registration
- type Replaced
- type TempList
- type Template
- type TemplateChain
- type TemplateContent
- type TemplateDBService
- func (*TemplateDBService) CancelTemplateAdnTxByIDs(hashs []string, template_statu int) ([]string, error)
- func (*TemplateDBService) CountTxByTempID(tempID string) (int, error)
- func (*TemplateDBService) Create(tc *TemplateContent, content string, creatorID int) (string, error)
- func (*TemplateDBService) DelayTaskNum(approverID int) (task DelayTask)
- func (*TemplateDBService) DisableTemplate(tIds, tHashs []string) ([]string, error)
- func (*TemplateDBService) FindTemByHashs(hash []string) ([]Template, error)
- func (*TemplateDBService) FindTemById(tem *Template, accountId int) (*TemplateVos, error)
- func (*TemplateDBService) FindTemlateById(template *Template) error
- func (*TemplateDBService) FindTemplateByHash(tem *Template) (*Template, bool)
- func (*TemplateDBService) FindTemplateById(tem *Template) (*Template, error)
- func (*TemplateDBService) FindTemplateByOrderId(orderId string) (*Template, bool)
- func (*TemplateDBService) FindTemplateView(tem *TemplateView) (*TemplateView, bool)
- func (*TemplateDBService) IntermediateStateHashList() ([]Template, error)
- func (*TemplateDBService) NameExists(name string) (bool, error)
- func (*TemplateDBService) TempStatistics(account string) (int, int, error)
- func (*TemplateDBService) TemplateList(types int, userType int, accountId int) ([]TempList, error)
- func (*TemplateDBService) TemplateListToUpload() ([]Template, error)
- func (*TemplateDBService) TemplateListTransfer(coinId int) ([]TempList, error)
- func (*TemplateDBService) TemplistListAvailableByApprover(approver string) ([]Template, error)
- func (*TemplateDBService) UpdateTemplateLimit()
- func (*TemplateDBService) UpdateTemplateStatus(hash string, status int) error
- type TemplateLimit
- type TemplateOper
- type TemplateOperDBService
- type TemplateView
- type TemplateVos
- type TokenBalance
- type TrRecord
- type Transfer
- type TransferDBService
- func (*TransferDBService) Apply(order *TransferOrder, transfers []*Transfer, approvers []*TransferReview, ...) bool
- func (*TransferDBService) BatchList(orderIds []string, account string) ([]TransferOrder, error)
- func (*TransferDBService) Cancel(order *TransferOrder) bool
- func (*TransferDBService) CreateWebTransfer(transfers *WebTransfers) error
- func (*TransferDBService) DelayTaskNum(account string) (task DelayTask)
- func (*TransferDBService) FindAllApprove(orderIds []string) ([]TransferReview, error)
- func (*TransferDBService) FindAllApproveByOrderId(orderId string) ([]*TransferReview, error)
- func (*TransferDBService) FindApply(orderIds string) (*TransferOrder, error)
- func (*TransferDBService) FindApplyList(types, applyId int, account string) ([]bachInfo, error)
- func (*TransferDBService) FindApplyLog(orderId string) ([]TransferReview, error)
- func (*TransferDBService) FindApproveByOrderId(tran *TransferOrder) ([]*TransferReview, error)
- func (*TransferDBService) FindOrderById(orderId string) (*TransferOrder, error)
- func (*TransferDBService) FindWebTransfer(transfers *WebTransfers) error
- func (*TransferDBService) Findapplybyid(id string) (*OrderDetail, error)
- func (*TransferDBService) GetApprovalStatus(id, account string) int
- func (*TransferDBService) GetBalanceStatus() []TransferOrder
- func (*TransferDBService) GetFirstOrder() *TransferOrder
- func (*TransferDBService) GetTemHashByOrderId(id string) (string, error)
- func (*TransferDBService) GetTransferByOrderId(orderId string) []Transfer
- func (*TransferDBService) RecoverAmount(order *TransferOrder) error
- func (*TransferDBService) UpdateBalanceStatus(id string) bool
- func (*TransferDBService) UpdateOrder(orderId string, status int)
- func (*TransferDBService) UpdateOrderExpire(transfer *Transfer)
- func (*TransferDBService) UpdateOrderStatus(orderId string, status int)
- func (*TransferDBService) UpdateTimeExpire() error
- func (*TransferDBService) UpdateTransfer(transfer *Transfer) bool
- func (*TransferDBService) UpdateWebTransfer(transfers *WebTransfers) error
- func (*TransferDBService) Verify(order *TransferOrder, transfer *Transfer, transferReview *TransferReview, ...) bool
- func (*TransferDBService) VerifyFailed(order *TransferOrder) bool
- type TransferOrder
- type TransferReview
- type TransferSend
- type TxApply
- type TxInfos
- type Txinfos
- type TxinfosService
- func (*TxinfosService) FindCoin(coinName string, tokenAddress string) (*Coin, int)
- func (*TxinfosService) FindDeposit() []DepositEntity
- func (*TxinfosService) FindTokenAddress(token string) []Txinfos
- func (*TxinfosService) FindTxinfos() []TxInfos
- func (*TxinfosService) GetBalanceList() []BalanceEntity
- func (*TxinfosService) SaveDeposit(deposit *Deposit)
- func (*TxinfosService) SumBalance() error
- func (*TxinfosService) UpadateConfigs(key string, value string) error
- func (*TxinfosService) UpdateBalance(capital *Capital)
- func (*TxinfosService) UpdateBalances(coinName string, address string, balance string)
- func (*TxinfosService) UpdateDeposit(deposit *Deposit)
- func (*TxinfosService) UpdateDeposits(coin *Coin)
- func (*TxinfosService) UpdateTokenBalance(maps map[string]string, token string)
- type WebTransfers
Constants ¶
const ( ETH_LINK = "https://etherscan.io/tx/" BTC_LINK = "https://www.blockchain.com/btc/tx/" LTC_LINK = "https://chainz.cryptoid.info/ltc/tx.dws?" AuthTypeZhPath = "./static/lang/auth/auth_zh.toml" AuthTypeEnPath = "./static/lang/auth/auth_en.toml" )
blockchain explorer url
Variables ¶
var AllMasterAddress map[string]string
var AsyncBlockChains = &AsyncBlockChain{}
var AuthMaps = make(map[string]map[string]interface{})
var BTCTransferCh = make(chan TransferSend, 10000)
var ConfigMap map[string]string
var ETHTransferCh = make(chan TransferSend, 20000)
var LTCTransferCh = make(chan TransferSend, 10000)
var MergeETHTransferCh = make(chan TransferSend, 1000)
var TemplateChains = TemplateChain{ Lock: new(sync.Mutex), TemplateChains: []Template{}, }
var USDT_PPID = ""
Functions ¶
This section is empty.
Types ¶
type AccDBService ¶
type AccDBService struct { }
func (*AccDBService) AccountByID ¶
func (*AccDBService) AccountByID(acc_id int) (*Account, error)
AccountByID find account by id
func (*AccDBService) AccountByName ¶
func (*AccDBService) AccountByName(name string) ([]Account, error)
AccountByName find account by account name
func (*AccDBService) AccoutIsFrozen ¶
AccoutIsFrozen check account is forzen
func (*AccDBService) AddAccount ¶
func (*AccDBService) AddAccount(account *Account) error
AddAccount add account info to db
func (*AccDBService) AddAdmin ¶
func (*AccDBService) AddAdmin(accountID int) error
AddAdmin set account as admin
func (*AccDBService) DelAdmin ¶
func (*AccDBService) DelAdmin(accountID int) error
DelAdmin remove admin
func (*AccDBService) DelayTaskNum ¶
func (*AccDBService) DelayTaskNum() (task DelayTask)
DelayTaskNum count todos(other account to be verified)
func (*AccDBService) DisableAcc ¶
func (*AccDBService) DisableAcc(accID int) error
DisableAcc disable account by id
func (*AccDBService) ExistAccount ¶
func (*AccDBService) ExistAccount(name string) (*Account, error)
ExistAccount check if account is existed and return salt
func (*AccDBService) FindAccountByAppId ¶
func (*AccDBService) FindAccountByAppId(appId string) (*Account, error)
FindAccountByAppId find account by app id
func (*AccDBService) FindAllUsers ¶
func (*AccDBService) FindAllUsers() ([]Account, error)
FindAllUsers get all account and order by level
func (*AccDBService) GetAccountsByType ¶
func (*AccDBService) GetAccountsByType(userType int) ([]Account, error)
GetAccountsByType get account info by user type 0: member, 1: admin, 2: owner
func (*AccDBService) GetAdminCount ¶
func (*AccDBService) GetAdminCount() (count int, err error)
GetAdminCount get admin count
func (*AccDBService) GetAllUsers ¶
func (*AccDBService) GetAllUsers() ([]Account, error)
GetAllUsers get all available accounts
func (*AccDBService) GetPubkeys ¶
func (*AccDBService) GetPubkeys(name string) ([]Account, error)
GetPubkeys get public keys by name
func (*AccDBService) GetSalt ¶
func (*AccDBService) GetSalt(name string) (string, string, error)
GetSalt get salt password
func (*AccDBService) GetUserByID ¶
func (*AccDBService) GetUserByID(id int) ([]Account, error)
GetUserByID get user info by id
func (*AccDBService) IsOwner ¶
func (*AccDBService) IsOwner(name string) (bool, error)
IsOwner check if user is owner by name
func (*AccDBService) ModifyPassword ¶
func (*AccDBService) ModifyPassword(name, new_pwd string) error
ModifyPassword modify password
func (*AccDBService) RecordAttempts ¶
func (*AccDBService) RecordAttempts(name string) (result int, frozentime time.Time)
RecordAttempts record incorrect password attempts
func (*AccDBService) ReplaceMsg ¶
func (*AccDBService) ReplaceMsg(rep string, appId string) error
ReplaceMsg 替换 msg
func (*AccDBService) ResetAccount ¶
func (*AccDBService) ResetAccount(appid string) (bool, error)
ResetAccount resume frozen account by app id
func (*AccDBService) ResetAttempts ¶
func (*AccDBService) ResetAttempts(name string) error
ResetAttempts resume frozen account by name
func (*AccDBService) SavePubkeySign ¶
func (*AccDBService) SavePubkeySign(account *Account) error
SavePubkeySign update msg(sign)
func (*AccDBService) VerifyUser ¶
func (*AccDBService) VerifyUser(account *Account, reg *Registration) bool
VerifyUser verify account and add user info to table account
type AccManageService ¶
type AccManageService struct { }
func (*AccManageService) AddChildAccount ¶
func (*AccManageService) AddChildAccount(coinId, amount int, tag string, adds, deeps []string) int
AddChildAccount add sub-address by coin id, auto set tag for created addresses
func (*AccManageService) AddressList ¶
func (*AccManageService) AddressList(id int, condition string, page, tp int) ([]AsCapital, string, error)
AddressList list of address info
func (*AccManageService) AddressTopTen ¶
func (*AccManageService) AddressTopTen(id int) ([]AsCapital, string, error)
AddressTopTen statistical the 10 assets address
func (*AccManageService) ApplyForContract ¶
func (*AccManageService) ApplyForContract() error
ApplyForContract When creating thetemplate flow for the first time, if there is no contract, you should apply to create contract from voucher.
func (*AccManageService) ChildStatistical ¶
func (*AccManageService) ChildStatistical(id int) (int, int)
ChildStatistical Statistical sub-account information
func (*AccManageService) ContractAddr ¶
func (*AccManageService) ContractAddr() (*output, error)
func (*AccManageService) CountAllChild ¶
func (*AccManageService) CountAllChild(id int) (string, int, error)
CountAllChild Statistical sub-address number and assets of them
func (*AccManageService) FindAddressByAddress ¶
func (*AccManageService) FindAddressByAddress(addr string, coinName string) bool
FindAddressByAddress get address detail info by address
func (*AccManageService) FindAddressByBTCAddress ¶
func (*AccManageService) FindAddressByBTCAddress(addr []string, coinId int) ([]Address, bool)
FindAddressByBTCAddress get the BTC and LTC address info by address
func (*AccManageService) FindAddressById ¶
func (*AccManageService) FindAddressById(id int) (*Address, error)
FindAddressById get the address info by address id
func (*AccManageService) GetMasterAddress ¶
func (*AccManageService) GetMasterAddress() []Address
GetMasterAddress get the main address infos of all coin
func (*AccManageService) MainAccAssets ¶
func (*AccManageService) MainAccAssets() (string, error)
MainAccAssets get the assets info of main address
func (*AccManageService) MergeAccount ¶
func (*AccManageService) MergeAccount(coinId, mold int, ids []int) int
func (*AccManageService) SaveMasterAddress ¶
func (*AccManageService) SaveMasterAddress(address *Address) bool
SaveMasterAddress save main address to db
func (*AccManageService) SetTag ¶
func (*AccManageService) SetTag(id int, tag string) int64
SetTag set tag for address
func (*AccManageService) Statistical ¶
func (*AccManageService) Statistical() []CoinAccount
Statistical Statistical account information
func (*AccManageService) TokenList ¶
func (*AccManageService) TokenList(id int) ([]TokenBalance, error)
TokenList token info list
func (*AccManageService) TokenRecord ¶
func (*AccManageService) TokenRecord(id, coinId int) ([]TrRecord, error)
func (*AccManageService) TransferRecord ¶
func (*AccManageService) TransferRecord(id int) ([]TrRecord, error)
TransferRecord transfer order info, include deposit and withdraw
func (*AccManageService) UpdateBalance ¶
func (*AccManageService) UpdateBalance(capital *Capital) bool
UpdateBalance update the balance by address
type Account ¶
type Account struct { ID int `gorm:"AUTO_INCREMENT"` AppId string `gorm:"column:appId"` Name string `gorm:"column:name"` Pwd string `gorm:"column:pwd"` Salt string `gorm:"column:salt"` PubKey string `gorm:"column:pubKey"` IsDeleted int `gorm:"column:isDeleted"` Msg string `gorm:"column:msg"` DepartmentId int `gorm:"column:departmentId"` UserType int `gorm:"column:userType"` Frozen int `gorm:"column:frozen"` Attempts int `gorm:"column:attempts"` FrozenTo time.Time `gorm:"column:frozenTo"` SourceAppId string `gorm:"column:sourceAppId"` Level int `gorm:"column:level"` CreatedAt time.Time `gorm:"column:createdAt"` UpdatedAt time.Time `gorm:"column:updatedAt"` }
account
type Address ¶
type Address struct { ID int Address string Type int CoinId int `gorm:"column:coinId"` Tag string TagIndex int `gorm:"column:tagIndex"` IsDeleted int `gorm:"column:isDeleted"` CoinName string `gorm:"column:coinName"` UsedBy int `gorm:"column:usedBy"` Deep string `gorm:"column:deep"` }
address
type AddressJson ¶
AddressJson represents the address of its deep info
type AddressSign ¶
type AddressSigns ¶
type AddressSigns struct { Account string `json:"account"` AddressInfo []AddressSign `json:"addressSign"` }
type ApprovalInfo ¶
ApprovalInfo represents the approval info defined for a template
type AsCapital ¶
type AsCapital struct { ID int // address id Address string // address Tag string // address tag Balance string // balance of the address Amount int // the number of address tags Type int // address type 0-master address 1-normal address 2-contract address TagIndex int `gorm:"column:tagIndex"` // tag index }
AsCapital represents the top 10 assets
type AsyncBlockChain ¶
type AsyncBlockChain struct { List []interface{} AggregatedStatus int }
type Auth ¶
type Auth struct { ID int `gorm:"AUTO_INCREMENT"` Name string `gorm:"column:name"` AuthType string `gorm:"column:authType"` }
auth
type AuthMap ¶
type AuthMap struct { ID int `gorm:"AUTO_INCREMENT"` AccountId int `gorm:"column:accountId"` AuthId int `gorm:"column:authId"` }
authmap
type AuthService ¶
type AuthService struct { }
AuthService db
func (*AuthService) AddAuthToAccount ¶
func (*AuthService) AddAuthToAccount(add []int, id int) int
AddAuthToAccount 账户添加权限
func (*AuthService) AuthCheck ¶
func (*AuthService) AuthCheck(authType string, accountID int) error
AuthCheck 权限检查
func (*AuthService) DelAuthFromAccount ¶
func (*AuthService) DelAuthFromAccount(authID int, accountID int) error
DelAuthFromAccount 移除账户权限
func (*AuthService) GetAuthAccounts ¶
func (*AuthService) GetAuthAccounts(id int) ([]Account, error)
GetAuthAccounts 获取单个权限下成员列表
func (*AuthService) GetAuthAccountsCount ¶
func (*AuthService) GetAuthAccountsCount(id int) int
GetAuthAccountsCount 获取指定权限下成员数
func (*AuthService) GetAuthByID ¶
func (*AuthService) GetAuthByID(authID int) ([]Auth, error)
GetAuthByID 获取单个权限
func (*AuthService) GetAuthList ¶
func (*AuthService) GetAuthList() ([]Auth, error)
GetAuthList 获取权限列表
func (*AuthService) GetAuthMapByAccID ¶
func (*AuthService) GetAuthMapByAccID(accountID int) ([]AuthMap, error)
GetAuthMapByAccID 获取用户所有权限
type BalanceEntity ¶
type BaseServer ¶
type Capital ¶
type Capital struct { ID int AddressID int `gorm:"column:addressId"` CoinName string `gorm:"column:coinName"` Balance string CoinId int `gorm:"column:coinId"` CreatedAt time.Time `gorm:"column:createdAt"` Address string `gorm:"column:address"` }
capital
type Coin ¶
type Coin struct { ID int `gorm:"AUTO_INCREMENT"` Name string `gorm:"column:name"` FullName string `gorm:"column:fullName"` Precise int `gorm:"column:precise"` Balance string `gorm:"column:balance"` TokenType int `gorm:"column:tokenType"` TokenAddress string `gorm:"column:tokenAddress"` Available int `gorm:"column:available"` }
coin
type CoinAccount ¶
type CoinAccount struct { ID int // currency id Name string // currency name Main int // number of main accounts Child int // number of sub accounts HasToken bool // whether it contains tokens HasMerge bool // whether it can be merged HasAddChild bool // whether it can add sub accounts }
CoinAccount represents the coin statistical data it is applicable to account and asset information corresponding to the statistical currency.
type CoinBalance ¶
type CoinBalance struct { Name string `gorm:"column:name"` Balance string `gorm:"column:balance"` FullName string `gorm:"column:fullName"` Id int }
CoinBalance the struct of balance info by coin
type CoinService ¶
type CoinService struct { }
func (*CoinService) AddCoin ¶
func (*CoinService) AddCoin(symbol, name string, precise int, tokenAddress string) error
AddCoin add noe token to this system
func (*CoinService) CoinBalance ¶
func (*CoinService) CoinBalance() ([]CoinBalance, error)
CoinBalance get all master coin balance info
func (*CoinService) CoinIsExist ¶
func (*CoinService) CoinIsExist(address, name string) (bool, error)
CoinIsExist check if the coin is existed by given token address and its name
func (*CoinService) CoinList ¶
func (*CoinService) CoinList(typecoin int) ([]Coin, error)
CoinList get the coin list from db
func (*CoinService) CoinListByTransfer ¶
func (*CoinService) CoinListByTransfer() ([]CoinVo, error)
CoinListByTransfer get coin info available
func (*CoinService) CoinStauts ¶
func (*CoinService) CoinStauts(id, status int) (*Coin, error)
CoinStauts enable or disable the given coin
func (*CoinService) GetCoinById ¶
func (*CoinService) GetCoinById(id int) (*Coin, error)
GetCoinById get coin info by id
func (*CoinService) GetCoins ¶
func (*CoinService) GetCoins() ([]Coin, error)
GetCoins get all coins
func (*CoinService) GetETH ¶
func (*CoinService) GetETH() (*Coin, error)
GetETH get eth info from db
type CoinVo ¶
type CoinVo struct { ID int Name string `gorm:"column:name"` FullName string `gorm:"column:fullName"` Precise int `gorm:"column:precise"` Balance string `gorm:"column:balance"` TokenType int `gorm:"column:tokenType"` TokenAddress string `gorm:"column:tokenAddress"` Available int `gorm:"column:available"` Currency string `gorm:"column:currency"` }
CoinVo coins info of available coin
type Configs ¶
type Configs struct { ID int Key string `gorm:"column:con_key"` Value string `gorm:"column:con_value"` }
configs
type ConfigsService ¶
type ConfigsService struct { }
type DelayTasks ¶
DelayTasks represents the struct of to-do task
type DepService ¶
type DepService struct { }
func (*DepService) AddDepartment ¶
func (d *DepService) AddDepartment(depName string, creatorID int) error
AddDepartment add new department
func (*DepService) DelDepartment ¶
func (*DepService) DelDepartment(id int) error
DelDepartment delete a existed department
func (*DepService) DepartmentList ¶
func (*DepService) DepartmentList() ([]Department, error)
DepartmentList get the existed department list
func (*DepService) DepartmentNameExists ¶
func (*DepService) DepartmentNameExists(departmentName string, id int) (bool, error)
DepartmentNameExists check if the department exists by given name and its id
func (*DepService) EditDepartment ¶
func (*DepService) EditDepartment(dep *Department) error
EditDepartment edit a existed department
func (*DepService) GetAccountByDepartment ¶
GetAccountByDepartment get all the members belong to the given department
func (*DepService) GetDepAccCount ¶
func (*DepService) GetDepAccCount(depID int) int
GetDepAccCount count the member of given department
func (*DepService) GetDepByID ¶
func (*DepService) GetDepByID(id int) ([]Department, error)
GetDepByID get the department info by given account
func (*DepService) GetDepCount ¶
func (*DepService) GetDepCount() int
GetDepCount count the existed department
func (*DepService) SortDep ¶
func (d *DepService) SortDep(depID []string) error
SortDep sort the department order by app
type Department ¶
type Department struct { ID int Name string CreatorAccId int `gorm:"column:creatorAccId"` Available int Order int `gorm:"column:order"` CreatedAt time.Time `gorm:"column:createdAt"` UpdatedAt time.Time `gorm:"column:updatedAt"` }
department
func (Department) TableName ¶
func (dep Department) TableName() string
type Deposit ¶
type Deposit struct { ID string CoinId int `gorm:"column:coinId"` CoinName string `gorm:"column:coinName"` FromAddr string `gorm:"column:fromAddr"` ToAddr string `gorm:"column:toAddr"` Amount string TxId string `gorm:"column:txId"` BlockNum string `gorm:"column:blockNumber"` Confirm int CreatedAt time.Time `gorm:"column:createdAt"` IsUpdate int `gorm:"column:isUpdate"` TokenAddress string `gorm:"column:tokenAddress"` Precise int `gorm:"column:precise"` UpdatedAt time.Time `gorm:"column:updatedAt"` }
deposit
type DepositEntity ¶
type DepositEntity struct { CoinName string `gorm:"column:coinName"` TokenType int `gorm:"column:tokenType"` TokenAddress string `gorm:"column:tokenAddress"` ToAddr string `gorm:"column:toAddr"` CoinId int `gorm:"column:coinId"` AddressId int `gorm:"column:addressId"` DepositId string `gorm:"column:depositId"` Confirm int `gorm:"column:confirm"` Nowconfirm int `gorm:"column:nowconfirm"` ExtValid int `gorm:"column:ext_valid"` Deep string `gorm:"column:deep"` }
type EthBalance ¶
type Logger ¶
type MergeAccount ¶
type MergeAccount struct { ToAddr string FromAddr string `gorm:"column:fromAddr"` CoinName string `gorm:"column:coinName"` Balance string `gorm:"column:balance"` Deep string `gorm:"column:deep"` TokenAddress string `gorm:"column:tokenAddress"` }
合并账户--------------------
type Message ¶
type Message struct { ID int `gorm:"AUTO_INCREMENT"` Title string `gorm:"column:title"` CreatedAt time.Time `gorm:"column:createdAt"` Content string `gorm:"column:content"` Padding string `gorm:"column:padding"` Receiver string `gorm:"column:receiver"` Reader string `gorm:"column:reader"` Type int `gorm:"column:type"` WarnType int `gorm:"column:warnType"` Param string `gorm:"column:param"` }
type MessageService ¶
type MessageService struct { }
func (*MessageService) AddAdmin ¶
func (*MessageService) AddAdmin(ids []int, accountId int) error
AddAdmin 添加管理员消息通知
func (*MessageService) AddAuth ¶
func (*MessageService) AddAuth(add, authIds []int, userType int, operator string) (err error)
AddAuth 添加权限消息
func (*MessageService) AysncBlockChainStatus ¶
func (*MessageService) AysncBlockChainStatus(types int) (err error)
func (*MessageService) CancelTemplate ¶
func (*MessageService) CancelTemplate(opername, userAcc, name, id string) (err error)
CancelTemplate 作废审批流消息
func (*MessageService) CancelTransfer ¶
func (*MessageService) CancelTransfer(ApplyerId int, CoinName, Amount, id string, isCalcelUser bool) (err error)
CancelTransfer 作废转账消息
func (*MessageService) DelAdmin ¶
func (*MessageService) DelAdmin(accountID, id int) (err error)
DelAdmin 取消管理员消息通知
func (*MessageService) DelAuth ¶
func (*MessageService) DelAuth(authId, accountId, userType int, account string) (err error)
DelAuth 取消权限消息
func (*MessageService) FailVerifyTemp ¶
func (*MessageService) FailVerifyTemp(opername, name, id string, creatorId int) (err error)
FailVerifyTemp 审批流 审批失败
func (*MessageService) FailVerifyTrans ¶
func (*MessageService) FailVerifyTrans(CoinName, Amount, reason string, ApplyerId int, id string) (err error)
FailVerifyTrans 转账审批失败消息
func (*MessageService) GetMessageById ¶
func (*MessageService) GetMessageById(id int) (Message, error)
GetMessageById get message info by id
func (*MessageService) LetterList ¶
func (*MessageService) LetterList() (msgListAsc []Message, msgListDesc []Message, err error)
LetterList 站内信列表
func (*MessageService) ReadLetter ¶
func (*MessageService) ReadLetter(id int, readers string) error
ReadLetter app read message
func (*MessageService) SuccessVerifyTemp ¶
func (*MessageService) SuccessVerifyTemp(name, id string, creatorId int) (err error)
SuccessVerifyTemp 审批流 审批成功
func (*MessageService) SuccessVerifyTrans ¶
func (*MessageService) SuccessVerifyTrans(CoinName, Amount string, ApplyerId int, id string) (err error)
SuccessVerifyTrans 转账审批成功消息
func (*MessageService) TransferApprovalTimeOut ¶
func (*MessageService) TransferApprovalTimeOut(coinName, amount, transferId string, applyerId, warnType int) (err error)
func (*MessageService) TransferFail ¶
func (*MessageService) TransferFail(coinName, amount, transferId string, applyerId, warnType int) (err error)
TransferFail 转账失败消息
func (*MessageService) TransferFailOutOfDate ¶
func (*MessageService) TransferFailOutOfDate(coinName, amount, transferId string, applyerId, warnType int) (err error)
TransferFailOutOfDate 由于过期而转账失败消息
func (*MessageService) TransferPartialSuccessful ¶
func (*MessageService) TransferPartialSuccessful(coinName, amount, orderId string, applyerId int) (err error)
TransferPartialSuccessful 部分转账成功
func (*MessageService) TransferSuccess ¶
func (*MessageService) TransferSuccess(coinName, amount, orderId string, applyerId int) (err error)
TransferSuccess 转账成功消息
func (*MessageService) VoucherWarn ¶
func (*MessageService) VoucherWarn(accountId, warnNum, pageType int, param_json string) (*Message, error)
VoucherWarn 签名机警告消息
type OrderDetail ¶
type OrderDetail struct { FullName string `gorm:"column:fullName"` CoinName string `gorm:"column:coinName"` ApplyerName string `gorm:"column:applyerName"` AppId string `gorm:"column:appId"` ApplyReason string `gorm:"column:applyReason"` Deadline time.Time `gorm:"column:deadline"` CreatedAt time.Time `gorm:"column:createdAt"` OrderAddress []interface{} StrTemplate string `gorm:"column:strtemplate"` Amount string `gorm:"column:amount"` Status int `gorm:"column:status"` NowLevel int `gorm:"column:nowLevel"` Msg string `gorm:"column:content"` ApprovalContent map[string]interface{} Template TemplateContent OrderId string `gorm:"column:orderId"` ApplySign string `gorm:"column:applySign"` }
type OwnerOper ¶
type OwnerReg ¶
type OwnerReg struct { ID int `gorm:"AUTO_INCREMENT"` Name string `gorm:"column:name"` Pwd string `gorm:"column:pwd"` Salt string `gorm:"column:salt"` AppId string `gorm:"column:appId"` PubKey string `gorm:"column:pubKey"` Status int `gorm:"column:status"` CreatedAt time.Time `gorm:"column:createdAt"` UpdatedAt time.Time `gorm:"column:updatedAt"` RefuseReason string `gorm:"column:refuseReason"` Msg string `gorm:"column:msg"` }
type RegDBService ¶
type RegDBService struct { }
func (*RegDBService) ActiveRecovery ¶
func (*RegDBService) ActiveRecovery(name string, regID int) error
ActiveRecovery 激活股东
func (*RegDBService) AddReg ¶
func (*RegDBService) AddReg(ownerReg *OwnerReg) (int, error)
AddReg 添加恢复股东注册信息
func (*RegDBService) AddUser ¶
func (*RegDBService) AddUser(reg *Registration) error
AddUser add new user account
func (*RegDBService) AppIdExists ¶
func (*RegDBService) AppIdExists(appId string) (bool, error)
AppIdExists check if account existed by appid
func (*RegDBService) CancelRecovery ¶
func (*RegDBService) CancelRecovery(account string) error
CancelRecovery 取消之前的申请
func (*RegDBService) CheckRecovStatus ¶
func (*RegDBService) CheckRecovStatus(appID string) (int, error)
CheckRecovStatus 查看恢复账号审批状态
func (*RegDBService) DuplicateName ¶
func (*RegDBService) DuplicateName(account string) (bool, error)
Duplicate 判断注册用户名是否重复
func (*RegDBService) EditUser ¶
func (*RegDBService) EditUser(reg *Registration) error
EditUser edit a user account
func (*RegDBService) FindUserByAppId ¶
func (*RegDBService) FindUserByAppId(appId string) (*Registration, error)
FindUserByAppId 通过appid查询注册状态
func (*RegDBService) GetRegList ¶
func (*RegDBService) GetRegList() ([]Registration, error)
GetRegList 获取扫码后注册用户列表
func (*RegDBService) HasRecovery ¶
func (*RegDBService) HasRecovery(account string) (int, error)
HasRecovery 是否有进行中的恢复申请
func (*RegDBService) NameExists ¶
func (*RegDBService) NameExists(name string) (bool, error)
NameExists check if account existed by name
func (*RegDBService) OperateStatus ¶
func (*RegDBService) OperateStatus(account string, regID int) (int, error)
OperateStatus 当前股东审批状态
func (*RegDBService) ReSignUp ¶
func (*RegDBService) ReSignUp(appID string) error
ReSignUp 重新注册用户(删除注册表中数据)
func (*RegDBService) RecoveryList ¶
func (*RegDBService) RecoveryList() ([]OwnerReg, error)
RecoveryList 获取待恢复股东列表
func (*RegDBService) RecoveryResult ¶
func (*RegDBService) RecoveryResult(regID int, appID string) ([]OwnerOper, error)
RecoveryResult 获取恢复股东认证结果
func (*RegDBService) RegList ¶
func (*RegDBService) RegList(reg *Registration) ([]Registration, error)
RegList 查询注册列表
func (*RegDBService) RegStatus ¶
func (*RegDBService) RegStatus(regID int) (int, string, error)
RegStatus 审批状态
func (*RegDBService) ResetRecovery ¶
func (*RegDBService) ResetRecovery(account string) error
ResetRecovery 重新注册恢复股东账户(状态为0的删除数据,其余不修改)
func (*RegDBService) SubRecovery ¶
func (*RegDBService) SubRecovery(appID string, acc string, regID int) error
SubRecovery 提交确认信息 (关系表初始化数据)
func (*RegDBService) UpdateMsg ¶
func (*RegDBService) UpdateMsg(msg string, regID int) error
UpdateMsg update owner message
func (*RegDBService) UpdateRecoveryStatus ¶
func (*RegDBService) UpdateRecoveryStatus(regID int) error
UpdateRecoveryStatus 更新恢复股东申请状态
func (*RegDBService) VerifyRecovery ¶
VerifyRecovery 认证股东
type Registration ¶
type Registration struct { ID int `gorm:"AUTO_INCREMENT"` Name string `gorm:"column:name"` Pwd string `gorm:"column:pwd"` Salt string `gorm:"column:salt"` SourceAppId string `gorm:"column:sourceAppId"` SourceAccount string `gorm:"column:sourceAccount"` AppId string `gorm:"column:appId"` PubKey string `gorm:"column:pubKey"` Status int `gorm:"column:status"` Msg string `gorm:"column:msg"` CreatedAt time.Time `gorm:"column:createdAt"` UpdatedAt time.Time `gorm:"column:updatedAt"` RefuseReason string `gorm:"column:refuseReason"` Level int `gorm:"column:level"` }
registration
func (Registration) TableName ¶
func (dep Registration) TableName() string
type Template ¶
type Template struct { ID string `gorm:"column:id"` Hash string Name string CreatorID int `gorm:"column:creatorId"` Content string Status int Period int CreatedAt time.Time `gorm:"column:createdAt"` UpdatedAt time.Time `gorm:"column:updatedAt"` }
template
type TemplateChain ¶
func (*TemplateChain) GetTemplateChain ¶
func (this *TemplateChain) GetTemplateChain() []Template
func (*TemplateChain) SetTemplateChain ¶
func (this *TemplateChain) SetTemplateChain(tem Template)
type TemplateContent ¶
type TemplateContent struct { Name string `json:"name"` Period int `json:"period"` ApprovalInfo []ApprovalInfo `json:"approvalInfo"` LimitInfo []TemplateLimit `json:"limitInfo"` }
TemplateContent represents the template content struct
type TemplateDBService ¶
type TemplateDBService struct { }
func (*TemplateDBService) CancelTemplateAdnTxByIDs ¶
func (*TemplateDBService) CancelTemplateAdnTxByIDs(hashs []string, template_statu int) ([]string, error)
CancelTemplateAdnTxByIDs 根据ID批量作废审批流模板
func (*TemplateDBService) CountTxByTempID ¶
func (*TemplateDBService) CountTxByTempID(tempID string) (int, error)
CountTxByTempID 根据审批流统计转账
func (*TemplateDBService) Create ¶
func (*TemplateDBService) Create(tc *TemplateContent, content string, creatorID int) (string, error)
Create create a new template
func (*TemplateDBService) DelayTaskNum ¶
func (*TemplateDBService) DelayTaskNum(approverID int) (task DelayTask)
DelayTaskNum 统计待审批数量
func (*TemplateDBService) DisableTemplate ¶
func (*TemplateDBService) DisableTemplate(tIds, tHashs []string) ([]string, error)
DisableTemplate disable template by given ids
func (*TemplateDBService) FindTemByHashs ¶
func (*TemplateDBService) FindTemByHashs(hash []string) ([]Template, error)
FindTemByHashs 根据hash查询审批
func (*TemplateDBService) FindTemById ¶
func (*TemplateDBService) FindTemById(tem *Template, accountId int) (*TemplateVos, error)
FindTemById 根据id查询审批
func (*TemplateDBService) FindTemlateById ¶
func (*TemplateDBService) FindTemlateById(template *Template) error
FindTemlateById grep template by id
func (*TemplateDBService) FindTemplateByHash ¶
func (*TemplateDBService) FindTemplateByHash(tem *Template) (*Template, bool)
FindTemplateByHash 根据temid查询审批
func (*TemplateDBService) FindTemplateById ¶
func (*TemplateDBService) FindTemplateById(tem *Template) (*Template, error)
FindTemplateById 根据id查询审批
func (*TemplateDBService) FindTemplateByOrderId ¶
func (*TemplateDBService) FindTemplateByOrderId(orderId string) (*Template, bool)
FindTemplateByOrderId 根据orderid查询审批
func (*TemplateDBService) FindTemplateView ¶
func (*TemplateDBService) FindTemplateView(tem *TemplateView) (*TemplateView, bool)
FindTemplateView 根据temid 和 coinid查询审批额度
func (*TemplateDBService) IntermediateStateHashList ¶
func (*TemplateDBService) IntermediateStateHashList() ([]Template, error)
IntermediateStateHashList 获取中间状态的审批流模板列表
func (*TemplateDBService) NameExists ¶
func (*TemplateDBService) NameExists(name string) (bool, error)
NameExists check if the template name exists
func (*TemplateDBService) TempStatistics ¶
func (*TemplateDBService) TempStatistics(account string) (int, int, error)
TempStatistics 审批流统计
func (*TemplateDBService) TemplateList ¶
TemplateList 审批流列表 types :0.全部 1.等待审批
func (*TemplateDBService) TemplateListToUpload ¶
func (*TemplateDBService) TemplateListToUpload() ([]Template, error)
获取待上链的审批流模板
func (*TemplateDBService) TemplateListTransfer ¶
func (*TemplateDBService) TemplateListTransfer(coinId int) ([]TempList, error)
TemplateListTransfer 审批流列表--转账专用
func (*TemplateDBService) TemplistListAvailableByApprover ¶
func (*TemplateDBService) TemplistListAvailableByApprover(approver string) ([]Template, error)
TemplistListAvailable 可用的审批流模板列表
func (*TemplateDBService) UpdateTemplateLimit ¶
func (*TemplateDBService) UpdateTemplateLimit()
UpdateTemplateLimit 通过截止时间更新币种额度
func (*TemplateDBService) UpdateTemplateStatus ¶
func (*TemplateDBService) UpdateTemplateStatus(hash string, status int) error
UpdateTemplateStatus 更新审批流模板状态
type TemplateLimit ¶
type TemplateLimit struct { TokenAddress string `json:"tokenAddress"` Symbol string `json:"symbol"` FullName string `json:"name"` Decimal int `json:"precise"` Limit string `json:"limit"` }
TemplateLimit represents the transfer limit amount information for every coin of the template
type TemplateOper ¶
type TemplateOper struct { ID string `gorm:"column:id"` TemplateId string `gorm:"column:templateId"` AccountId int `gorm:"column:accountId"` Status int `gorm:"column:status"` CreatedAt time.Time `gorm:"column:createdAt"` AppId string `gorm:"column:appId"` AppName string `gorm:"column:appName"` Sign string `gorm:"column:sign"` Reason string `gorm:"column:reason"` }
templateOper
func (TemplateOper) TableName ¶
func (templateOper TemplateOper) TableName() string
type TemplateOperDBService ¶
type TemplateOperDBService struct { }
func (*TemplateOperDBService) FindTemOperById ¶
func (*TemplateOperDBService) FindTemOperById(TemplateId string) []TemplateOper
FindTemOperById 通过模板id查询所有股东的操作
func (*TemplateOperDBService) TemApprovalInfoByAccId ¶
func (*TemplateOperDBService) TemApprovalInfoByAccId(templateID string, accID int) (*TemplateOper, error)
TemApprovalInfoByAccId 是否重复提交审批模板意见
func (*TemplateOperDBService) VerifyTem ¶
func (*TemplateOperDBService) VerifyTem(template *Template, templateOper *TemplateOper) bool
VerifyTem 审核模板
type TemplateView ¶
type TemplateView struct { TemplateId string `gorm:"column:templateId"` CoinId int `gorm:"column:coinId"` ReferAmount string `gorm:"column:referAmount"` AmountLimit string `gorm:"column:amountLimit"` Referspan int FrozenTo time.Time `gorm:"column:frozenTo"` }
templateView
func (TemplateView) TableName ¶
func (tv TemplateView) TableName() string
type TemplateVos ¶
type TemplateVos struct { ID string Hash string Name string CreatorID int Content string Status int Period int CreatedAt time.Time UpdatedAt time.Time ApproveStatus int }
template
type TokenBalance ¶
type TokenBalance struct { CoinName string `gorm:"column:coinName"` // coin name CoinId int `gorm:"column:coinId"` // coin id in sql Balance string `gorm:"column:balance"` // balance of the coin }
TokenBalance represents the struct of the balance of tokens
type TrRecord ¶
type TrRecord struct { ApplyReason string `gorm:"column:applyReason"` // reason to apply this transfer Status int `gorm:"column:status"` // status of this record 0-Approval 1-Approved 2-Reject 3-Transfer pending 4-Transfer failed // 5.Transfer success 6-Cancel 7-Invalid 8-Approval Expired 9-Transfer Expired 10-Disable User // 11-Disable template 12-Insufficient balance 100-Deposit success Amount string `gorm:"column:amount"` // transfer amount CreatedAt time.Time `gorm:"column:createdAt"` // Order creation time Precise int `gorm:"column:precise"` // Coin accuracy Type int // data type 0-deposit 1-transfer Link string // transfer id info on blockchain explorer TxID string `gorm:"column:txId"` // transfer id on blockchain }
TrRecord represents the struct of transfer record info
type Transfer ¶
type Transfer struct { ID string CoinName string `gorm:"column:coinName"` Amount string Status int TxId string `gorm:"column:txId"` ToAddr string `gorm:"column:toAddress"` FromAddr string `gorm:"column:fromAddress"` Accepted int OrderId string `gorm:"column:orderId"` Tag string CreatedAt time.Time `gorm:"column:createdAt"` UpdatedAt time.Time `gorm:"column:updatedAt"` ApplyReason string `gorm:"column:applyReason"` AmountIndex int `gorm:"column:amountIndex"` Types int `gorm:"column:types"` Msg string `gorm:"column:msg"` FromAddress string `gorm:"column:fromAddress"` }
transfer
type TransferDBService ¶
type TransferDBService struct { }
func (*TransferDBService) Apply ¶
func (*TransferDBService) Apply(order *TransferOrder, transfers []*Transfer, approvers []*TransferReview, temView *TemplateView) bool
Apply 申请转账
func (*TransferDBService) BatchList ¶
func (*TransferDBService) BatchList(orderIds []string, account string) ([]TransferOrder, error)
func (*TransferDBService) Cancel ¶
func (*TransferDBService) Cancel(order *TransferOrder) bool
Cancel
func (*TransferDBService) CreateWebTransfer ¶
func (*TransferDBService) CreateWebTransfer(transfers *WebTransfers) error
CreateWebTransfer
func (*TransferDBService) DelayTaskNum ¶
func (*TransferDBService) DelayTaskNum(account string) (task DelayTask)
DelayTaskNum 统计待审批数量和最新的待审批
func (*TransferDBService) FindAllApprove ¶
func (*TransferDBService) FindAllApprove(orderIds []string) ([]TransferReview, error)
FindAllApprove 获取所有待审批审批人
func (*TransferDBService) FindAllApproveByOrderId ¶
func (*TransferDBService) FindAllApproveByOrderId(orderId string) ([]*TransferReview, error)
FindAllApproveByOrderId 通过orderid查询所有层所有审批人
func (*TransferDBService) FindApply ¶
func (*TransferDBService) FindApply(orderIds string) (*TransferOrder, error)
FindApply 通过id查找转账订单
func (*TransferDBService) FindApplyList ¶
func (*TransferDBService) FindApplyList(types, applyId int, account string) ([]bachInfo, error)
FindApplyList 获取转账列表 1.全部 2.发起的 3.参与的 4.批量
func (*TransferDBService) FindApplyLog ¶
func (*TransferDBService) FindApplyLog(orderId string) ([]TransferReview, error)
FindApplyLog 查询转账log
func (*TransferDBService) FindApproveByOrderId ¶
func (*TransferDBService) FindApproveByOrderId(tran *TransferOrder) ([]*TransferReview, error)
FindApproveByOrderId 通过orderid查询该层所有审批人 tran.NowLevel:
0 所有 其他第几层
func (*TransferDBService) FindOrderById ¶
func (*TransferDBService) FindOrderById(orderId string) (*TransferOrder, error)
FindOrderById 通过id查找订单
func (*TransferDBService) FindWebTransfer ¶
func (*TransferDBService) FindWebTransfer(transfers *WebTransfers) error
func (*TransferDBService) Findapplybyid ¶
func (*TransferDBService) Findapplybyid(id string) (*OrderDetail, error)
Findapplybyid 转账申请明细
func (*TransferDBService) GetApprovalStatus ¶
func (*TransferDBService) GetApprovalStatus(id, account string) int
GetApprovalStatus 查询审批人的审批状态
func (*TransferDBService) GetBalanceStatus ¶
func (*TransferDBService) GetBalanceStatus() []TransferOrder
GetBalanceStatus 获取应该更新余额的转账
func (*TransferDBService) GetFirstOrder ¶
func (*TransferDBService) GetFirstOrder() *TransferOrder
GetFirstOrder 获取一条不是最终状态的订单
func (*TransferDBService) GetTemHashByOrderId ¶
func (*TransferDBService) GetTemHashByOrderId(id string) (string, error)
GetTemHashByOrderId 获取模版hash
func (*TransferDBService) GetTransferByOrderId ¶
func (*TransferDBService) GetTransferByOrderId(orderId string) []Transfer
GetTransferByOrderId 获取一个订单里的所有转账列表
func (*TransferDBService) RecoverAmount ¶
func (*TransferDBService) RecoverAmount(order *TransferOrder) error
RecoverAmount 恢复额度
func (*TransferDBService) UpdateBalanceStatus ¶
func (*TransferDBService) UpdateBalanceStatus(id string) bool
UpdateBalanceStatus 更新转账余额
func (*TransferDBService) UpdateOrder ¶
func (*TransferDBService) UpdateOrder(orderId string, status int)
UpdateOrder
func (*TransferDBService) UpdateOrderExpire ¶
func (*TransferDBService) UpdateOrderExpire(transfer *Transfer)
UpdateOrderExpire 更新
func (*TransferDBService) UpdateOrderStatus ¶
func (*TransferDBService) UpdateOrderStatus(orderId string, status int)
UpdateOrderStatus 更新订单
func (*TransferDBService) UpdateTimeExpire ¶
func (*TransferDBService) UpdateTimeExpire() error
func (*TransferDBService) UpdateTransfer ¶
func (*TransferDBService) UpdateTransfer(transfer *Transfer) bool
转账更新 timer专用
func (*TransferDBService) UpdateWebTransfer ¶
func (*TransferDBService) UpdateWebTransfer(transfers *WebTransfers) error
func (*TransferDBService) Verify ¶
func (*TransferDBService) Verify(order *TransferOrder, transfer *Transfer, transferReview *TransferReview, approvers []*TransferReview, isOver bool) bool
Verify verify transfer params :
order : 更新订单状态 (可选) transfer : 更新转账列表的状态 (可选) transferReview : 更新审批人的操作 (必选) approvers :如果当前操作的人是该层的最后一个审批人,且还有下一层,则将下一层的审批人插入数据库 (可选) isOver :如果当前操作是最终操作,需要把其他没操作的审批人状态更新为不可用 (必选)
func (*TransferDBService) VerifyFailed ¶
func (*TransferDBService) VerifyFailed(order *TransferOrder) bool
VerifyFailed 审批验证签名失败
type TransferOrder ¶
type TransferOrder struct { ID string `gorm:"column:id"` CoinName string `gorm:"column:coinName"` Hash string `gorm:"column:hash"` ApplyReason string `gorm:"column:applyReason"` Deadline sql.NullString `gorm:"column:deadline"` Miner string `gorm:"column:miner"` Sign string `gorm:"column:sign"` CreatedAt time.Time `gorm:"column:createdAt"` UpdatedAt time.Time `gorm:"column:updatedAt"` Status int `gorm:"column:status"` Content string `gorm:"column:content"` ApplyerId int `gorm:"column:applyerId"` Amount string `gorm:"column:amount"` NowLevel int `gorm:"column:nowLevel"` ApproversSign string `gorm:"column:approversSign"` }
transferOrder
func (TransferOrder) TableName ¶
func (to TransferOrder) TableName() string
type TransferReview ¶
type TransferReview struct { ID int OrderNum string `gorm:"column:orderNum"` Status int Encode string Reason string UpdatedAt time.Time `gorm:"column:updatedAt"` AccountName string `gorm:"column:accountName"` Level int `gorm:"column:level"` }
transferReview
func (TransferReview) TableName ¶
func (tf TransferReview) TableName() string
type TransferSend ¶
type TransferSend struct { TransferId string `gorm:"column:transferId"` CoinName string `gorm:"column:coinName"` TransferMsg string `gorm:"column:transferMsg"` ApplyAccount string `gorm:"column:applyAccount"` ApplyerId int `gorm:"column:applyerId"` ApplyPublickey string `gorm:"column:applyPublickey"` ApplySign string `gorm:"column:applySign"` ApproversSign string `gorm:"column:approversSign"` Miner string `gorm:"column:miner"` Amount string `gorm:"column:amount"` ToAddress string `gorm:"column:toAddress"` AmountIndex int `gorm:"column:amountIndex"` AddressMsg string `gorm:"column:addressMsg"` Types int `gorm:"column:types"` // 1.外部转账 2。内部转账 TokenAddress string `gorm:"column:tokenAddress"` Deadline string `gorm:"column:deadline"` Status int `gorm:"column:status"` OrderId string `gorm:"column:orderId"` Currency string `gorm:"column:currency"` //属于哪个主链币 TemInfo string `gorm:"column:temInfo"` }
type TxApply ¶
type TxApply struct { Amount string `json:"amount"` CoinName string `json:"coinName"` Info string `json:"info"` Miner string `json:"miner"` Destination string `json:"destination"` Timestamp int64 `json:"timestamp"` TemplateHash string `json:"templateHash"` }
TxApply represents the struct of transfer apply content
type TxInfos ¶
type TxInfos struct { Txid string `gorm:"column:txId"` Confirm int `gorm:"column:confirm"` Token string `gorm:"column:token"` Type int `gorm:"column:type"` Height int `gorm:"column:height"` Fee string `gorm:"column:fee"` TxObj string `gorm:"column:tx_obj"` ExtValid int `gorm:"column:ext_valid"` CreateAt time.Time `gorm:"column:created_at"` UpdatedAt time.Time `gorm:"column:updated_at"` DeleteddAt time.Time `gorm:"column:deletedd_at"` }
type TxinfosService ¶
type TxinfosService struct { }
func (*TxinfosService) FindCoin ¶
func (*TxinfosService) FindCoin(coinName string, tokenAddress string) (*Coin, int)
FindCoin 查询币种
0.没有记录 1.查询失败 2.有结果
func (*TxinfosService) FindDeposit ¶
func (*TxinfosService) FindDeposit() []DepositEntity
FindDeposit 充值列表
func (*TxinfosService) FindTokenAddress ¶
func (*TxinfosService) FindTokenAddress(token string) []Txinfos
FindTokenAddress 添加币种专用, 更新代币余额
func (*TxinfosService) GetBalanceList ¶
func (*TxinfosService) GetBalanceList() []BalanceEntity
GetBalanceList 应该获取的余额列表
func (*TxinfosService) SaveDeposit ¶
func (*TxinfosService) SaveDeposit(deposit *Deposit)
SaveDeposit 充值
func (*TxinfosService) SumBalance ¶
func (*TxinfosService) SumBalance() error
func (*TxinfosService) UpadateConfigs ¶
func (*TxinfosService) UpadateConfigs(key string, value string) error
UpadateConfigs 更新
func (*TxinfosService) UpdateBalance ¶
func (*TxinfosService) UpdateBalance(capital *Capital)
UpdateBalance 更新余额
func (*TxinfosService) UpdateBalances ¶
func (*TxinfosService) UpdateBalances(coinName string, address string, balance string)
UpdateBalance 更新余额
func (*TxinfosService) UpdateDeposit ¶
func (*TxinfosService) UpdateDeposit(deposit *Deposit)
UpdateDeposit 充值更新
func (*TxinfosService) UpdateDeposits ¶
func (*TxinfosService) UpdateDeposits(coin *Coin)
UpdateDeposits 更新充值 --添加代币时专用
func (*TxinfosService) UpdateTokenBalance ¶
func (*TxinfosService) UpdateTokenBalance(maps map[string]string, token string)
UpdateTokenBalance 更新代笔余额
type WebTransfers ¶
type WebTransfers struct { ID int TransferId string `gorm:"column:transferId"` Msg string `gorm:"column:msg"` CreatedTime int64 `gorm:"column:createdTime"` }
func (WebTransfers) TableName ¶
func (webTransfers WebTransfers) TableName() string