mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-09 01:52:26 +08:00
36 lines
681 B
Go
36 lines
681 B
Go
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,
|
|
})
|
|
}
|