mergeDev/campaign #73

Closed
Ghost wants to merge 208 commits from mergeDev/campaign into develop
4 changed files with 15 additions and 13 deletions
Showing only changes of commit d395f8944f - Show all commits

View File

@ -17,15 +17,16 @@ 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"`
Error string `json:"error"`
Data []*model.ResponseBankInfo `json:"data"`
Error string `json:"error"`
}
if err = json.Unmarshal(msg.Data, &r); err != nil {

View File

@ -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"`
}

View File

@ -34,7 +34,7 @@ type BankBrief struct {
Logo interface{} `json:"logo"`
}
type ResponseBankAndBranches struct {
Bank BankBrief `json:"bank"`
Branches []BranchBrief `json:"branches"`
type ResponseBankInfo struct {
Bank BankBrief `json:"bank"`
Branch BranchBrief `json:"branch"`
}

View File

@ -7,9 +7,9 @@ func getBankValue(val string) string {
}
var Bank = struct {
GetBankAndBranchesByBankIDs string
CheckBankAndBranchByID string
GetBankInfo string
CheckBankAndBranchByID string
}{
GetBankAndBranchesByBankIDs: getBankValue("get_bank_and_branches_by_bank_ids"),
CheckBankAndBranchByID: getBankValue("check_bank_and_branch_by_id"),
GetBankInfo: getBankValue("get_bank_info"),
CheckBankAndBranchByID: getBankValue("check_bank_and_branch_by_id"),
}