- Changement des entêtes dans le projets.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package managers
|
||||
|
||||
import (
|
||||
"StoreBackEnd/pkg/protocol"
|
||||
"StoreBackEnd/pkg/protocol/repository"
|
||||
"bufio"
|
||||
)
|
||||
@@ -9,20 +10,20 @@ type RequestManager struct {
|
||||
Repository *repository.ProtocolRepository
|
||||
}
|
||||
|
||||
func (receiver RequestManager) Execute(request string, reader *bufio.Reader) string {
|
||||
func (receiver RequestManager) Execute(request string, reader *bufio.Reader) *protocol.ProtocolWriterResult {
|
||||
// On lis ce que l'on reçoit
|
||||
result, executed, readCb := receiver.Repository.ExecuteReader(request)
|
||||
writeCmd, readCb := receiver.Repository.ExecuteReader(request)
|
||||
|
||||
// On renvoie la réponse (Comment pour fichier ?)
|
||||
if executed {
|
||||
if writeCmd != nil {
|
||||
if readCb != nil {
|
||||
cbResult, _ := readCb(reader)
|
||||
if cbResult != "" {
|
||||
result = cbResult
|
||||
cbResult := readCb(reader)
|
||||
if cbResult != nil {
|
||||
writeCmd = cbResult
|
||||
}
|
||||
}
|
||||
return result
|
||||
return writeCmd
|
||||
} else {
|
||||
return "Error occurred while execute command"
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user