package check

import (
	"context"
	"time"

	pb "bsm/full/module/base/initial/pb"
	"git.apinb.com/bsm-sdk/core/vars"
)

// HELLO - 健康检查接口
func Hello(ctx context.Context, in *pb.Crc) (reply *pb.StatusReply, err error) {
	// 输入验证
	if in.Code != "" {
		return &pb.StatusReply{
			Code:    0,
			Message: vars.OK,
			Details: "Hello " + in.Code,
			Timeseq: time.Now().Unix(),
		}, nil
	}

	// 可以在这里添加更多的健康检查逻辑
	// 例如检查数据库连接、Redis连接等

	return &pb.StatusReply{
		Code:    0,
		Message: vars.OK,
		Details: "",
		Timeseq: time.Now().Unix(),
	}, nil
}
