2022-06-06 17:00:39 +00:00
|
|
|
{{define "service"}}
|
|
|
|
{{- $Imps := .Imps}}
|
2022-06-06 17:03:17 +00:00
|
|
|
package {{.Manifest.Package}}
|
2022-06-06 17:00:39 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
{{- range .Imps.ImportLines}}
|
|
|
|
{{quote .Alias}} {{.Path}}
|
|
|
|
{{- end}}
|
|
|
|
)
|
|
|
|
{{range .SCPD.SortedActions}}
|
|
|
|
{{- template "action" args "Action" . "Imps" $Imps}}
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{define "action"}}
|
|
|
|
type {{.Action.Name}}Request struct {
|
2022-06-06 17:05:41 +00:00
|
|
|
{{- template "args" args "Args" .Action.InArgs "Imps" .Imps}}
|
2022-06-06 17:00:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type {{.Action.Name}}Response struct {
|
2022-06-06 17:05:41 +00:00
|
|
|
{{- template "args" args "Args" .Action.OutArgs "Imps" .Imps}}
|
2022-06-06 17:00:39 +00:00
|
|
|
}
|
|
|
|
{{- end}}
|
|
|
|
|
|
|
|
{{define "args"}}
|
|
|
|
{{- $Imps := .Imps}}
|
|
|
|
{{- range .Args}}
|
|
|
|
{{.Name}} {{index $Imps.TypeRefByTypeName .RelatedStateVariable.DataType}}
|
2022-06-06 17:05:41 +00:00
|
|
|
{{- end}}
|
2022-06-06 17:00:39 +00:00
|
|
|
{{- end}}
|