bank info
This commit is contained in:
parent
22cd1eb18f
commit
6b168cd98a
|
@ -37,3 +37,19 @@ func (s Bank) GetBankById(bankID string) (*model.BankBrief, error) {
|
|||
|
||||
return r.Data, nil
|
||||
}
|
||||
|
||||
func (s Bank) CheckBankAndBranchByID(p model.BankBranchRequest) bool {
|
||||
msg, err := natsio.GetServer().Request(subject.Bank.CheckBankAndBranchByID, toBytes(p))
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
var r struct {
|
||||
Error string `json:"error"`
|
||||
}
|
||||
|
||||
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
||||
return false
|
||||
}
|
||||
return r.Error == ""
|
||||
}
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
package model
|
||||
|
||||
type BankBranchRequest struct {
|
||||
BankID string `json:"bankId"`
|
||||
BranchID string `json:"branchId"`
|
||||
}
|
|
@ -9,7 +9,9 @@ func getBankValue(val string) string {
|
|||
var Bank = struct {
|
||||
GetBankById string
|
||||
GetBankBranchById string
|
||||
CheckBankAndBranchByID string
|
||||
}{
|
||||
GetBankById: getBankValue("get_bank_by_id"),
|
||||
GetBankBranchById: getBankValue("get_bank_branch_by_id"),
|
||||
CheckBankAndBranchByID: getBankValue("check_bank_and_brach_by_id"),
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue