-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstructure.go
185 lines (167 loc) · 5.09 KB
/
structure.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
package main
import (
"DemaeDominos/dominos"
"encoding/xml"
"github.com/WiiLink24/nwc24"
"net/http"
)
type XMLType int
const (
Normal XMLType = iota
MultipleRootNodes
)
type Config struct {
XMLName xml.Name `xml:"Config"`
Address string `xml:"Address"`
SQLAddress string `xml:"SQLAddress"`
SQLUser string `xml:"SQLUser"`
SQLPass string `xml:"SQLPass"`
SQLDB string `xml:"SQLDB"`
ErrorWebhook string `xml:"ErrorWebhook"`
OrderWebhook string `xml:"OrderWebhook"`
SentryDSN string `xml:"SentryDSN"`
}
// Response describes the inner response format, along with common fields across requests.
type Response struct {
ResponseFields any
hasError bool
wiiNumber nwc24.WiiNumber
request *http.Request
writer *http.ResponseWriter
isMultipleRootNodes bool
dominos *dominos.Dominos
}
// KVField represents an individual node in form of <XMLName>Contents</XMLName>.
type KVField struct {
XMLName xml.Name
Value any `xml:",cdata"`
}
// KVFieldWChildren represents an individual node in form of
/*
<XMLName>
<Child>
...
</Child>
</XMLName>
*/
type KVFieldWChildren struct {
XMLName xml.Name
Value []any
}
type CDATA struct {
Value any `xml:",cdata"`
}
type AreaNames struct {
XMLName xml.Name `xml:"areaPlace"`
AreaName CDATA `xml:"areaName"`
AreaCode CDATA `xml:"areaCode"`
}
type Area struct {
XMLName xml.Name `xml:"areaPlace"`
AreaName CDATA `xml:"areaName"`
AreaCode CDATA `xml:"areaCode"`
IsNextArea CDATA `xml:"isNextArea"`
Display CDATA `xml:"display"`
Kanji1 CDATA `xml:"kanji1"`
Kanji2 CDATA `xml:"kanji2"`
Kanji3 CDATA `xml:"kanji3"`
Kanji4 CDATA `xml:"kanji4"`
}
type BasicShop struct {
XMLName xml.Name `xml:"Shop"`
ShopCode CDATA `xml:"shopCode"`
HomeCode CDATA `xml:"homeCode"`
Name CDATA `xml:"name"`
Catchphrase CDATA `xml:"catchphrase"`
MinPrice CDATA `xml:"minPrice"`
Yoyaku CDATA `xml:"yoyaku"`
Activate CDATA `xml:"activate"`
WaitTime CDATA `xml:"waitTime"`
PaymentList KVFieldWChildren
ShopStatus KVFieldWChildren
}
type ShopOne struct {
XMLName xml.Name `xml:"response"`
CategoryCode CDATA `xml:"categoryCode"`
Address CDATA `xml:"address"`
Information CDATA `xml:"information"`
Attention CDATA `xml:"attention"`
Amenity CDATA `xml:"amenity"`
MenuListCode CDATA `xml:"menuListCode"`
Activate CDATA `xml:"activate"`
WaitTime CDATA `xml:"waitTime"`
TimeOrder CDATA `xml:"timeorder"`
Tel CDATA `xml:"tel"`
YoyakuMinDate CDATA `xml:"yoyakuMinDate"`
YoyakuMaxDate CDATA `xml:"yoyakuMaxDate"`
PaymentList KVFieldWChildren
ShopStatus ShopStatus `xml:"shopStatus"`
RecommendedItemList KVFieldWChildren `xml:"recommendItemList"`
}
type ShopStatus struct {
Hours KVFieldWChildren
Interval CDATA `xml:"interval"`
Holiday CDATA `xml:"holiday"`
}
type NestedItem struct {
XMLName xml.Name
Name CDATA `xml:"name"`
Item Item
}
type Item struct {
XMLName xml.Name
MenuCode CDATA `xml:"menuCode"`
ItemCode CDATA `xml:"itemCode"`
Name CDATA `xml:"name"`
Price CDATA `xml:"price"`
Info CDATA `xml:"info"`
Size *CDATA `xml:"size"`
IsSelected *CDATA `xml:"isSelected"`
Image CDATA `xml:"image"`
IsSoldout CDATA `xml:"isSoldout"`
SizeList *KVFieldWChildren `xml:"sizeList"`
}
type ItemSize struct {
XMLName xml.Name
ItemCode CDATA `xml:"itemCode"`
Size CDATA `xml:"size"`
Price CDATA `xml:"price"`
IsSoldout CDATA `xml:"isSoldout"`
}
type Menu struct {
XMLName xml.Name
MenuCode CDATA `xml:"menuCode"`
LinkTitle CDATA `xml:"linkTitle"`
EnabledLink CDATA `xml:"enabledLink"`
Name CDATA `xml:"name"`
Info CDATA `xml:"info"`
SetNum CDATA `xml:"setNum"`
LunchMenuList struct {
IsLunchTimeMenu CDATA `xml:"isLunchTimeMenu"`
Hour KVFieldWChildren
IsOpen CDATA `xml:"isOpen"`
Message CDATA `xml:"message"`
} `xml:"lunchMenuList"`
}
type ItemOne struct {
XMLName xml.Name
Info CDATA `xml:"info"`
Code CDATA `xml:"code"`
Type CDATA `xml:"type"`
Name CDATA `xml:"name"`
List KVFieldWChildren `xml:"list"`
}
type BasketItem struct {
XMLName xml.Name
BasketNo CDATA `xml:"basketNo"`
MenuCode CDATA `xml:"menuCode"`
ItemCode CDATA `xml:"itemCode"`
Name CDATA `xml:"name"`
Price CDATA `xml:"price"`
Size CDATA `xml:"size"`
IsSoldout CDATA `xml:"isSoldout"`
Quantity CDATA `xml:"quantity"`
SubTotalPrice CDATA `xml:"subTotalPrice"`
Menu KVFieldWChildren `xml:"Menu"`
OptionList KVFieldWChildren `xml:"optionList"`
}