@@ -3,6 +3,8 @@ package spec
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"senan.xyz/g/gonic/version"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -14,6 +16,8 @@ type Response struct {
|
||||
Status string `xml:"status,attr" json:"status"`
|
||||
Version string `xml:"version,attr" json:"version"`
|
||||
XMLNS string `xml:"xmlns,attr" json:"-"`
|
||||
Type string `xml:"type,attr" json:"type"`
|
||||
GonicVersion string `xml:"gonicVersion,attr" json:"gonicVersion"`
|
||||
Error *Error `xml:"error" json:"error,omitempty"`
|
||||
Albums *Albums `xml:"albumList" json:"albumList,omitempty"`
|
||||
AlbumsTwo *Albums `xml:"albumList2" json:"albumList2,omitempty"`
|
||||
@@ -39,6 +43,8 @@ func NewResponse() *Response {
|
||||
Status: "ok",
|
||||
XMLNS: xmlns,
|
||||
Version: apiVersion,
|
||||
Type: version.NAME,
|
||||
GonicVersion: version.VERSION,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,6 +73,8 @@ func NewError(code int, message string, a ...interface{}) *Response {
|
||||
Code: code,
|
||||
Message: fmt.Sprintf(message, a...),
|
||||
},
|
||||
Type: version.NAME,
|
||||
GonicVersion: version.VERSION,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user