package common import ( "hudongzhuanjia/controllers" "hudongzhuanjia/models" im_service "hudongzhuanjia/services/im" pay_service "hudongzhuanjia/services/pay" ) type ImTestCtl struct { controllers.BaseCtl } func (t *ImTestCtl) SendRB() { scene := t.MustGetInt("scene") res, err := pay_service.SendRedPack("欧轩测试", "o9XM41l_c27wRuc33hutRVwsQO4U", "恭喜发财", "抢红包活动", "越抢越多", 100, 1, scene) t.CheckErr(err) t.JSON(res) } func (t *ImTestCtl) Refund() { outTradeNo := t.MustGet("out_trade_no") res, err := pay_service.Refund("退款", outTradeNo) t.CheckErr(err) t.JSON(res) } func (t *ImTestCtl) Send() { err := im_service.SendGroupCustomMessage("admin", t.MustGetInt("activity_id"), im_service.NoticeStatus(t.MustGetInt("type")), map[string]interface{}{ "content": "测试", "admin": 1, }) t.CheckErr(err) t.SUCCESS("成功") } type IMCtl struct { controllers.BaseCtl } func (t *IMCtl) ParseToken() { token := t.MustGet("token") models.ParseToken(token) }