質問編集履歴
3
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -72,6 +72,114 @@
|
|
72
72
|
|
73
73
|
```
|
74
74
|
|
75
|
+
```Go
|
76
|
+
|
77
|
+
import (
|
78
|
+
|
79
|
+
reqMake "testreq/make"
|
80
|
+
|
81
|
+
resMake "testres/make"
|
82
|
+
|
83
|
+
)
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
type MakeAPI struct {
|
88
|
+
|
89
|
+
API
|
90
|
+
|
91
|
+
}
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
func (c MakeAPI) Test() revel.Result {
|
96
|
+
|
97
|
+
logger.Info(c.Name, c.MethodName, "Start")
|
98
|
+
|
99
|
+
fmt.Print("エラー1")
|
100
|
+
|
101
|
+
// レスポンスデータ設定
|
102
|
+
|
103
|
+
var resTestRes resMake.TestRegisterRes
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
// リクエストパラメータ取得
|
108
|
+
|
109
|
+
var reqTestReq = reqMake.TestRegisterReq{}
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
repoTestTable := c.repoTestTable
|
114
|
+
|
115
|
+
fmt.Print("エラー2")
|
116
|
+
|
117
|
+
z := entity.TestTable{
|
118
|
+
|
119
|
+
ID: reqTestReq.ID,
|
120
|
+
|
121
|
+
Name: reqTestReq.Name,
|
122
|
+
|
123
|
+
}
|
124
|
+
|
125
|
+
fmt.Print("エラー3")
|
126
|
+
|
127
|
+
repoTestTable.TestInsert(&z)
|
128
|
+
|
129
|
+
fmt.Print("登録できた筈!!!!!!!")
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
return c.RenderJSON(resTestRes)
|
134
|
+
|
135
|
+
}
|
136
|
+
|
137
|
+
```
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
```Go(testreq/make)
|
142
|
+
|
143
|
+
type TestRegisterRes struct {
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
// maker id
|
148
|
+
|
149
|
+
ID int `json:"id"`
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
}
|
154
|
+
|
155
|
+
```
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
```Go(testres/make)
|
160
|
+
|
161
|
+
package make
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
type TestRegisterReq struct {
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
// メーカーID
|
170
|
+
|
171
|
+
ID int `json:"id"`
|
172
|
+
|
173
|
+
// メーカー名
|
174
|
+
|
175
|
+
Name string `json:"name"`
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
}
|
180
|
+
|
181
|
+
```
|
182
|
+
|
75
183
|
|
76
184
|
|
77
185
|
追記
|
2
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -71,3 +71,9 @@
|
|
71
71
|
}
|
72
72
|
|
73
73
|
```
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
追記
|
78
|
+
|
79
|
+
現状処理は xmlHttpRequest.open("make/test", "POST", true);まで進み、その後catch(ex) に飛びます。
|
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -20,7 +20,7 @@
|
|
20
20
|
|
21
21
|
```HTML
|
22
22
|
|
23
|
-
<input type="submit" class="btn" id="btnRegist">
|
23
|
+
<input type="submit" class="btn" id="btnRegist" onsubmit="regist(); return false;">
|
24
24
|
|
25
25
|
```
|
26
26
|
|