group.go 896 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package service
  2. import (
  3. "log"
  4. cm "bp.jydev.jianyu360.cn/CRM/application/api/common"
  5. "bp.jydev.jianyu360.cn/SocialPlatform/socialPlatform/rpc/social/social"
  6. "github.com/gogf/gf/v2/os/gctx"
  7. )
  8. type Group struct {
  9. EntId int64
  10. PositionId int64
  11. UserIdArr []int64
  12. AppId string
  13. EntUserId int64
  14. AccountId int64
  15. }
  16. //GroupAdd 创建群组
  17. //return 群组id
  18. func (this *Group) GroupAdd() string {
  19. resp, err := cm.SocialPlatformRpc.ChatGroupAdd(gctx.New(), &social.ChatGroupAddReq{
  20. EntId: this.EntId,
  21. PositionId: this.PositionId,
  22. UserIdArr: this.UserIdArr,
  23. AppId: this.AppId,
  24. EntUserId: this.EntUserId,
  25. AccountId: this.AccountId,
  26. })
  27. if err != nil {
  28. log.Println("新建群组出错", this.PositionId, err)
  29. return ""
  30. } else if resp == nil {
  31. log.Println("positionId用户", this.PositionId, "新建群组失败")
  32. return ""
  33. }
  34. return resp.Data
  35. }