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,39 @@
package controller
import "github.com/gin-gonic/gin"
// 获取HTTP服务
func (c *Controller) fetchHttpService(context *gin.Context) {
inst := c.service.FetchHttpService(context.Query("name"))
context.JSON(200, gin.H{
"code": 0,
"instance": inst,
})
}
// 获取所有HTTP服务
func (c *Controller) fetchAllHttpService(context *gin.Context) {
svc := c.service.FetchAllHttpService()
context.JSON(200, gin.H{
"code": 0,
"service": svc,
})
}
// 获取RPC服务
func (c *Controller) fetchRpcService(context *gin.Context) {
inst := c.service.FetchRpcService(context.Query("name"))
context.JSON(200, gin.H{
"code": 0,
"instance": inst,
})
}
// 获取所有RPC服务
func (c *Controller) fetchAllRpcService(context *gin.Context) {
svc := c.service.FetchAllRpcService()
context.JSON(200, gin.H{
"code": 0,
"service": svc,
})
}