25 lines
622 B
Go
25 lines
622 B
Go
|
|
package service
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
|
||
|
|
"github.com/muyuqingfeng/iloom/textile-service/internal/model"
|
||
|
|
"github.com/muyuqingfeng/iloom/textile-service/internal/repository"
|
||
|
|
)
|
||
|
|
|
||
|
|
type PaymentService struct {
|
||
|
|
repo *repository.PaymentRepo
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewPaymentService(repo *repository.PaymentRepo) *PaymentService {
|
||
|
|
return &PaymentService{repo: repo}
|
||
|
|
}
|
||
|
|
|
||
|
|
func (s *PaymentService) List(ctx context.Context, companyID string) ([]model.Payment, error) {
|
||
|
|
return s.repo.ListByCompany(ctx, companyID)
|
||
|
|
}
|
||
|
|
|
||
|
|
func (s *PaymentService) Confirm(ctx context.Context, paymentID, companyID string) error {
|
||
|
|
return s.repo.Confirm(ctx, paymentID)
|
||
|
|
}
|