互动
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.

34 lines
850 B

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. package common
  2. import (
  3. "hudongzhuanjia/controllers"
  4. im_service "hudongzhuanjia/services/im"
  5. pay_service "hudongzhuanjia/services/pay"
  6. )
  7. type ImTestCtl struct {
  8. controllers.BaseCtl
  9. }
  10. func (t *ImTestCtl) SendRB() {
  11. scene := t.MustGetInt("scene")
  12. res, err := pay_service.SendRedPack("欧轩测试", "o9XM41l_c27wRuc33hutRVwsQO4U",
  13. "恭喜发财", "抢红包活动", "越抢越多", 100, 1, scene)
  14. t.CheckErr(err)
  15. t.JSON(res)
  16. }
  17. func (t *ImTestCtl) Refund() {
  18. outTradeNo := t.MustGet("out_trade_no")
  19. res, err := pay_service.Refund("退款", outTradeNo)
  20. t.CheckErr(err)
  21. t.JSON(res)
  22. }
  23. func (t *ImTestCtl) Send() {
  24. err := im_service.SendGroupCustomMessage("admin", t.MustGetInt64("activity_id"),
  25. im_service.NoticeStatus(t.MustGetInt("type")), map[string]interface{}{
  26. "content": "测试",
  27. })
  28. t.CheckErr(err)
  29. t.SUCCESS("成功")
  30. }