pull/1/head
759675757@qq.com 2019-06-12 13:08:38 +08:00
parent 01a88e72d7
commit 0f2cfec518
11 changed files with 53 additions and 44 deletions

View File

@ -4,7 +4,8 @@
以此项目来进行骨架的生成
#### 软件架构
软件架构说明
单体项目生成骨架,具备基本功能,如:后台管理界面,权限认证。
#### 安装教程

View File

@ -65,8 +65,8 @@ public final class IdUtil {
private static long lastEpoch = 0;
public static long nextId() {
return nextId(System.currentTimeMillis() / 1000);
public static String nextId() {
return String.valueOf(nextId(System.currentTimeMillis() / 1000));
}
private static synchronized long nextId(long epochSecond) {

View File

@ -10,7 +10,9 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap;
import java.util.Map;
@ -49,4 +51,5 @@ public class SysUserController {
sysUserService.add(sysUser, roles);
return ApiResponse.ok();
}
}

View File

@ -18,7 +18,7 @@ public class SysUser implements Serializable {
@Id
@Column(name = "ID")
private Long id;
private String id;
@Column(name = "NAME")
private String name;
@Column(name = "USERNAME")
@ -26,11 +26,11 @@ public class SysUser implements Serializable {
@Column(name = "PASSWORD")
private String password;
public Long getId() {
public String getId() {
return id;
}
public void setId(Long id) {
public void setId(String id) {
this.id = id;
}

View File

@ -9,6 +9,7 @@ import java.util.Map;
/**
* UserService
*
* @author songpeng
* @date 2019/4/20.
*/
@ -16,6 +17,7 @@ public interface SysUserService {
/**
*
*
* @param pageRequest
* @return
*/
@ -23,6 +25,7 @@ public interface SysUserService {
/**
*
*
* @param paramMap
* @return
*/

View File

@ -76,4 +76,5 @@ public class SysUserServiceImpl implements SysUserService, UserDetailsService {
LOGGER.info("user insert id: {}", sysUser.getId());
sysUserMapper.insertSelective(sysUser);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html xmlns:th="https://www.thymeleaf.org/">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html>
<html xmlns:th="https://www.thymeleaf.org/">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

View File

@ -1,4 +1,3 @@
<html xmlns:th="http://www.thymeleaf.org">
<head th:fragment="header">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

View File

@ -1,18 +1,18 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<html xmlns:th="https://www.thymeleaf.org/">
<html>
<meta charset="utf-8">
<head th:include="client/blog/include::header"></head>
<body>
<nav th:include="client/blog/include::nav" class="navbar navbar-default navbar-custom navbar-fixed-top" ></nav>
<nav th:include="client/blog/include::nav" class="navbar navbar-default navbar-custom navbar-fixed-top"></nav>
<header class="intro-header"
style="background-image: url('/img/blog/home-bg.jpg')">
style="background-image: url('/img/blog/home-bg-old.jpg')">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="site-heading">
<h1>SongPeng Blog</h1>
<span class="subheading">宋鹏的博客</span>
<span class="subheading">博客</span>
</div>
</div>
</div>
@ -31,6 +31,7 @@
</div>
</div>
</div>
<div id="allmap"></div>
</div>
</body>
<div th:include="client/blog/include::footer"></div>
@ -38,45 +39,46 @@
var limit = 10;
var currentPage = 0;
var total;
$(function(){
$(function () {
bindList(0);
});
function nextPage() {
bindList(currentPage * limit)
}
function bindList(offset) {
$.ajax({
url : 'blog/open/list?type=article&limit=10&offset=' + offset,
method : 'get',
dataType : 'json',
success : function(data) {
var rows = data.rows;
total = data.total;
var htmlText = "";
for (i = 0; i < rows.length; i++) {
htmlText += '<div class="post-preview">';
htmlText += '<a href="/blog/open/post/' + rows[i].cid + '">';
htmlText += '<h2 class="post-title">';
htmlText += rows[i].title;
htmlText += '</h2>';
htmlText += '</a>';
htmlText += '<p class="post-meta">作者:<a href="#">'
+ rows[i].author
+ '</a> &nbsp;&nbsp; '
+ rows[i].gtmModified + '</p>';
htmlText += '</div>';
htmlText += '<hr>';
}
$("#incomeNum").append(htmlText);
document.getElementById("flagLoad").style.display = "block";
currentPage++;
if (total <= currentPage * limit) {
document.getElementById("flagLoaded").style.display = "block";
document.getElementById("flagLoad").style.display = "none";
}
url: 'blog/open/list?type=article&limit=10&offset=' + offset,
method: 'get',
dataType: 'json',
success: function (data) {
var rows = data.rows;
total = data.total;
var htmlText = "";
for (i = 0; i < rows.length; i++) {
htmlText += '<div class="post-preview">';
htmlText += '<a href="/blog/open/post/' + rows[i].cid + '">';
htmlText += '<h2 class="post-title">';
htmlText += rows[i].title;
htmlText += '</h2>';
htmlText += '</a>';
htmlText += '<p class="post-meta">作者:<a href="#">'
+ rows[i].author
+ '</a> &nbsp;&nbsp; '
+ rows[i].gtmModified + '</p>';
htmlText += '</div>';
htmlText += '<hr>';
}
});
$("#incomeNum").append(htmlText);
document.getElementById("flagLoad").style.display = "block";
currentPage++;
if (total <= currentPage * limit) {
document.getElementById("flagLoaded").style.display = "block";
document.getElementById("flagLoad").style.display = "none";
}
}
});
}
</script>
</html>