init commit

This commit is contained in:
flswld
2022-11-20 15:38:00 +08:00
parent eda2b643b9
commit 3efed3defe
5834 changed files with 636508 additions and 0 deletions

View 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,
})
}