mop_fast_trial_manager.go 793 B

1234567891011121314151617181920212223242526272829303132
  1. package client
  2. import (
  3. "context"
  4. "errors"
  5. "fmt"
  6. "mop-account-system/common"
  7. )
  8. func SetLoginFirst(ctx context.Context, accountId string) error {
  9. fmt.Println("SetLoginFirst")
  10. var headers = map[string]string{
  11. "Accept": "application/json, text/plain, */*",
  12. "Content-Type": "application/json",
  13. "X-Consumer-Custom-ID": accountId,
  14. }
  15. url := cfg.SetLoginFirstServerHost + "/api/v1/mop/mop-fast-trial-manager/login/first?query=0"
  16. rsp, err := Request(ctx).SetHeaders(headers).Get(url)
  17. if err != nil {
  18. common.GinLog.Error("SetLoginFirst err:" + err.Error())
  19. return err
  20. }
  21. if rsp.StatusCode() != 200 {
  22. common.GinLog.Error("SetLoginFirst status err:" + rsp.String())
  23. return errors.New("status err")
  24. }
  25. fmt.Println("SetLoginFirst success")
  26. return nil
  27. }