Skip to content

Commit

Permalink
fix(opeapi): return generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
bas-kirill committed Sep 2, 2024
1 parent 7c3ae25 commit e10594b
Show file tree
Hide file tree
Showing 48 changed files with 1,685 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import { InstrumentId } from "generated/model";
import Jwt from "domain/model/jwt";
import { apiConfig } from "shared/config/api";
import { useTranslation } from "react-i18next";
import {
I18N_HEADER_FAVORITE_BUTTON,

} from "../../../i18n";
import { I18N_HEADER_FAVORITE_BUTTON } from "../../../i18n";

interface Props {
instrumentId: InstrumentId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import { useDarkMode } from "shared/dark-mode/use-dark-mode";
import { apiConfig } from "shared/config/api";
import Jwt from "domain/model/jwt";
import { DeleteInstrumentByIdApi } from "generated/api/delete-instrument-by-id-api";
import {
I18N_INSTRUMENT_CARD_REMOVE_BUTTON,
} from "../../../i18n";
import { I18N_INSTRUMENT_CARD_REMOVE_BUTTON } from "../../../i18n";
import { useTranslation } from "react-i18next";

interface Props {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package mu.muse.rest.api

import mu.muse.rest.dto.ClientError
import mu.muse.rest.dto.InstrumentId
import mu.muse.rest.dto.ServerError
import org.springframework.http.HttpStatus
import org.springframework.http.MediaType
import org.springframework.http.ResponseEntity

import org.springframework.web.bind.annotation.*
import org.springframework.validation.annotation.Validated
import org.springframework.web.context.request.NativeWebRequest
import org.springframework.beans.factory.annotation.Autowired

import jakarta.validation.constraints.DecimalMax
import jakarta.validation.constraints.DecimalMin
import jakarta.validation.constraints.Email
import jakarta.validation.constraints.Max
import jakarta.validation.constraints.Min
import jakarta.validation.constraints.NotNull
import jakarta.validation.constraints.Pattern
import jakarta.validation.constraints.Size
import jakarta.validation.Valid

import kotlin.collections.List
import kotlin.collections.Map

@RestController
@Validated
interface AddFavoriteApi {


@RequestMapping(
method = [RequestMethod.POST],
value = ["/api/favorite/add"],
produces = ["application/json"],
consumes = ["application/json"]
)
fun addFavorite( @Valid @RequestBody instrumentId: InstrumentId): ResponseEntity<kotlin.Any>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package mu.muse.rest.api

import org.springframework.web.context.request.NativeWebRequest

import jakarta.servlet.http.HttpServletResponse
import java.io.IOException

object ApiUtil {
fun setExampleResponse(req: NativeWebRequest, contentType: String, example: String) {
try {
val res = req.getNativeResponse(HttpServletResponse::class.java)
res?.characterEncoding = "UTF-8"
res?.addHeader("Content-Type", contentType)
res?.writer?.print(example)
} catch (e: IOException) {
throw RuntimeException(e)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package mu.muse.rest.api

import mu.muse.rest.dto.JwtResponse
import mu.muse.rest.dto.ServerError
import mu.muse.rest.dto.UsernameAndPasswordRequestBody
import org.springframework.http.HttpStatus
import org.springframework.http.MediaType
import org.springframework.http.ResponseEntity

import org.springframework.web.bind.annotation.*
import org.springframework.validation.annotation.Validated
import org.springframework.web.context.request.NativeWebRequest
import org.springframework.beans.factory.annotation.Autowired

import jakarta.validation.constraints.DecimalMax
import jakarta.validation.constraints.DecimalMin
import jakarta.validation.constraints.Email
import jakarta.validation.constraints.Max
import jakarta.validation.constraints.Min
import jakarta.validation.constraints.NotNull
import jakarta.validation.constraints.Pattern
import jakarta.validation.constraints.Size
import jakarta.validation.Valid

import kotlin.collections.List
import kotlin.collections.Map

@RestController
@Validated
interface BasicLoginApi {


@RequestMapping(
method = [RequestMethod.POST],
value = ["/api/auth/login"],
produces = ["application/json"],
consumes = ["application/json"]
)
fun basicLogin( @Valid @RequestBody usernameAndPasswordRequestBody: UsernameAndPasswordRequestBody): ResponseEntity<JwtResponse>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package mu.muse.rest.api

import mu.muse.rest.dto.ClientError
import mu.muse.rest.dto.CreateInstrumentRequestBody
import mu.muse.rest.dto.ServerError
import org.springframework.http.HttpStatus
import org.springframework.http.MediaType
import org.springframework.http.ResponseEntity

import org.springframework.web.bind.annotation.*
import org.springframework.validation.annotation.Validated
import org.springframework.web.context.request.NativeWebRequest
import org.springframework.beans.factory.annotation.Autowired

import jakarta.validation.constraints.DecimalMax
import jakarta.validation.constraints.DecimalMin
import jakarta.validation.constraints.Email
import jakarta.validation.constraints.Max
import jakarta.validation.constraints.Min
import jakarta.validation.constraints.NotNull
import jakarta.validation.constraints.Pattern
import jakarta.validation.constraints.Size
import jakarta.validation.Valid

import kotlin.collections.List
import kotlin.collections.Map

@RestController
@Validated
interface CreateInstrumentApi {


@RequestMapping(
method = [RequestMethod.POST],
value = ["/api/instrument/create"],
produces = ["application/json"],
consumes = ["application/json"]
)
fun createInstrument( @Valid @RequestBody createInstrumentRequestBody: CreateInstrumentRequestBody): ResponseEntity<kotlin.Any>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package mu.muse.rest.api

import mu.muse.rest.dto.ClientError
import mu.muse.rest.dto.ServerError
import org.springframework.http.HttpStatus
import org.springframework.http.MediaType
import org.springframework.http.ResponseEntity

import org.springframework.web.bind.annotation.*
import org.springframework.validation.annotation.Validated
import org.springframework.web.context.request.NativeWebRequest
import org.springframework.beans.factory.annotation.Autowired

import jakarta.validation.constraints.DecimalMax
import jakarta.validation.constraints.DecimalMin
import jakarta.validation.constraints.Email
import jakarta.validation.constraints.Max
import jakarta.validation.constraints.Min
import jakarta.validation.constraints.NotNull
import jakarta.validation.constraints.Pattern
import jakarta.validation.constraints.Size
import jakarta.validation.Valid

import kotlin.collections.List
import kotlin.collections.Map

@RestController
@Validated
interface DeleteInstrumentByIdApi {


@RequestMapping(
method = [RequestMethod.GET],
value = ["/api/instrument/{instrumentId}/delete"],
produces = ["application/json"]
)
fun deleteInstrumentById( @PathVariable("instrumentId") instrumentId: kotlin.Long): ResponseEntity<kotlin.Any>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package mu.muse.rest.api

import mu.muse.rest.dto.ClientError
import mu.muse.rest.dto.EditInstrumentRequestBody
import mu.muse.rest.dto.ServerError
import org.springframework.http.HttpStatus
import org.springframework.http.MediaType
import org.springframework.http.ResponseEntity

import org.springframework.web.bind.annotation.*
import org.springframework.validation.annotation.Validated
import org.springframework.web.context.request.NativeWebRequest
import org.springframework.beans.factory.annotation.Autowired

import jakarta.validation.constraints.DecimalMax
import jakarta.validation.constraints.DecimalMin
import jakarta.validation.constraints.Email
import jakarta.validation.constraints.Max
import jakarta.validation.constraints.Min
import jakarta.validation.constraints.NotNull
import jakarta.validation.constraints.Pattern
import jakarta.validation.constraints.Size
import jakarta.validation.Valid

import kotlin.collections.List
import kotlin.collections.Map

@RestController
@Validated
interface EditInstrumentApi {


@RequestMapping(
method = [RequestMethod.POST],
value = ["/api/instrument/edit"],
produces = ["application/json"],
consumes = ["application/json"]
)
fun editInstrument( @Valid @RequestBody editInstrumentRequestBody: EditInstrumentRequestBody): ResponseEntity<kotlin.Any>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package mu.muse.rest.api

import mu.muse.rest.dto.ClientError
import mu.muse.rest.dto.GetCountriesResponse
import mu.muse.rest.dto.ServerError
import org.springframework.http.HttpStatus
import org.springframework.http.MediaType
import org.springframework.http.ResponseEntity

import org.springframework.web.bind.annotation.*
import org.springframework.validation.annotation.Validated
import org.springframework.web.context.request.NativeWebRequest
import org.springframework.beans.factory.annotation.Autowired

import jakarta.validation.constraints.DecimalMax
import jakarta.validation.constraints.DecimalMin
import jakarta.validation.constraints.Email
import jakarta.validation.constraints.Max
import jakarta.validation.constraints.Min
import jakarta.validation.constraints.NotNull
import jakarta.validation.constraints.Pattern
import jakarta.validation.constraints.Size
import jakarta.validation.Valid

import kotlin.collections.List
import kotlin.collections.Map

@RestController
@Validated
interface GetCountriesApi {


@RequestMapping(
method = [RequestMethod.GET],
value = ["/api/countries"],
produces = ["application/json"]
)
fun getCountries(): ResponseEntity<GetCountriesResponse>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.8.0).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package mu.muse.rest.api

import mu.muse.rest.dto.ClientError
import mu.muse.rest.dto.GetInstrumentBasicMaterialsResponse
import mu.muse.rest.dto.ServerError
import org.springframework.http.HttpStatus
import org.springframework.http.MediaType
import org.springframework.http.ResponseEntity

import org.springframework.web.bind.annotation.*
import org.springframework.validation.annotation.Validated
import org.springframework.web.context.request.NativeWebRequest
import org.springframework.beans.factory.annotation.Autowired

import jakarta.validation.constraints.DecimalMax
import jakarta.validation.constraints.DecimalMin
import jakarta.validation.constraints.Email
import jakarta.validation.constraints.Max
import jakarta.validation.constraints.Min
import jakarta.validation.constraints.NotNull
import jakarta.validation.constraints.Pattern
import jakarta.validation.constraints.Size
import jakarta.validation.Valid

import kotlin.collections.List
import kotlin.collections.Map

@RestController
@Validated
interface GetInstrumentBasicMaterialsApi {


@RequestMapping(
method = [RequestMethod.GET],
value = ["/api/instrument/materials"],
produces = ["application/json"]
)
fun getInstrumentBasicMaterials(): ResponseEntity<GetInstrumentBasicMaterialsResponse>
}
Loading

0 comments on commit e10594b

Please sign in to comment.