Merge branch 'feature/get-freeship-by-supplierids' of git.selly.red:Selly-Modules/natsio into develop

This commit is contained in:
QuanTT0110 2022-10-27 11:30:48 +07:00
commit 1c5666d7c1
4 changed files with 15 additions and 13 deletions

View File

@ -17,14 +17,15 @@ 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"`
} }

View File

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

View File

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

View File

@ -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"),
} }