16 changed files with 137 additions and 9 deletions
@ -0,0 +1,13 @@ |
|||
package callback |
|||
|
|||
import ( |
|||
"github.com/flipped-aurora/gin-vue-admin/server/commonus" |
|||
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response" |
|||
"github.com/gin-gonic/gin" |
|||
) |
|||
|
|||
//入口
|
|||
func (a *CallBackApi) Index(c *gin.Context) { |
|||
outPut := commonus.MapOut() |
|||
response.Result(0, outPut, "企业微信回调入口", c) |
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
package callback |
|||
|
|||
//企业微信回调
|
|||
type ApiGroup struct { |
|||
WeChatCallBackApi CallBackApi //企业微信回调
|
|||
} |
|||
@ -0,0 +1,4 @@ |
|||
package callback |
|||
|
|||
//企业微信回调
|
|||
type CallBackApi struct{} |
|||
@ -0,0 +1,14 @@ |
|||
package wechatapp |
|||
|
|||
import ( |
|||
"github.com/flipped-aurora/gin-vue-admin/server/api/wechatapp/sendmessage" |
|||
"github.com/flipped-aurora/gin-vue-admin/server/api/workwechatcallback/callback" |
|||
) |
|||
|
|||
//企业微信应用
|
|||
type ApiGroup struct { |
|||
WorkWeChatCallBackApi callback.ApiGroup |
|||
WorkWeChatSendMsgApi sendmessage.ApiGroup |
|||
} |
|||
|
|||
var ApiGroupApp = new(ApiGroup) |
|||
@ -0,0 +1,13 @@ |
|||
package sendmessage |
|||
|
|||
import ( |
|||
"github.com/flipped-aurora/gin-vue-admin/server/commonus" |
|||
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response" |
|||
"github.com/gin-gonic/gin" |
|||
) |
|||
|
|||
//向企业微信发送消息入口
|
|||
func (s *SendMessageApi) Index(c *gin.Context) { |
|||
outPut := commonus.MapOut() |
|||
response.Result(0, outPut, "企业微信回调入口", c) |
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
package sendmessage |
|||
|
|||
//向企业微信发送信息
|
|||
type ApiGroup struct { |
|||
SendMsgApi SendMessageApi |
|||
} |
|||
@ -0,0 +1,4 @@ |
|||
package sendmessage |
|||
|
|||
//向企业微信发送信息
|
|||
type SendMessageApi struct{} |
|||
@ -1,8 +0,0 @@ |
|||
package callback |
|||
|
|||
import "github.com/gin-gonic/gin" |
|||
|
|||
//验证URL
|
|||
func (w *WorkWeChatCallBackApi) Index(c *gin.Context) { |
|||
|
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
package callback |
|||
|
|||
import ( |
|||
"github.com/flipped-aurora/gin-vue-admin/server/commonus" |
|||
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response" |
|||
"github.com/gin-gonic/gin" |
|||
) |
|||
|
|||
//验证URL
|
|||
func (w *WorkWeChatCallBackApi) Index(c *gin.Context) { |
|||
outPut := commonus.MapOut() |
|||
response.Result(0, outPut, "企业微信回调入口", c) |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
package wechatapp |
|||
|
|||
import ( |
|||
"github.com/flipped-aurora/gin-vue-admin/server/api/wechatapp" |
|||
"github.com/gin-gonic/gin" |
|||
) |
|||
|
|||
//企业微信回调路由
|
|||
type CallBackWeCahtApi struct{} |
|||
|
|||
func (g *CallBackWeCahtApi) InitGroupRouter(Router *gin.RouterGroup) { |
|||
groupCodeRouter := Router.Group("wechatcallback") |
|||
var authorityApi = wechatapp.ApiGroupApp.WorkWeChatCallBackApi.WeChatCallBackApi |
|||
{ |
|||
groupCodeRouter.POST("", authorityApi.Index) |
|||
groupCodeRouter.POST("/", authorityApi.Index) |
|||
groupCodeRouter.GET("", authorityApi.Index) |
|||
groupCodeRouter.GET("/", authorityApi.Index) |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
package wechatapp |
|||
|
|||
type RouterGroup struct { |
|||
CallBackWeCahtApi |
|||
SendMsgWeCahtApi |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
package wechatapp |
|||
|
|||
import ( |
|||
"github.com/flipped-aurora/gin-vue-admin/server/api/wechatapp" |
|||
"github.com/gin-gonic/gin" |
|||
) |
|||
|
|||
//向企业微信发送信息路由
|
|||
type SendMsgWeCahtApi struct{} |
|||
|
|||
func (g *SendMsgWeCahtApi) InitGroupRouter(Router *gin.RouterGroup) { |
|||
groupCodeRouter := Router.Group("wechatsendmsg") |
|||
var authorityApi = wechatapp.ApiGroupApp.WorkWeChatSendMsgApi.SendMsgApi |
|||
{ |
|||
groupCodeRouter.POST("", authorityApi.Index) |
|||
groupCodeRouter.POST("/", authorityApi.Index) |
|||
groupCodeRouter.GET("", authorityApi.Index) |
|||
groupCodeRouter.GET("/", authorityApi.Index) |
|||
|
|||
} |
|||
} |
|||
Loading…
Reference in new issue