|
|
@@ -0,0 +1,87 @@
|
|
|
+
|
|
|
+package partial
|
|
|
+
|
|
|
+import (
|
|
|
+ "git.qianqiusoft.com/qianqiusoft/light-apiengine/entitys"
|
|
|
+ "git.qianqiusoft.com/qianqiusoft/light-apiengine/models"
|
|
|
+ "git.qianqiusoft.com/qianqiusoft/light-apiengine/third/wx"
|
|
|
+ "github.com/silenceper/wechat/pay"
|
|
|
+
|
|
|
+ //sysmodel "git.qianqiusoft.com/qianqiusoft/light-apiengine/models"
|
|
|
+ //sysutils "git.qianqiusoft.com/qianqiusoft/light-apiengine/utils"
|
|
|
+ //"git.qianqiusoft.com/qianqiusoft/light-apiengine/models"
|
|
|
+ //__import_packages__
|
|
|
+)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+// _WxpayCallback
|
|
|
+// @Title _WxpayCallback
|
|
|
+// @Description 微信支付回调
|
|
|
+// @Success 200 {object} Account
|
|
|
+// @Failure 403 :id is empty
|
|
|
+func SysPublic_WxpayCallback(c *entitys.CtrlContext) {
|
|
|
+ r := wx.CallWxPayCallbackHandler(c)
|
|
|
+
|
|
|
+ if r.Code != 200{
|
|
|
+ c.Ctx.JSON(500, r)
|
|
|
+ }else{
|
|
|
+ res := pay.NotifyResponse{}
|
|
|
+ res.ReturnCode = "SUCCESS"
|
|
|
+ res.ReturnMsg = "OK"
|
|
|
+
|
|
|
+ c.Ctx.XML(200,&res)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// _WxoauthParams
|
|
|
+// @Title _WxoauthParams
|
|
|
+// @Description 获取微信oauth配置
|
|
|
+// @Success 200 {object} Account
|
|
|
+// @Failure 403 :id is empty
|
|
|
+func SysPublic_WxoauthParams(c *entitys.CtrlContext) {
|
|
|
+ param, err := wx.GetOAuthParams()
|
|
|
+ if err != nil{
|
|
|
+ c.Ctx.JSON(500, models.SysReturn{500, "", ""})
|
|
|
+ }else{
|
|
|
+ c.Ctx.JSON(200, models.SysReturn{200, "", param})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// _WxjssdkParams
|
|
|
+// @Title _WxjssdkParams
|
|
|
+// @Description 获取微信jssdk配置
|
|
|
+// @Success 200 {object} Account
|
|
|
+// @Failure 403 :id is empty
|
|
|
+func SysPublic_WxjssdkParams(c *entitys.CtrlContext) {
|
|
|
+ url := c.Ctx.DefaultQuery("url", "")
|
|
|
+ if url == ""{
|
|
|
+ c.Ctx.JSON(200, models.SysReturn{500, "参数rul为空", ""})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ config, err := wx.GetJSSDKRarams(url)
|
|
|
+ if err != nil{
|
|
|
+ c.Ctx.JSON(200, models.SysReturn{500, err.Error(), ""})
|
|
|
+ }else{
|
|
|
+ c.Ctx.JSON(200, models.SysReturn{200, "", config})
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// _AlipayCallback
|
|
|
+// @Title _AlipayCallback
|
|
|
+// @Description 支付宝支付回调
|
|
|
+// @Success 200 {object} Account
|
|
|
+// @Failure 403 :id is empty
|
|
|
+func SysPublic_AlipayCallback(c *entitys.CtrlContext) {
|
|
|
+
|
|
|
+ ret := __none_func_sys_public__()
|
|
|
+ if ret{
|
|
|
+ c.Ctx.String(200,"")
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+func __none_func_sys_public__(params ... interface{}) bool{
|
|
|
+ return true
|
|
|
+}
|