forked from ebhomengo/niki
20 lines
533 B
Go
20 lines
533 B
Go
|
package adminaddressservice
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
param "git.gocasts.ir/ebhomengo/niki/param/admin/address"
|
||
|
richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error"
|
||
|
)
|
||
|
|
||
|
func (s Service) GetAddressByID(ctx context.Context, req param.AddressGetRequest) (param.AddressGetResponse, error) {
|
||
|
const op = "adminaddressservice.Get"
|
||
|
|
||
|
address, err := s.repo.GetAddressByID(ctx, req.AddressID)
|
||
|
if err != nil {
|
||
|
return param.AddressGetResponse{}, richerror.New(op).WithErr(err)
|
||
|
}
|
||
|
|
||
|
return param.AddressGetResponse{Address: address}, nil
|
||
|
}
|