first commit
This commit is contained in:
33
apps/gateway/internal/logic/base/healthlogic.go
Normal file
33
apps/gateway/internal/logic/base/healthlogic.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package base
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"tianyuan-api/apps/gateway/internal/svc"
|
||||
"tianyuan-api/apps/gateway/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type HealthLogic struct {
|
||||
logx.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewHealthLogic(ctx context.Context, svcCtx *svc.ServiceContext) *HealthLogic {
|
||||
return &HealthLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *HealthLogic) Health() (resp *types.HealthResp, err error) {
|
||||
nowTime := time.Now()
|
||||
resp = &types.HealthResp{
|
||||
Time: nowTime.Format("2006-01-02 15:04:05"),
|
||||
}
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user