mergeDev/campaign #73
|
@ -17,15 +17,16 @@ func GetBank() Bank {
|
||||||
return Bank{}
|
return Bank{}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s Bank) GetBankAndBranchByBankIDs(p model.GetBankAndBranchesRequest) ([]*model.ResponseBankAndBranches, error) {
|
// GetBankInfo ...
|
||||||
msg, err := natsio.GetServer().Request(subject.Bank.GetBankAndBranchesByBankIDs, toBytes(p))
|
func (s Bank) GetBankInfo(p model.GetBankInfoRequest) (*model.ResponseBankInfo, error) {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Bank.GetBankInfo, toBytes(p))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var r struct {
|
var r struct {
|
||||||
Data []*model.ResponseBankAndBranches `json:"data"`
|
Data *model.ResponseBankInfo `json:"data"`
|
||||||
Error string `json:"error"`
|
Error string `json:"error"`
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
||||||
|
|
|
@ -5,6 +5,7 @@ type CheckBankAndBranchByIDRequest struct {
|
||||||
BranchID string `json:"branchId"`
|
BranchID string `json:"branchId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetBankAndBranchesRequest struct {
|
type GetBankInfoRequest struct {
|
||||||
BankIDs []string `json:"bankIds"`
|
BankID string `json:"bankId"`
|
||||||
|
BranchID string `json:"branchId"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ type BankBrief struct {
|
||||||
Logo interface{} `json:"logo"`
|
Logo interface{} `json:"logo"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ResponseBankAndBranches struct {
|
type ResponseBankInfo struct {
|
||||||
Bank BankBrief `json:"bank"`
|
Bank BankBrief `json:"bank"`
|
||||||
Branches []BranchBrief `json:"branches"`
|
Branch BranchBrief `json:"branch"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,9 +7,9 @@ func getBankValue(val string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
var Bank = struct {
|
var Bank = struct {
|
||||||
GetBankAndBranchesByBankIDs string
|
GetBankInfo string
|
||||||
CheckBankAndBranchByID string
|
CheckBankAndBranchByID string
|
||||||
}{
|
}{
|
||||||
GetBankAndBranchesByBankIDs: getBankValue("get_bank_and_branches_by_bank_ids"),
|
GetBankInfo: getBankValue("get_bank_info"),
|
||||||
CheckBankAndBranchByID: getBankValue("check_bank_and_branch_by_id"),
|
CheckBankAndBranchByID: getBankValue("check_bank_and_branch_by_id"),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue