2023-09-18 12:27:40 +02:00
|
|
|
package contract
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
|
|
"github.com/jinzhu/gorm"
|
2023-09-21 11:59:08 +02:00
|
|
|
"gitlab.com/pactual1/backend/services/blockchain"
|
2023-09-18 12:27:40 +02:00
|
|
|
"gitlab.com/pactual1/backend/shared"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type service struct {
|
|
|
|
|
ch chan string
|
|
|
|
|
db *gorm.DB
|
|
|
|
|
encryptionClient shared.EncryptionClient
|
2023-09-21 11:59:08 +02:00
|
|
|
blockchainClient blockchain.Service
|
2023-09-18 12:27:40 +02:00
|
|
|
}
|
|
|
|
|
|
2023-09-21 11:59:08 +02:00
|
|
|
func NewService(ch chan string, db *gorm.DB, encryptionClient shared.EncryptionClient, blockchainClient blockchain.Service) service {
|
2023-09-18 12:27:40 +02:00
|
|
|
return service{
|
|
|
|
|
ch: ch,
|
|
|
|
|
db: db,
|
|
|
|
|
encryptionClient: encryptionClient,
|
2023-09-21 11:59:08 +02:00
|
|
|
blockchainClient: blockchainClient,
|
2023-09-18 12:27:40 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s service) ContractService() {
|
|
|
|
|
for msg := range s.ch {
|
|
|
|
|
fmt.Println("Contract Service: ", msg)
|
|
|
|
|
}
|
|
|
|
|
}
|