...
This commit is contained in:
parent
e187006627
commit
075e5b50c8
@ -1,6 +1,5 @@
|
|||||||
package kr.lunaticbum.back.lun
|
package kr.lunaticbum.back.lun
|
||||||
|
|
||||||
import jdk.incubator.vector.VectorOperators.Test
|
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication
|
import org.springframework.boot.autoconfigure.SpringBootApplication
|
||||||
import org.springframework.boot.runApplication
|
import org.springframework.boot.runApplication
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling
|
import org.springframework.scheduling.annotation.EnableScheduling
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package kr.lunaticbum.back.lun.configs
|
|||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Value
|
import org.springframework.beans.factory.annotation.Value
|
||||||
import org.springframework.context.annotation.Configuration
|
import org.springframework.context.annotation.Configuration
|
||||||
import org.springframework.web.reactive.config.ResourceHandlerRegistry
|
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,6 @@ package kr.lunaticbum.back.lun.configs
|
|||||||
import org.springframework.context.annotation.ComponentScan
|
import org.springframework.context.annotation.ComponentScan
|
||||||
import org.springframework.context.annotation.Configuration
|
import org.springframework.context.annotation.Configuration
|
||||||
import org.springframework.context.annotation.FilterType
|
import org.springframework.context.annotation.FilterType
|
||||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc
|
|
||||||
|
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
|
|||||||
@ -8,6 +8,12 @@ import org.springframework.stereotype.Component
|
|||||||
@Component
|
@Component
|
||||||
class GlobalEnvironment : EnvironmentAware {
|
class GlobalEnvironment : EnvironmentAware {
|
||||||
companion object {
|
companion object {
|
||||||
|
val EncTypeKey = "enc"
|
||||||
|
val EncType00 = "T0"
|
||||||
|
val EncType11 = "T3"
|
||||||
|
val EncType10 = "T2"
|
||||||
|
val EncType01 = "T1"
|
||||||
|
val ApiKeyWordKey = "keyword"
|
||||||
private val pad = "%7C%2A-%2A%7C"
|
private val pad = "%7C%2A-%2A%7C"
|
||||||
fun padding(key : String) = pad.plus(key).plus(pad)
|
fun padding(key : String) = pad.plus(key).plus(pad)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,6 @@
|
|||||||
package kr.lunaticbum.back.lun.configs
|
package kr.lunaticbum.back.lun.configs
|
||||||
|
|
||||||
import com.mongodb.reactivestreams.client.MongoClient
|
|
||||||
import org.springframework.context.annotation.Bean
|
|
||||||
import org.springframework.context.annotation.Configuration
|
import org.springframework.context.annotation.Configuration
|
||||||
import org.springframework.data.mongodb.core.MongoTemplate
|
|
||||||
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories
|
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories
|
||||||
import org.springframework.scheduling.annotation.EnableAsync
|
import org.springframework.scheduling.annotation.EnableAsync
|
||||||
|
|
||||||
|
|||||||
@ -1,14 +1,5 @@
|
|||||||
package kr.lunaticbum.back.lun.configs
|
package kr.lunaticbum.back.lun.configs
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired
|
|
||||||
import org.springframework.beans.factory.annotation.Qualifier
|
|
||||||
import org.springframework.context.annotation.ComponentScan
|
|
||||||
import org.springframework.context.annotation.Configuration
|
|
||||||
import org.springframework.http.CacheControl
|
|
||||||
import org.springframework.web.servlet.HandlerInterceptor
|
|
||||||
import org.springframework.web.servlet.config.annotation.*
|
|
||||||
import java.util.concurrent.TimeUnit
|
|
||||||
|
|
||||||
|
|
||||||
//// Spring MVC 프로젝트에 관련된 설정을 하는 클래스
|
//// Spring MVC 프로젝트에 관련된 설정을 하는 클래스
|
||||||
//@Configuration // Controller 어노테이션이 셋팅되어 있는 클래스를 Controller로 등록한다.
|
//@Configuration // Controller 어노테이션이 셋팅되어 있는 클래스를 Controller로 등록한다.
|
||||||
|
|||||||
@ -6,9 +6,9 @@ import com.google.gson.Gson
|
|||||||
import jakarta.servlet.http.HttpServletRequest
|
import jakarta.servlet.http.HttpServletRequest
|
||||||
import jakarta.servlet.http.HttpServletResponse
|
import jakarta.servlet.http.HttpServletResponse
|
||||||
import kr.lunaticbum.back.lun.configs.GlobalEnvironment
|
import kr.lunaticbum.back.lun.configs.GlobalEnvironment
|
||||||
import kr.lunaticbum.back.lun.controllers.UserController.Companion.ApiKeyWordKey
|
import kr.lunaticbum.back.lun.configs.GlobalEnvironment.Companion.ApiKeyWordKey
|
||||||
import kr.lunaticbum.back.lun.controllers.UserController.Companion.EncType11
|
import kr.lunaticbum.back.lun.configs.GlobalEnvironment.Companion.EncType11
|
||||||
import kr.lunaticbum.back.lun.controllers.UserController.Companion.EncTypeKey
|
import kr.lunaticbum.back.lun.configs.GlobalEnvironment.Companion.EncTypeKey
|
||||||
import kr.lunaticbum.back.lun.model.*
|
import kr.lunaticbum.back.lun.model.*
|
||||||
import kr.lunaticbum.back.lun.utils.LogService
|
import kr.lunaticbum.back.lun.utils.LogService
|
||||||
import kr.lunaticbum.back.lun.utils.getFileExtension
|
import kr.lunaticbum.back.lun.utils.getFileExtension
|
||||||
@ -80,11 +80,11 @@ class BlogController() {
|
|||||||
logService.log(Gson().toJson(model))
|
logService.log(Gson().toJson(model))
|
||||||
model.data?.let { jsonString ->
|
model.data?.let { jsonString ->
|
||||||
try {
|
try {
|
||||||
val reqString = jsonString.split(globalEvv.padding(model.getKeyword()))
|
val reqString = jsonString.split(GlobalEnvironment.padding(model.getKeyword()))
|
||||||
val nb = arrayListOf<String>()
|
val nb = arrayListOf<String>()
|
||||||
val na = arrayListOf<String>()
|
val na = arrayListOf<String>()
|
||||||
reqString[0].replace(globalEvv.padding(model.getKeyword()),"").split("").toList().let { na.addAll(it) }
|
reqString[0].replace(GlobalEnvironment.padding(model.getKeyword()),"").split("").toList().let { na.addAll(it) }
|
||||||
reqString[1].replace(globalEvv.padding(model.getKeyword()),"").split("").toList().let { nb.addAll(it) }
|
reqString[1].replace(GlobalEnvironment.padding(model.getKeyword()),"").split("").toList().let { nb.addAll(it) }
|
||||||
var max = nb.size + na.size
|
var max = nb.size + na.size
|
||||||
var fullData = arrayListOf<String>()
|
var fullData = arrayListOf<String>()
|
||||||
for (idx in 0..max) { if (idx % 2 == 0) { if (nb.size > 0) { fullData.add(nb.removeLast()) } } else { if (na.size > 0) { fullData.add(na.removeLast()) } } }
|
for (idx in 0..max) { if (idx % 2 == 0) { if (nb.size > 0) { fullData.add(nb.removeLast()) } } else { if (na.size > 0) { fullData.add(na.removeLast()) } } }
|
||||||
@ -144,7 +144,8 @@ class BlogController() {
|
|||||||
postManageg.find20()?.apply {
|
postManageg.find20()?.apply {
|
||||||
forEach {
|
forEach {
|
||||||
it.title = URLDecoder.decode(it.title)
|
it.title = URLDecoder.decode(it.title)
|
||||||
it.content = URLDecoder.decode(it.content)
|
val content = URLDecoder.decode(it.content)
|
||||||
|
it.content = if (content.length > 50) content.substring(0,50) else content
|
||||||
}
|
}
|
||||||
vm.modelMap.put("chunkedPosts", this.chunked(3))
|
vm.modelMap.put("chunkedPosts", this.chunked(3))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,9 @@ import kotlinx.coroutines.CoroutineScope
|
|||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kr.lunaticbum.back.lun.configs.GlobalEnvironment
|
import kr.lunaticbum.back.lun.configs.GlobalEnvironment
|
||||||
import kr.lunaticbum.back.lun.model.*
|
import kr.lunaticbum.back.lun.model.LocationLog
|
||||||
|
import kr.lunaticbum.back.lun.model.LocationLogService
|
||||||
|
import kr.lunaticbum.back.lun.model.ResponceResult
|
||||||
import kr.lunaticbum.back.lun.utils.LogService
|
import kr.lunaticbum.back.lun.utils.LogService
|
||||||
import org.springframework.beans.factory.annotation.Autowired
|
import org.springframework.beans.factory.annotation.Autowired
|
||||||
import org.springframework.http.MediaType
|
import org.springframework.http.MediaType
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import org.springframework.web.bind.annotation.RequestMapping
|
|||||||
import org.springframework.web.bind.annotation.RestController
|
import org.springframework.web.bind.annotation.RestController
|
||||||
import org.springframework.web.servlet.ModelAndView
|
import org.springframework.web.servlet.ModelAndView
|
||||||
import java.net.URLDecoder
|
import java.net.URLDecoder
|
||||||
import java.net.http.HttpClient.Redirect
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping()
|
@RequestMapping()
|
||||||
|
|||||||
@ -4,14 +4,10 @@ import com.google.gson.Gson
|
|||||||
import jakarta.servlet.http.HttpServletRequest
|
import jakarta.servlet.http.HttpServletRequest
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.GlobalScope
|
|
||||||
import kotlinx.coroutines.flow.asFlow
|
|
||||||
import kotlinx.coroutines.flow.onCompletion
|
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kr.lunaticbum.back.lun.configs.GlobalEnvironment
|
import kr.lunaticbum.back.lun.configs.GlobalEnvironment
|
||||||
import kr.lunaticbum.back.lun.model.*
|
import kr.lunaticbum.back.lun.model.*
|
||||||
import kr.lunaticbum.back.lun.utils.LogService
|
import kr.lunaticbum.back.lun.utils.LogService
|
||||||
import org.jsoup.Jsoup
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired
|
import org.springframework.beans.factory.annotation.Autowired
|
||||||
import org.springframework.context.annotation.Bean
|
import org.springframework.context.annotation.Bean
|
||||||
import org.springframework.scheduling.annotation.Scheduled
|
import org.springframework.scheduling.annotation.Scheduled
|
||||||
@ -19,10 +15,8 @@ import org.springframework.web.bind.annotation.*
|
|||||||
import org.springframework.web.reactive.function.client.WebClient
|
import org.springframework.web.reactive.function.client.WebClient
|
||||||
import java.math.BigDecimal
|
import java.math.BigDecimal
|
||||||
import java.math.RoundingMode
|
import java.math.RoundingMode
|
||||||
import java.text.SimpleDateFormat
|
|
||||||
import java.time.Duration
|
import java.time.Duration
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import java.util.concurrent.TimeUnit
|
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
|
|||||||
@ -3,6 +3,9 @@ package kr.lunaticbum.back.lun.controllers
|
|||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import jakarta.servlet.http.HttpServletRequest
|
import jakarta.servlet.http.HttpServletRequest
|
||||||
import kr.lunaticbum.back.lun.configs.GlobalEnvironment
|
import kr.lunaticbum.back.lun.configs.GlobalEnvironment
|
||||||
|
import kr.lunaticbum.back.lun.configs.GlobalEnvironment.Companion.ApiKeyWordKey
|
||||||
|
import kr.lunaticbum.back.lun.configs.GlobalEnvironment.Companion.EncType11
|
||||||
|
import kr.lunaticbum.back.lun.configs.GlobalEnvironment.Companion.EncTypeKey
|
||||||
import kr.lunaticbum.back.lun.model.RequestModel
|
import kr.lunaticbum.back.lun.model.RequestModel
|
||||||
import kr.lunaticbum.back.lun.model.ResponceResult
|
import kr.lunaticbum.back.lun.model.ResponceResult
|
||||||
import kr.lunaticbum.back.lun.model.User
|
import kr.lunaticbum.back.lun.model.User
|
||||||
@ -17,18 +20,13 @@ import org.springframework.web.reactive.function.client.WebClient
|
|||||||
import org.springframework.web.servlet.ModelAndView
|
import org.springframework.web.servlet.ModelAndView
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import kotlin.math.log
|
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/user")
|
@RequestMapping("/user")
|
||||||
class UserController {
|
class UserController {
|
||||||
val EncTypeKey = "enc"
|
|
||||||
val EncType00 = "T0"
|
|
||||||
val EncType11 = "T3"
|
|
||||||
val EncType10 = "T2"
|
|
||||||
val EncType01 = "T1"
|
|
||||||
val ApiKeyWordKey = "keyword"
|
|
||||||
@Autowired
|
@Autowired
|
||||||
lateinit var globalEvv : GlobalEnvironment
|
lateinit var globalEvv : GlobalEnvironment
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,2 @@
|
|||||||
package kr.lunaticbum.back.lun.model
|
package kr.lunaticbum.back.lun.model
|
||||||
|
|
||||||
import lombok.Getter
|
|
||||||
import lombok.NoArgsConstructor
|
|
||||||
import lombok.Setter
|
|
||||||
import org.springframework.data.annotation.Id
|
|
||||||
|
|
||||||
|
|||||||
@ -19,8 +19,6 @@ import reactor.core.publisher.Mono
|
|||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.time.Duration
|
import java.time.Duration
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import kotlin.collections.ArrayList
|
|
||||||
import kotlin.collections.List
|
|
||||||
|
|
||||||
class BumsPrivate {
|
class BumsPrivate {
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,16 +5,12 @@ import lombok.AllArgsConstructor
|
|||||||
import lombok.Data
|
import lombok.Data
|
||||||
import lombok.NoArgsConstructor
|
import lombok.NoArgsConstructor
|
||||||
import org.bson.BsonType
|
import org.bson.BsonType
|
||||||
import org.bson.codecs.pojo.annotations.BsonCreator
|
|
||||||
import org.bson.codecs.pojo.annotations.BsonId
|
import org.bson.codecs.pojo.annotations.BsonId
|
||||||
import org.bson.codecs.pojo.annotations.BsonRepresentation
|
import org.bson.codecs.pojo.annotations.BsonRepresentation
|
||||||
import org.springframework.beans.factory.annotation.Autowired
|
import org.springframework.beans.factory.annotation.Autowired
|
||||||
import org.springframework.data.domain.Pageable
|
import org.springframework.data.domain.Pageable
|
||||||
import org.springframework.data.mongodb.core.mapping.Document
|
import org.springframework.data.mongodb.core.mapping.Document
|
||||||
import org.springframework.data.mongodb.repository.Query
|
|
||||||
import org.springframework.data.mongodb.repository.ReactiveMongoRepository
|
import org.springframework.data.mongodb.repository.ReactiveMongoRepository
|
||||||
import org.springframework.security.core.userdetails.UserDetails
|
|
||||||
import org.springframework.security.core.userdetails.UserDetailsService
|
|
||||||
import org.springframework.security.crypto.password.PasswordEncoder
|
import org.springframework.security.crypto.password.PasswordEncoder
|
||||||
import org.springframework.stereotype.Repository
|
import org.springframework.stereotype.Repository
|
||||||
import org.springframework.stereotype.Service
|
import org.springframework.stereotype.Service
|
||||||
|
|||||||
@ -13,7 +13,6 @@ import org.springframework.data.mongodb.repository.ReactiveMongoRepository
|
|||||||
import org.springframework.stereotype.Repository
|
import org.springframework.stereotype.Repository
|
||||||
import org.springframework.stereotype.Service
|
import org.springframework.stereotype.Service
|
||||||
import reactor.core.publisher.Mono
|
import reactor.core.publisher.Mono
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
|
|
||||||
// import com.fasterxml.jackson.databind.ObjectMapper; // version 2.11.1
|
// import com.fasterxml.jackson.databind.ObjectMapper; // version 2.11.1
|
||||||
|
|||||||
@ -1,8 +1,2 @@
|
|||||||
package kr.lunaticbum.back.lun.service
|
package kr.lunaticbum.back.lun.service
|
||||||
|
|
||||||
import kr.lunaticbum.back.lun.model.User
|
|
||||||
import kr.lunaticbum.back.lun.model.UserRepository
|
|
||||||
import lombok.RequiredArgsConstructor
|
|
||||||
import org.springframework.security.core.userdetails.UserDetails
|
|
||||||
import org.springframework.security.core.userdetails.UsernameNotFoundException
|
|
||||||
import org.springframework.stereotype.Service
|
|
||||||
|
|||||||
@ -1,12 +1,5 @@
|
|||||||
package kr.lunaticbum.back.lun.utils
|
package kr.lunaticbum.back.lun.utils
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor
|
|
||||||
import org.apache.logging.log4j.util.InternalException
|
|
||||||
import org.springframework.http.HttpMethod
|
|
||||||
import org.springframework.http.HttpStatus
|
|
||||||
import org.springframework.stereotype.Component
|
|
||||||
import reactor.core.publisher.Mono
|
|
||||||
|
|
||||||
|
|
||||||
//@Component
|
//@Component
|
||||||
//@RequiredArgsConstructor
|
//@RequiredArgsConstructor
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user