Merge branch 'feature/get-freeship-by-supplierids' of git.selly.red:Selly-Modules/natsio into develop
This commit is contained in:
commit
1c5666d7c1
|
@ -17,14 +17,15 @@ func GetBank() Bank {
|
|||
return Bank{}
|
||||
}
|
||||
|
||||
func (s Bank) GetBankAndBranchByBankIDs(p model.GetBankAndBranchesRequest) ([]*model.ResponseBankAndBranches, error) {
|
||||
msg, err := natsio.GetServer().Request(subject.Bank.GetBankAndBranchesByBankIDs, toBytes(p))
|
||||
// GetBankInfo ...
|
||||
func (s Bank) GetBankInfo(p model.GetBankInfoRequest) (*model.ResponseBankInfo, error) {
|
||||
msg, err := natsio.GetServer().Request(subject.Bank.GetBankInfo, toBytes(p))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var r struct {
|
||||
Data []*model.ResponseBankAndBranches `json:"data"`
|
||||
Data *model.ResponseBankInfo `json:"data"`
|
||||
Error string `json:"error"`
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ type CheckBankAndBranchByIDRequest struct {
|
|||
BranchID string `json:"branchId"`
|
||||
}
|
||||
|
||||
type GetBankAndBranchesRequest struct {
|
||||
BankIDs []string `json:"bankIds"`
|
||||
type GetBankInfoRequest struct {
|
||||
BankID string `json:"bankId"`
|
||||
BranchID string `json:"branchId"`
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ type BankBrief struct {
|
|||
Logo interface{} `json:"logo"`
|
||||
}
|
||||
|
||||
type ResponseBankAndBranches struct {
|
||||
type ResponseBankInfo struct {
|
||||
Bank BankBrief `json:"bank"`
|
||||
Branches []BranchBrief `json:"branches"`
|
||||
Branch BranchBrief `json:"branch"`
|
||||
}
|
||||
|
|
|
@ -7,9 +7,9 @@ func getBankValue(val string) string {
|
|||
}
|
||||
|
||||
var Bank = struct {
|
||||
GetBankAndBranchesByBankIDs string
|
||||
GetBankInfo 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"),
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue