Compare commits
No commits in common. "9c2f55e434d7731422353bcc5cc2fdc880f1a7e8" and "8ed19af4ea473ab1b08aec6922006ce283090954" have entirely different histories.
9c2f55e434
...
8ed19af4ea
|
@ -34,23 +34,6 @@ func (c Product) ApplyRequest(p model.ProductApplyRequestPayload) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c Product) CreateRequestSteps(p model.ProductCreateStepsPayload) error {
|
|
||||||
msg, err := natsio.GetServer().Request(subject.Product.CreateRequestStep, toBytes(p))
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
var r struct {
|
|
||||||
Error string `json:"error"`
|
|
||||||
}
|
|
||||||
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if r.Error != "" {
|
|
||||||
return errors.New(r.Error)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c Product) ProcessApplyRequest(p model.ProductApplyRequestPayload) error {
|
func (c Product) ProcessApplyRequest(p model.ProductApplyRequestPayload) error {
|
||||||
msg, err := natsio.GetServer().Request(subject.Product.ProcessApplyRequest, toBytes(p))
|
msg, err := natsio.GetServer().Request(subject.Product.ProcessApplyRequest, toBytes(p))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -67,20 +50,3 @@ func (c Product) ProcessApplyRequest(p model.ProductApplyRequestPayload) error {
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c Product) RequestChangeStatus(p model.ProductRequestChangeStatus) error {
|
|
||||||
msg, err := natsio.GetServer().Request(subject.Product.RequestChangeStatus, toBytes(p))
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
var r struct {
|
|
||||||
Error string `json:"error"`
|
|
||||||
}
|
|
||||||
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if r.Error != "" {
|
|
||||||
return errors.New(r.Error)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
|
@ -5,14 +5,12 @@ var Selly = struct {
|
||||||
PushNotification string
|
PushNotification string
|
||||||
UpdateSellerAffiliateStatistic string
|
UpdateSellerAffiliateStatistic string
|
||||||
CheckAnDInsertCashflowBySeller string
|
CheckAnDInsertCashflowBySeller string
|
||||||
SubscriberTopic string
|
|
||||||
UpdateSellerSavingCampaignStatistic string
|
UpdateSellerSavingCampaignStatistic string
|
||||||
GenerateVoucherPromotion string
|
GenerateVoucherPromotion string
|
||||||
}{
|
}{
|
||||||
PushNotification: "PULL_PUSH_NOTIFICATION",
|
PushNotification: "PULL_PUSH_NOTIFICATION",
|
||||||
UpdateSellerAffiliateStatistic: "PULL_UPDATE_SELLER_AFFILIATE_STATISTIC",
|
UpdateSellerAffiliateStatistic: "PULL_UPDATE_SELLER_AFFILIATE_STATISTIC",
|
||||||
CheckAnDInsertCashflowBySeller: "PULL_CHECK_AND_INSERT_CASHFLOW_BY_SELLER",
|
CheckAnDInsertCashflowBySeller: "PULL_CHECK_AND_INSERT_CASHFLOW_BY_SELLER",
|
||||||
SubscriberTopic: "PULL_SUBSCRIBER_TOPIC",
|
|
||||||
UpdateSellerSavingCampaignStatistic: "PULL_UPDATE_SELLER_SAVING_CAMPAIGN_STATISTIC",
|
UpdateSellerSavingCampaignStatistic: "PULL_UPDATE_SELLER_SAVING_CAMPAIGN_STATISTIC",
|
||||||
GenerateVoucherPromotion: "PULL_GENERATE_VOUCHER_PROMOTION",
|
GenerateVoucherPromotion: "PULL_GENERATE_VOUCHER_PROMOTION",
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,11 +100,3 @@ type GenerateVoucherPromotion struct {
|
||||||
type GenerateVoucherPromotionOptions struct {
|
type GenerateVoucherPromotionOptions struct {
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// SubscriberNotificationTopic ...
|
|
||||||
type SubscriberNotificationTopic struct {
|
|
||||||
User string `json:"user"`
|
|
||||||
Topic string `json:"topic"`
|
|
||||||
DeviceId string `json:"deviceId"`
|
|
||||||
FCMToken string `json:"fcmToken"`
|
|
||||||
}
|
|
||||||
|
|
|
@ -14,14 +14,12 @@ var Selly = struct {
|
||||||
PushNotification string
|
PushNotification string
|
||||||
UpdateSellerAffiliateStatistic string
|
UpdateSellerAffiliateStatistic string
|
||||||
CheckAnDInsertCashflowBySeller string
|
CheckAnDInsertCashflowBySeller string
|
||||||
SubscriberTopic string
|
|
||||||
UpdateSellerSavingCampaignStatistic string
|
UpdateSellerSavingCampaignStatistic string
|
||||||
GenerateVoucherPromotion string
|
GenerateVoucherPromotion string
|
||||||
}{
|
}{
|
||||||
PushNotification: getSellyValue("push_notifications"),
|
PushNotification: getSellyValue("push_notifications"),
|
||||||
UpdateSellerAffiliateStatistic: getSellyValue("update_seller_affiliate_statistic"),
|
UpdateSellerAffiliateStatistic: getSellyValue("update_seller_affiliate_statistic"),
|
||||||
CheckAnDInsertCashflowBySeller: getSellyValue("check_and_insert_cashflow_statistic"),
|
CheckAnDInsertCashflowBySeller: getSellyValue("check_and_insert_cashflow_statistic"),
|
||||||
SubscriberTopic: getSellyValue("subscriber_topic"),
|
|
||||||
UpdateSellerSavingCampaignStatistic: getSellyValue("update_seller_saving_campaign_statistic"),
|
UpdateSellerSavingCampaignStatistic: getSellyValue("update_seller_saving_campaign_statistic"),
|
||||||
GenerateVoucherPromotion: getSellyValue("generate_voucher_promotion"),
|
GenerateVoucherPromotion: getSellyValue("generate_voucher_promotion"),
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,12 +3,3 @@ package model
|
||||||
type ProductApplyRequestPayload struct {
|
type ProductApplyRequestPayload struct {
|
||||||
RequestID string `json:"requestId"`
|
RequestID string `json:"requestId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ProductCreateStepsPayload struct {
|
|
||||||
RequestID string `json:"requestId"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type ProductRequestChangeStatus struct {
|
|
||||||
RequestID string `json:"requestId"`
|
|
||||||
Status string `json:"status"`
|
|
||||||
}
|
|
||||||
|
|
|
@ -9,12 +9,8 @@ func getProductValue(val string) string {
|
||||||
|
|
||||||
var Product = struct {
|
var Product = struct {
|
||||||
ApplyRequest string
|
ApplyRequest string
|
||||||
CreateRequestStep string
|
|
||||||
ProcessApplyRequest string
|
ProcessApplyRequest string
|
||||||
RequestChangeStatus string
|
|
||||||
}{
|
}{
|
||||||
ApplyRequest: getProductValue("apply_request"),
|
ApplyRequest: getProductValue("apply_request"),
|
||||||
CreateRequestStep: getProductValue("create_request_step"),
|
|
||||||
ProcessApplyRequest: getProductValue("process_apply_request"),
|
ProcessApplyRequest: getProductValue("process_apply_request"),
|
||||||
RequestChangeStatus: getProductValue("request_change_status"),
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue