package client import ( "context" "encoding/json" "errors" "mop-account-system/common" ) type NotifyFinstoreAccountInfoUpReq struct { TraceId string `json:"traceId"` SubId string `json:"subId"` Type string `json:"type"` Data map[string]interface{} `json:"data"` } func NotifyFinstoreAccountInfoUp(ctx context.Context, organId string, m map[string]interface{}) error { var headers = map[string]string{ "Accept": "application/json, text/plain, */*", "Content-Type": "application/json", } req := NotifyFinstoreAccountInfoUpReq{} req.Type = "upOrganInfo" req.TraceId = organId req.Data = m body, _ := json.Marshal(req) url := cfg.NotifyFinstoreInfoUpUrl rsp, err := Request(ctx).SetHeaders(headers).SetBody(body).Patch(url) if err != nil { common.GinLog.Error("NotifyFinstoreAccountInfoUp err:" + err.Error()) return err } if rsp.StatusCode() != 200 { common.GinLog.Error("NotifyFinstoreAccountInfoUp status err:" + rsp.String()) return errors.New("status err") } return nil }