Some checks failed
Build docker and publish / prepare (push) Has been cancelled
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.admin image_name:ppanel-admin name:admin]) (push) Has been cancelled
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.api image_name:ppanel-api name:api]) (push) Has been cancelled
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.node image_name:ppanel-node name:node]) (push) Has been cancelled
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.queue image_name:ppanel-queue name:queue]) (push) Has been cancelled
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.scheduler image_name:ppanel-scheduler name:scheduler]) (push) Has been cancelled
Build docker and publish / deploy (push) Has been cancelled
Build docker and publish / notify (push) Has been cancelled
36 lines
787 B
Go
36 lines
787 B
Go
package logic
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/zero-ppanel/zero-ppanel/apps/rpc/core/core"
|
|
"github.com/zero-ppanel/zero-ppanel/apps/rpc/core/internal/svc"
|
|
|
|
"github.com/zeromicro/go-zero/core/logx"
|
|
)
|
|
|
|
type PingLogic struct {
|
|
ctx context.Context
|
|
svcCtx *svc.ServiceContext
|
|
logx.Logger
|
|
}
|
|
|
|
func NewPingLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PingLogic {
|
|
return &PingLogic{
|
|
ctx: ctx,
|
|
svcCtx: svcCtx,
|
|
Logger: logx.WithContext(ctx),
|
|
}
|
|
}
|
|
|
|
// Ping 检查服务健康状态
|
|
func (l *PingLogic) Ping(in *core.Empty) (*core.BasicResponse, error) {
|
|
// 记录一行日志,这样我们能在 Jaeger 和控制台看到追踪信息
|
|
l.Logger.Info("Received Ping request from BFF")
|
|
|
|
return &core.BasicResponse{
|
|
Code: 200,
|
|
Msg: "pong from core-rpc",
|
|
}, nil
|
|
}
|