-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93f39f2
commit ca8b46c
Showing
18 changed files
with
609 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,23 @@ services: | |
- POSTGRES_DB=appdb | ||
ports: | ||
- "5432:5432" | ||
|
||
pgadmin: | ||
image: dpage/pgadmin4 | ||
extra_hosts: [ 'host.docker.internal:host-gateway' ] | ||
environment: | ||
- [email protected] | ||
- PGADMIN_DEFAULT_PASSWORD=admin | ||
- PGADMIN_CONFIG_SERVER_MODE=False | ||
- PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED=False | ||
ports: | ||
- "5050:80" | ||
depends_on: | ||
postgresqldb: | ||
condition: service_started | ||
volumes: | ||
- ./docker_pgadmin_servers.json:/pgadmin4/servers.json | ||
entrypoint: | ||
- "/bin/sh" | ||
- "-c" | ||
- "/bin/echo 'postgresqldb:5432:*:appuser:secret' > /tmp/pgpassfile && chmod 600 /tmp/pgpassfile && /entrypoint.sh" | ||
restart: unless-stopped |
14 changes: 14 additions & 0 deletions
14
scheduler/boot-scheduler-quartz/docker/docker_pgadmin_servers.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"Servers": { | ||
"1": { | ||
"Name": "Docker Compose", | ||
"Group": "Servers", | ||
"Port": 5432, | ||
"Username": "appuser", | ||
"Host": "postgresqldb", | ||
"SSLMode": "prefer", | ||
"MaintenanceDB": "appdb", | ||
"PassFile": "/tmp/pgpassfile" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
scheduler/boot-scheduler-quartz/src/main/java/com/scheduler/quartz/model/common/Message.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package com.scheduler.quartz.model.common; | ||
|
||
import java.io.Serial; | ||
import java.io.Serializable; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class Message implements Serializable { | ||
|
||
@Serial | ||
private static final long serialVersionUID = 1L; | ||
|
||
public static Message failure(String msg) { | ||
return new Message(false, msg); | ||
} | ||
|
||
public static Message failure(Exception e) { | ||
return new Message(false, e.getMessage()); | ||
} | ||
|
||
public static Message failure() { | ||
return new Message(false); | ||
} | ||
|
||
public static Message success() { | ||
return new Message(true); | ||
} | ||
|
||
public static Message success(String msg) { | ||
return new Message(true, msg); | ||
} | ||
|
||
public Message(boolean valid, String msg) { | ||
super(); | ||
this.valid = valid; | ||
this.msg = msg; | ||
} | ||
|
||
public Message(boolean valid) { | ||
super(); | ||
this.valid = valid; | ||
} | ||
|
||
public void setValid(boolean valid) { | ||
this.valid = valid; | ||
} | ||
|
||
public void setMsg(String msg) { | ||
this.msg = msg; | ||
} | ||
|
||
boolean valid; | ||
String msg; | ||
Object data; | ||
|
||
public void setData(Object data) { | ||
this.valid = true; | ||
this.data = data; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
.../boot-scheduler-quartz/src/main/java/com/scheduler/quartz/model/response/ScheduleJob.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.scheduler.quartz.model.response; | ||
|
||
import java.io.Serializable; | ||
import lombok.With; | ||
|
||
public record ScheduleJob( | ||
@With String jobId, String jobName, String jobGroup, String jobStatus, String cronExpression, String desc) | ||
implements Serializable {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...t-scheduler-quartz/src/main/java/com/scheduler/quartz/web/controller/IndexController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.scheduler.quartz.web.controller; | ||
|
||
import com.scheduler.quartz.model.response.ScheduleJob; | ||
import com.scheduler.quartz.service.JobsService; | ||
import java.util.List; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.ui.Model; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
|
||
@Controller | ||
public class IndexController { | ||
|
||
private final JobsService scheduleJobService; | ||
|
||
public IndexController(JobsService scheduleJobService) { | ||
this.scheduleJobService = scheduleJobService; | ||
} | ||
|
||
@RequestMapping("/index") | ||
public String index(Model model) { | ||
List<ScheduleJob> jobList = scheduleJobService.getJobs(); | ||
model.addAttribute("jobs", jobList); | ||
return "index"; | ||
} | ||
} |
Oops, something went wrong.