mirror of
https://wiilab.wiimart.org/wiimart/WiiSOAP
synced 2025-09-05 21:11:02 +02:00
Add proper account querying
This commit is contained in:
parent
6620df7d27
commit
67df1d307c
2
ecs.go
2
ecs.go
@ -52,7 +52,7 @@ func notifyETicketsSynced(e *Envelope) {
|
||||
|
||||
func listETickets(e *Envelope) {
|
||||
fmt.Println("The request is valid! Responding...")
|
||||
rows, err := ownedTitles.Query("todo, sorry")
|
||||
rows, err := ownedTitles.Query(e.AccountId())
|
||||
if err != nil {
|
||||
e.Error(2, "that's all you've got for me? ;3", err)
|
||||
return
|
||||
|
1
route.go
1
route.go
@ -140,6 +140,7 @@ func (route *Route) Handle() http.Handler {
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
}
|
||||
w.Write([]byte(contents))
|
||||
fmt.Println("Response:", contents)
|
||||
})
|
||||
}
|
||||
|
||||
|
12
utils.go
12
utils.go
@ -107,6 +107,18 @@ func (e *Envelope) Language() string {
|
||||
return e.language
|
||||
}
|
||||
|
||||
// AccountId returns the account ID for this request. It should be only used in authenticated requests.
|
||||
// If for whatever reason AccountId is not present, it will return an empty string. Please design in a way
|
||||
// so that this is not an issue.
|
||||
func (e *Envelope) AccountId() string {
|
||||
accountId, err := getKey(e.doc, "AccountId")
|
||||
if err != nil {
|
||||
return ""
|
||||
} else {
|
||||
return accountId
|
||||
}
|
||||
}
|
||||
|
||||
// ObtainCommon interprets a given node, and updates the envelope with common key values.
|
||||
func (e *Envelope) ObtainCommon() error {
|
||||
var err error
|
||||
|
Loading…
x
Reference in New Issue
Block a user