Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0bc0217bac | |||
| eb9ac2cd79 | |||
| 178ae865df | |||
|
|
889fdb2459 | ||
|
|
d761ce30f1 | ||
| 7e29dca769 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -5,6 +5,9 @@ build/
|
|||||||
!**/src/main/**
|
!**/src/main/**
|
||||||
!**/src/test/**
|
!**/src/test/**
|
||||||
|
|
||||||
|
application-mysql.yml
|
||||||
|
application-postgres.yml
|
||||||
|
|
||||||
### STS ###
|
### STS ###
|
||||||
.apt_generated
|
.apt_generated
|
||||||
.classpath
|
.classpath
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
|
||||||
|
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||||
implementation 'io.springfox:springfox-swagger2:2.9.2'
|
implementation 'io.springfox:springfox-swagger2:2.9.2'
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import org.springframework.stereotype.Repository;
|
|||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
@SuppressWarnings("ALL")
|
|
||||||
@Repository
|
@Repository
|
||||||
public interface UserRepository extends BaseRepository<UserEntity, Long> {
|
public interface UserRepository extends BaseRepository<UserEntity, Long> {
|
||||||
Optional<UserEntity> findFirstByEmail(String email);
|
Optional<UserEntity> findFirstByEmail(String email);
|
||||||
|
|||||||
20
src/main/java/com/cubetiqs/demo/ui/HomeController.java
Normal file
20
src/main/java/com/cubetiqs/demo/ui/HomeController.java
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
package com.cubetiqs.demo.ui;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
public class HomeController {
|
||||||
|
@GetMapping(value = {"/index", "", "/", "/index.php"})
|
||||||
|
public String index(Model model) {
|
||||||
|
model.addAttribute("myname", "Sambo");
|
||||||
|
return "index";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(value = {"/admin/users"})
|
||||||
|
public String user(Model model) {
|
||||||
|
model.addAttribute("myname", "Sambo");
|
||||||
|
return "admin/users/index";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,6 +7,6 @@ spring:
|
|||||||
ddl-auto: update
|
ddl-auto: update
|
||||||
datasource:
|
datasource:
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
username: cubetiq
|
username: root
|
||||||
password: Root$
|
password: root
|
||||||
url: jdbc:mysql://192.168.0.150:3306/demo
|
url: jdbc:mysql://192.168.0.150:3306/demo
|
||||||
@@ -7,6 +7,6 @@ spring:
|
|||||||
ddl-auto: update
|
ddl-auto: update
|
||||||
datasource:
|
datasource:
|
||||||
driver-class-name: org.postgresql.Driver
|
driver-class-name: org.postgresql.Driver
|
||||||
username: cubetiq
|
username: root
|
||||||
password: Root$
|
password: root
|
||||||
url: jdbc:postgresql://${POSTGRES_HOST:192.168.0.150}:5432/demo
|
url: jdbc:postgresql://${POSTGRES_HOST:192.168.0.150}:5432/demo
|
||||||
1
src/main/resources/static/js/main.js
Normal file
1
src/main/resources/static/js/main.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
console.log("hello")
|
||||||
13
src/main/resources/templates/admin/users/index.html
Normal file
13
src/main/resources/templates/admin/users/index.html
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport"
|
||||||
|
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
|
<title>Document</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Users</h1>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
13
src/main/resources/templates/index.html
Normal file
13
src/main/resources/templates/index.html
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport"
|
||||||
|
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
|
<title>Index</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1 th:text="${myname}"></h1>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user