forked from ebhomengo/niki
20 lines
569 B
Go
20 lines
569 B
Go
|
package adminagentservice
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
param "git.gocasts.ir/ebhomengo/niki/param/admin/agent"
|
||
|
richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error"
|
||
|
)
|
||
|
|
||
|
func (s Service) AgentExistByID(ctx context.Context, req param.AdminAgentExistByIDRequest) (param.AdminAgentExistByIDResponse, error) {
|
||
|
const op = "adminagentservice.AgentExistByID"
|
||
|
|
||
|
exist, gErr := s.repo.AgentExistByID(ctx, req.AgentID)
|
||
|
if gErr != nil {
|
||
|
return param.AdminAgentExistByIDResponse{}, richerror.New(op).WithErr(gErr)
|
||
|
}
|
||
|
|
||
|
return param.AdminAgentExistByIDResponse{Exist: exist}, nil
|
||
|
}
|