2024-07-14 04:49:21 +02:00
|
|
|
package helper
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"strings"
|
|
|
|
|
2024-07-15 20:27:05 +02:00
|
|
|
"git.gay/exhq/pas/src/Constants"
|
2024-07-14 04:49:21 +02:00
|
|
|
)
|
|
|
|
|
2024-07-15 20:24:27 +02:00
|
|
|
func IntentGenerator(res Constants.Response) string {
|
2024-07-14 04:49:21 +02:00
|
|
|
headersString := ""
|
2024-07-15 20:24:27 +02:00
|
|
|
for key, value := range res.ResponseHeader {
|
2024-07-14 04:49:21 +02:00
|
|
|
headersString += fmt.Sprintf("%s:%s\n", key, value)
|
|
|
|
}
|
|
|
|
headersString = strings.TrimSuffix(headersString, "\n")
|
2024-07-15 20:24:27 +02:00
|
|
|
return fmt.Sprintf("PAS %s\n%s\n\n%s", string(res.OperationSuccessClassification), headersString, res.Body)
|
2024-07-14 04:49:21 +02:00
|
|
|
}
|