互动
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
958 B

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. package common
  2. import (
  3. "fmt"
  4. "hudongzhuanjia/controllers"
  5. "hudongzhuanjia/libs/im"
  6. im_service "hudongzhuanjia/services/im"
  7. "time"
  8. )
  9. type ImTestCtl struct {
  10. controllers.BaseCtl
  11. }
  12. func (t *ImTestCtl) SendNotice() {
  13. activityId := t.MustGetInt64("activity_id")
  14. status := t.MustGetInt("status")
  15. im_service.SendGroupCustomMessage(fmt.Sprint(1), activityId, im.NoticeStatus(status), map[string]interface{}{
  16. "customer_id": 16,
  17. "shake_red_envelope_rule_id": 5,
  18. "timestamp": time.Now().Unix(),
  19. })
  20. t.SUCCESS("发送成功")
  21. }
  22. func (t *ImTestCtl) SendRedPack() {
  23. activityId := t.MustGetInt64("activity_id")
  24. prompt := t.MustGet("prompt")
  25. im_service.SendGroupCustomMessage(fmt.Sprint(1), activityId, im.NoticeLiveRedPackStart,
  26. map[string]interface{}{
  27. "live_red_envelope_rule_id": 1,
  28. "prompt": prompt,
  29. "timestamp": time.Now().Unix(),
  30. })
  31. t.SUCCESS("发送成功")
  32. }