pg_workshop_service.go
1.1 KB
package domainService
//import (
// "fmt"
// pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
// "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
// "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/repository"
//)
//
//type PGWorkshopService struct {
// transactionContext *pgTransaction.TransactionContext
//}
//
//func(ptr *PGWorkshopService)CompanyWorkshops(companyId int)(domain.Workshops,error){
// workshopRepository,_:= repository.NewWorkshopRepository(ptr.transactionContext)
// _,workshops,err:= workshopRepository.Find(map[string]interface{}{"companyId":companyId})
// if err!=nil{
// return nil,err
// }
// if len(workshops)==0{
// workshops = make([]*domain.Workshop,0)
// }
// return workshops,nil
//}
//
//func NewPGWorkshopService(transactionContext *pgTransaction.TransactionContext) (*PGWorkshopService, error) {
// if transactionContext == nil {
// return nil, fmt.Errorf("transactionContext参数不能为nil")
// } else {
// return &PGWorkshopService{
// transactionContext: transactionContext,
// }, nil
// }
//}