(
ctx context.Context,
req *api.PerformPushRulesPutRequest,
_ *struct{},
)
| 752 | } |
| 753 | |
| 754 | func (a *UserInternalAPI) PerformPushRulesPut( |
| 755 | ctx context.Context, |
| 756 | req *api.PerformPushRulesPutRequest, |
| 757 | _ *struct{}, |
| 758 | ) error { |
| 759 | bs, err := json.Marshal(&req.RuleSets) |
| 760 | if err != nil { |
| 761 | return err |
| 762 | } |
| 763 | userReq := api.InputAccountDataRequest{ |
| 764 | UserID: req.UserID, |
| 765 | DataType: pushRulesAccountDataType, |
| 766 | AccountData: json.RawMessage(bs), |
| 767 | } |
| 768 | var userRes api.InputAccountDataResponse // empty |
| 769 | if err := a.InputAccountData(ctx, &userReq, &userRes); err != nil { |
| 770 | return err |
| 771 | } |
| 772 | if err := a.SyncProducer.SendAccountData(req.UserID, eventutil.AccountData{ |
| 773 | Type: pushRulesAccountDataType, |
| 774 | }); err != nil { |
| 775 | util.GetLogger(ctx).WithError(err).Errorf("syncProducer.SendData failed") |
| 776 | } |
| 777 | return nil |
| 778 | } |
| 779 | |
| 780 | func (a *UserInternalAPI) QueryPushRules(ctx context.Context, req *api.QueryPushRulesRequest, res *api.QueryPushRulesResponse) error { |
| 781 | userReq := api.QueryAccountDataRequest{ |
nothing calls this directly
no test coverage detected