21 lines
494 B
Go
21 lines
494 B
Go
package managers
|
|
|
|
import "StoreBackEnd/pkg/protocol/repository"
|
|
|
|
type RequestManager struct {
|
|
Repository *repository.ProtocolRepository
|
|
}
|
|
|
|
func (receiver RequestManager) Execute(request string) string {
|
|
// On lis ce que l'on reçoit
|
|
result, executed := receiver.Repository.ExecuteReader(request)
|
|
|
|
// On renvoie la réponse (Comment pour fichier ?)
|
|
if executed {
|
|
return result
|
|
} else {
|
|
// TODO : Renvoyer qu'une erreur est survenue
|
|
return "Error occurred while execute command"
|
|
}
|
|
}
|