From 182ea90dd38f302ffe6a5106222c93db4974c414 Mon Sep 17 00:00:00 2001 From: lunaticbum Date: Tue, 5 Aug 2025 18:01:15 +0900 Subject: [PATCH] ... --- .../back/lun/configs/BumsInterceptor.kt | 3 + .../back/lun/configs/SecurityConfig.kt | 1 + .../back/lun/controllers/Telegram.kt | 17 ++- .../lunaticbum/back/lun/model/RequestModel.kt | 8 ++ src/main/resources/static/js/common.js | 24 +++- .../templates/content/blog/posts.html | 108 +++++++++--------- .../resources/templates/fragments/footer.html | 6 +- 7 files changed, 108 insertions(+), 59 deletions(-) diff --git a/src/main/kotlin/kr/lunaticbum/back/lun/configs/BumsInterceptor.kt b/src/main/kotlin/kr/lunaticbum/back/lun/configs/BumsInterceptor.kt index 2ddc495..f6f4f0d 100644 --- a/src/main/kotlin/kr/lunaticbum/back/lun/configs/BumsInterceptor.kt +++ b/src/main/kotlin/kr/lunaticbum/back/lun/configs/BumsInterceptor.kt @@ -50,6 +50,9 @@ class BumsInterceptor : HandlerInterceptor { // if(remeberMe && authResult != null) { // rememberMeServices.loginSuccess(httpServletRequest, responce, authResult) // } + + modelAndView?.modelMap?.put(EncTypeKey, EncType11) + modelAndView?.modelMap?.put(ApiKeyWordKey,"Def") super.postHandle(request, response, handler, modelAndView) } diff --git a/src/main/kotlin/kr/lunaticbum/back/lun/configs/SecurityConfig.kt b/src/main/kotlin/kr/lunaticbum/back/lun/configs/SecurityConfig.kt index 8dbe24d..e37e8ff 100644 --- a/src/main/kotlin/kr/lunaticbum/back/lun/configs/SecurityConfig.kt +++ b/src/main/kotlin/kr/lunaticbum/back/lun/configs/SecurityConfig.kt @@ -44,6 +44,7 @@ class SecurityConfig( .requestMatchers( "/", "/home.bs", "/bums/where.bs" , + "/tlg/repotToMe.bjx", "/user/login.bs", "/user/signup.bs","/user/login.bjx", "/blog/viewer/**" , "/blog/posts" , "/blog/rankOfViews.bjx","/blog/recentOfPost.bjx", "/css/**", "/js/**", "/images/**", "/webjars/**", "/assets/**").permitAll() diff --git a/src/main/kotlin/kr/lunaticbum/back/lun/controllers/Telegram.kt b/src/main/kotlin/kr/lunaticbum/back/lun/controllers/Telegram.kt index f862e00..44e83cb 100644 --- a/src/main/kotlin/kr/lunaticbum/back/lun/controllers/Telegram.kt +++ b/src/main/kotlin/kr/lunaticbum/back/lun/controllers/Telegram.kt @@ -70,6 +70,21 @@ class Telegram { val keyworkd = arrayListOf("I0Z","dcBEW", "TGyG", "U=Qu", "Bm=s") val keyworkd2 = arrayListOf("x-n", "Y_D", "u", "uoo", "dfhZ", "gSKY") + @ResponseBody + @PostMapping("repotToMe.bjx") + fun repotToMe(@RequestBody jsonString: String): ModelMap { + var returnModelMap = ModelMap() + val decodedBytes: ByteArray = Base64.getDecoder().decode(jsonString) + String(decodedBytes).let { + Gson().fromJson(it, RequestModel::class.java)?.let { model -> + Gson().fromJson(model.data, ReportModel::class.java)?.let { msg -> + sendMsg("${msg.name}님이 전송\n${msg.message}\n회신가능 메일${msg.email}") + } + } + } + return returnModelMap + } + @ResponseBody @GetMapping("kesy/{path}") fun getEncode(@PathVariable path: String): ModelMap { @@ -326,7 +341,7 @@ class Telegram { -// fun chatClient(): ChatClient { + // fun chatClient(): ChatClient { // return OllamaChatClient(OllamaApi("https://lama.lunaticbum.kr")) // .withDefaultOptions( // OllamaOptions.create() diff --git a/src/main/kotlin/kr/lunaticbum/back/lun/model/RequestModel.kt b/src/main/kotlin/kr/lunaticbum/back/lun/model/RequestModel.kt index 79a0ee8..f85ec01 100644 --- a/src/main/kotlin/kr/lunaticbum/back/lun/model/RequestModel.kt +++ b/src/main/kotlin/kr/lunaticbum/back/lun/model/RequestModel.kt @@ -25,4 +25,12 @@ class RequestModel { } return "" } +} + + +@Getter +class ReportModel { + var name : String? = null + var email : String? = null + var message : String? = null } \ No newline at end of file diff --git a/src/main/resources/static/js/common.js b/src/main/resources/static/js/common.js index b2a6c0a..fc0a110 100644 --- a/src/main/resources/static/js/common.js +++ b/src/main/resources/static/js/common.js @@ -1,9 +1,13 @@ +var enc = null +var keyword = null document.addEventListener('DOMContentLoaded', function() { const loginForm = document.getElementById('loginFormElement'); loginForm.addEventListener('submit', function(e) { e.preventDefault(); // 기본 폼 제출 동작 방지 submitLoginForm(); }); + + if (document.querySelector(".rank_of_view")) { fetch('blog/rankOfViews.bjx') .then(response => response.json()) @@ -115,11 +119,29 @@ onload = function() { // window.sessionStorage.setItem("REFRESH",get_cookie("refresh")) // } // } + +function sendTlg(form, type,keyword) { + console.log(form) + let data = { + 'name': form.querySelector("#name").value, + 'email': form.querySelector("#email").value, + 'message': form.querySelector("#message").value, + } + if (data.name != null && data.email != null && data.message != null && data.message.length > 0) { + if(confirm(JSON.stringify(data) + "\n해당 내용으로\n메시지 보내쉴?")) { + post(getMainPath()+"/tlg/repotToMe.bjx",type,JSON.stringify(data),keyword, function (resultData) { + alert(resultData) + }) + } else { + + } + } + return false +} function get_cookie(name) { var value = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)'); return value? value[2] : null; } - function divider(key) { return merge(padding(),key,padding()) } diff --git a/src/main/resources/templates/content/blog/posts.html b/src/main/resources/templates/content/blog/posts.html index 360fefd..c319d66 100644 --- a/src/main/resources/templates/content/blog/posts.html +++ b/src/main/resources/templates/content/blog/posts.html @@ -23,35 +23,35 @@
-
-
-
-

Just a Subheading

-

Phasellus quam turpis, feugiat sit amet ornare in, hendrerit in lectus. - Praesent semper mod quis eget mi. Etiam eu ante risus. Aliquam erat volutpat. - Aliquam luctus et mattis lectus sit amet pulvinar. Nam turpis et nisi etiam.

- -
+ + + + + + + + + + + -
-

Another Subheading

- - -
+ + + + + + + + + + + + + + -
-
+ +
@@ -69,36 +69,36 @@
-
-
+ + -
-

Another Subheading

- - -
+ + + + + + + + + + + + + + -
-

Just a Subheading

-

Phasellus quam turpis, feugiat sit amet ornare in, hendrerit in lectus. - Praesent semper mod quis eget mi. Etiam eu ante risus. Aliquam erat volutpat. - Aliquam luctus et mattis lectus sit amet pulvinar. Nam turpis et nisi etiam.

- -
+ + + + + + + + + -
-
+ +
diff --git a/src/main/resources/templates/fragments/footer.html b/src/main/resources/templates/fragments/footer.html index 78cb362..fda54f4 100644 --- a/src/main/resources/templates/fragments/footer.html +++ b/src/main/resources/templates/fragments/footer.html @@ -30,7 +30,7 @@

Get In Touch

-
+
@@ -43,11 +43,11 @@
    -
  • +
- +