2022-09-27 17:59:05 +08:00
|
|
|
package reason
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2022-10-28 17:02:24 +08:00
|
|
|
|
2022-10-24 16:51:05 +08:00
|
|
|
"github.com/answerdev/answer/internal/schema"
|
|
|
|
"github.com/answerdev/answer/internal/service/reason_common"
|
2022-09-27 17:59:05 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
type ReasonService struct {
|
|
|
|
reasonRepo reason_common.ReasonRepo
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewReasonService(reasonRepo reason_common.ReasonRepo) *ReasonService {
|
|
|
|
return &ReasonService{
|
|
|
|
reasonRepo: reasonRepo,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-16 11:48:35 +08:00
|
|
|
func (rs ReasonService) GetReasons(ctx context.Context, req schema.ReasonReq) (resp []*schema.ReasonItem, err error) {
|
2022-10-28 17:02:24 +08:00
|
|
|
return rs.reasonRepo.ListReasons(ctx, req.ObjectType, req.Action)
|
2022-09-27 17:59:05 +08:00
|
|
|
}
|