Skip to content

Commit f926b15

Browse files
committed
1 parent 79fefa7 commit f926b15

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

src/main/kotlin/com/github/mgramin/sqlboot/rest/controllers/ApiController.kt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ import org.springframework.web.bind.annotation.CrossOrigin
5858
import org.springframework.web.bind.annotation.PathVariable
5959
import org.springframework.web.bind.annotation.RequestMapping
6060
import org.springframework.web.bind.annotation.RequestMethod.GET
61+
import org.springframework.web.bind.annotation.RequestMethod.POST
6162
import org.springframework.web.bind.annotation.RequestParam
6263
import org.springframework.web.bind.annotation.RestController
6364
import java.util.ArrayList
@@ -80,7 +81,7 @@ class ApiController {
8081
@Autowired
8182
private lateinit var dbConnectionList: DbConnectionList
8283

83-
@RequestMapping(method = [GET], path = ["/api"], produces = [APPLICATION_JSON_VALUE])
84+
@RequestMapping(method = [GET, POST], path = ["/api"], produces = [APPLICATION_JSON_VALUE])
8485
@Throws(JsonProcessingException::class)
8586
fun apiDocsDefault(
8687
request: HttpServletRequest,
@@ -95,7 +96,7 @@ class ApiController {
9596
}
9697
}
9798

98-
@RequestMapping(method = [GET], path = ["/api/{connectionName}"], produces = [APPLICATION_JSON_VALUE])
99+
@RequestMapping(method = [GET, POST], path = ["/api/{connectionName}"], produces = [APPLICATION_JSON_VALUE])
99100
@Throws(JsonProcessingException::class)
100101
fun apiDocs(
101102
request: HttpServletRequest,
@@ -281,7 +282,7 @@ class ApiController {
281282
return getListResponseEntity(request, null, "$type/$path")
282283
}
283284

284-
@RequestMapping(value = ["/api/{connectionName}/headers/{type}/{path:.+}"], method = arrayOf(GET))
285+
@RequestMapping(value = ["/api/{connectionName}/headers/{type}/{path:.+}"], method = [GET, POST])
285286
fun getResourcesHeadersJson(
286287
request: HttpServletRequest,
287288
@PathVariable connectionName: String,
@@ -291,7 +292,7 @@ class ApiController {
291292
return getListResponseEntityHeaders(request, connectionName, "$type/$path")
292293
}
293294

294-
@RequestMapping(value = ["/api/{connectionName}/headers/{type}"], method = arrayOf(GET))
295+
@RequestMapping(value = ["/api/{connectionName}/headers/{type}"], method = [GET, POST])
295296
fun getResourcesHeadersJson2(
296297
request: HttpServletRequest,
297298
@PathVariable connectionName: String,
@@ -300,7 +301,7 @@ class ApiController {
300301
return getListResponseEntityHeaders(request, connectionName, type)
301302
}
302303

303-
@RequestMapping(value = ["/api/{connectionName}/headers/{type}/{path:.+}/{action}"], method = arrayOf(GET))
304+
@RequestMapping(value = ["/api/{connectionName}/headers/{type}/{path:.+}/{action}"], method = [GET, POST])
304305
fun getResourcesHeadersJson3(
305306
request: HttpServletRequest,
306307
@PathVariable connectionName: String,
@@ -312,7 +313,7 @@ class ApiController {
312313
"$type/$path/$action")
313314
}
314315

315-
@RequestMapping(value = ["/api/{connectionName}/meta/{type}"], method = arrayOf(GET))
316+
@RequestMapping(value = ["/api/{connectionName}/meta/{type}"], method = [GET, POST])
316317
fun getResourceMetadata(
317318
request: HttpServletRequest,
318319
@PathVariable connectionName: String,
@@ -334,7 +335,7 @@ class ApiController {
334335
return ResponseEntity(collect, HttpStatus.OK)
335336
}
336337

337-
@RequestMapping(value = ["/api/{connectionName}/meta/{type}/{path:.+}"], method = [GET])
338+
@RequestMapping(value = ["/api/{connectionName}/meta/{type}/{path:.+}"], method = [GET, POST])
338339
fun getResourceMetadata2(
339340
request: HttpServletRequest,
340341
@PathVariable connectionName: String,
@@ -359,7 +360,7 @@ class ApiController {
359360
return ResponseEntity(collect, HttpStatus.OK)
360361
}
361362

362-
@RequestMapping(value = ["/api/{connectionName}/meta/{type}/{path:.+}/{action}"], method = [GET])
363+
@RequestMapping(value = ["/api/{connectionName}/meta/{type}/{path:.+}/{action}"], method = [GET, POST])
363364
fun getResourceMetadata3(
364365
request: HttpServletRequest,
365366
@PathVariable connectionName: String,

0 commit comments

Comments
 (0)