mirror of
https://github.com/samuelncui/yatm.git
synced 2026-01-03 03:35:22 +00:00
25 lines
654 B
Go
25 lines
654 B
Go
package apis
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/samuelncui/yatm/entity"
|
|
"github.com/sirupsen/logrus"
|
|
)
|
|
|
|
func (api *API) JobDisplay(ctx context.Context, req *entity.JobDisplayRequest) (*entity.JobDisplayReply, error) {
|
|
job, err := api.exe.GetJob(ctx, req.Id)
|
|
if err != nil {
|
|
logrus.WithContext(ctx).WithError(err).Infof("get job fail, job_id= %d", req.Id)
|
|
return &entity.JobDisplayReply{}, nil
|
|
}
|
|
|
|
result, err := api.exe.Display(ctx, job)
|
|
if err != nil {
|
|
logrus.WithContext(ctx).WithError(err).Infof("get job display fail, job_id= %d", req.Id)
|
|
return &entity.JobDisplayReply{}, nil
|
|
}
|
|
|
|
return &entity.JobDisplayReply{Display: result}, nil
|
|
}
|