mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-11 21:22:27 +08:00
init commit
This commit is contained in:
35
air/controller/keepalive_controller.go
Normal file
35
air/controller/keepalive_controller.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"air/entity"
|
||||
"flswld.com/logger"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// HTTP心跳
|
||||
func (c *Controller) httpKeepalive(context *gin.Context) {
|
||||
inst := new(entity.Instance)
|
||||
err := context.ShouldBindJSON(inst)
|
||||
if err != nil {
|
||||
logger.LOG.Error("parse json error: %v", err)
|
||||
return
|
||||
}
|
||||
c.service.HttpKeepalive(*inst)
|
||||
context.JSON(200, gin.H{
|
||||
"code": 0,
|
||||
})
|
||||
}
|
||||
|
||||
// RPC心跳
|
||||
func (c *Controller) rpcKeepalive(context *gin.Context) {
|
||||
inst := new(entity.Instance)
|
||||
err := context.ShouldBindJSON(inst)
|
||||
if err != nil {
|
||||
logger.LOG.Error("parse json error: %v", err)
|
||||
return
|
||||
}
|
||||
c.service.RpcKeepalive(*inst)
|
||||
context.JSON(200, gin.H{
|
||||
"code": 0,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user