JSONObject 를 return 하는 방식 resultJsonObject.toString().let { ServerResponse .ok() .contentType(MediaType.APPLICATION_JSON) .bodyValueAndAwait(it) MutableList resultJsonArray.toString().let { ServerResponse .ok() .contentType(MediaType.APPLICATION_JSON) .bodyValueAndAwait(it) 별반 다르지 않다. return ServerResponse .ok() .contentType(MediaType.APPLICATION_JSON) .bodyAndAwait(selectMapWithxxxxxx) 리스트 형태로 ..
간단한 건 findBy로 퉁칠수 있다. 하지만 그렇지 않다면 @Query를 사용하거나 QueryDsl을 사용해야 한다. 다양한 예제를 통해서 설명을 하면 //숫자 반환 @Query("select count(*) from ㅌㅌㅌㅌ where title like concat('%', :title, '%')") suspend fun findAllByTitleContainingCount(title: String):Long // 게시물 검색, 여러 리스트 @FlowPreview //여러개일때 붙임 @Query(" select row_number() over ( order by id) as idx, A.id, A.title, A.content,A.created_at \n" + " from ㅌㅌㅌㅌㅌ A \n" + ..
get 방식 (req === ServerRequest) suspend fun xxxxx(req: ServerRequest): ServerResponse { val ipAddress = req.queryParam("ip").get() println("ipAddress ${ipAddress}") post 방식(req === ServerRequest) val getData = req.awaitBodyOrNull().let { val insertData = NewsroomBoard() println(it?.title) println(it?.content) println(it?.thumbnail) }
다른 예제를 보면 대략적으로 만들수는 있는데 값을 html 값으로 변환은 다음과같다. console.log('editorState =>',draftToHtml(convertToRaw(editorState.getCurrentContent())) ) 반대로 draft로 변환하는 것은 다음과 같다.(Axios로 서버에서 import하여 화면에 표시할때) const blocksFromHtml = htmlToDraft(boardResult[0].content); if (blocksFromHtml) { const {contentBlocks, entityMap} = blocksFromHtml; // https://draftjs.org/docs/api-reference-content-state/#createfrombl..