helper.go 517 B

12345678910111213141516171819
  1. package mechanism
  2. import (
  3. "gogs.uu.mdfitnesscao.com/cuiguohai/sdk"
  4. "gogs.uu.mdfitnesscao.com/cuiguohai/sdk/response"
  5. )
  6. // 通过ID列表获取机构列表
  7. func ListMechanismByIds(mechanismIds []string) ([]*sdk.Mechanism, *response.ErrCode) {
  8. var mechanisms = make([]*sdk.Mechanism, 0)
  9. if len(mechanismIds) == 0 {
  10. return mechanisms, nil
  11. }
  12. resp, responseErr := ListMechanism(mechanismIds)
  13. if responseErr == nil && len(resp.Data.List) > 0 {
  14. mechanisms = resp.Data.List
  15. }
  16. return mechanisms, responseErr
  17. }