parent
16553744c9
commit
69effe43c9
@ -0,0 +1,34 @@
|
||||
package com.manual.controller;
|
||||
|
||||
import com.worker.scheduler.smg.schedule.SinmungoInOutScheduler;
|
||||
import com.worker.scheduler.update.schedule.WarSyncScheduler;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class RunController {
|
||||
|
||||
private final WarSyncScheduler warSyncScheduler;
|
||||
private final SinmungoInOutScheduler sinmungoInOutScheduler;
|
||||
|
||||
@PostMapping("/menual/update-war")
|
||||
public ResponseEntity<?> updateWar() throws IOException {
|
||||
|
||||
warSyncScheduler.checkAndDeploy();
|
||||
|
||||
return ResponseEntity.ok("Success");
|
||||
}
|
||||
|
||||
@PostMapping("/menual/sinmungo-polling")
|
||||
public ResponseEntity<?> sinmungoPolling() throws IOException {
|
||||
|
||||
sinmungoInOutScheduler.sinmungoAnswerSendScheduler();
|
||||
|
||||
return ResponseEntity.ok("Success");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.manual.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
|
||||
@Controller
|
||||
public class ViewController {
|
||||
|
||||
|
||||
@GetMapping("/")
|
||||
public String home() {
|
||||
|
||||
return "home";
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,66 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>스케쥴러 제어</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>📅 CleanParking 스케쥴러 수동 실행</h1>
|
||||
|
||||
<label for="task">실행할 스케쥴러 선택:</label>
|
||||
<select id="task">
|
||||
<option value="warSync">Get War File from Update Server</option>
|
||||
<option value="sinmungoPolling">Sinmungo Xml DB Polling</option>
|
||||
<!-- 필요한 스케쥴러 추가 -->
|
||||
</select>
|
||||
<button id="runSchedulerBtn">스케줄러 실행</button>
|
||||
|
||||
|
||||
<hr>
|
||||
|
||||
<a href="/manual/logs">🪵 로그 보기</a>
|
||||
</body>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"/>
|
||||
<!--<script type="text/javascript" src="/lib/jquery.js"></script>-->
|
||||
<script>
|
||||
|
||||
const fn = {
|
||||
init: () => {
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
onEventListener: () => {
|
||||
$('#runSchedulerBtn').on('click', function () {
|
||||
const taskName = $('#task').val();
|
||||
|
||||
$.ajax({
|
||||
url: '/manual/run',
|
||||
method: 'POST',
|
||||
data: { task: taskName },
|
||||
success: function (res) {
|
||||
alert('실행 완료: ' + res);
|
||||
},
|
||||
error: function (xhr, status, err) {
|
||||
alert('실패: ' + err);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
fn.onEventListener();
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</html>
|
||||
Loading…
Reference in New Issue