32 lines
703 B
Go
32 lines
703 B
Go
package contract
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/jinzhu/gorm"
|
|
"gitlab.com/pactual1/backend/services/blockchain"
|
|
"gitlab.com/pactual1/backend/shared"
|
|
)
|
|
|
|
type service struct {
|
|
ch chan string
|
|
db *gorm.DB
|
|
encryptionClient shared.EncryptionClient
|
|
blockchainClient blockchain.Service
|
|
}
|
|
|
|
func NewService(ch chan string, db *gorm.DB, encryptionClient shared.EncryptionClient, blockchainClient blockchain.Service) service {
|
|
return service{
|
|
ch: ch,
|
|
db: db,
|
|
encryptionClient: encryptionClient,
|
|
blockchainClient: blockchainClient,
|
|
}
|
|
}
|
|
|
|
func (s service) ContractService() {
|
|
for msg := range s.ch {
|
|
fmt.Println("Contract Service: ", msg)
|
|
}
|
|
}
|