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

45 lines
1023 B

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