Skip to content

Commit

Permalink
add generator update de
Browse files Browse the repository at this point in the history
  • Loading branch information
haiji.yang committed Apr 4, 2020
1 parent b4f3eb9 commit e886d24
Show file tree
Hide file tree
Showing 130 changed files with 2,609 additions and 18 deletions.
5 changes: 5 additions & 0 deletions javayh-demo/javayh-demo-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,10 @@
<artifactId>javayh-swagger-starter</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.javayh</groupId>
<artifactId>javayh-mybatis-starter</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
</project>
37 changes: 36 additions & 1 deletion javayh-demo/javayh-demo-api/src/main/resources/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,39 @@ spring:
file-extension: yaml
shared-dataids: redis.yaml,mail.yaml
messages:
basename: i18n.login.login,i18n.common.common,i18n.validation.validation
basename: i18n.login.login,i18n.common.common,i18n.validation.validation
datasource:
druid:
url: jdbc:mysql://47.105.196.42:3306/db1?serverTimezone=CTT&characterEncoding=utf8&autoReconnect=true&useUnicode=true&useSSL=true
username: root
password: Yhj1219320
driver-class-name: com.mysql.jdbc.Driver
initial-size: 1
min-idle: 1
max-active: 20
max-wait: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 30000
validation-query: select '1' from dual
test-while-idle: true
test-on-borrow: false
test-on-return: false
pool-prepared-statements: false
max-pool-prepared-statement-per-connection-size: 20
filters: stat,wall
aop-patterns: com.javayh.*
web-stat-filter:
enabled: true
url-pattern: /*
exclusions: /druid/*,*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico
session-stat-enable: true
session-stat-max-count: 10
stat-view-servlet:
enabled: true
url-pattern: "/druid/*"
reset-enable: false
login-username: pandora
login-password: bmw.pandor@2020
mybatis:
### xml存放路径
mapper-locations: classpath*:mapper/*/*Mapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>javayh-starter</artifactId>
<artifactId>javayh-dependencies</artifactId>
<groupId>com.javayh</groupId>
<version>1.0.0</version>
</parent>
Expand Down Expand Up @@ -47,6 +47,22 @@
<artifactId>javase</artifactId>
<version>${google.zxing.version}</version>
</dependency>
<!-- <dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>${pagehelpe.version}</version>
</dependency>-->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>${pagehelpe.version}</version>
<exclusions>
<exclusion>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.javayh.common.annotation;

import com.javayh.common.selector.ExceptionSelector;
import com.javayh.common.selector.SpringSelector;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigurationExcludeFilter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
package com.javayh.common.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Min;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;
Expand All @@ -18,6 +23,8 @@
* @version 1.0.0
* @since 2020-04-03 10:43
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
public class BaseEntity<T extends Object>implements Serializable {
private static final long serialVersionUID = 170726482079531378L;
Expand All @@ -26,12 +33,12 @@ public class BaseEntity<T extends Object>implements Serializable {
private String createBy;
/**创建时间*/
@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
private Date createTime;
private Date createDate;
/**修改人*/
private String updateBy;
/**修改时间*/
@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
private Date updateTime;
private Date updateDate;
/**是否删除*/
private String isDelete;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.javayh.common.page;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.validation.constraints.Min;

/**
* <p>
*
* </p>
*
* @author Dylan-haiji
* @version 1.0.0
* @since 2020-04-04 22:41
*/
@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
public class PageEntity {

@Min(value = 1, message = "当前页码不合法")
private int pageNo = 1;

@Min(value = 1, message = "每页展示数据不合法")
private int pageSize;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
package com.javayh.common.page;

import com.github.pagehelper.Page;

import java.util.Collection;
import java.util.List;

/**
* <p>
* 分页工具类
* </p>
* @version 1.0.0
* @author Dylan-haiji
* @since 2020/4/4
*/
public class PageQuery<T> {
/**
* 当前页码
*/
private Integer pageNum;
/**
* 每页显示数量
*/
private Integer pageSize;
/**
* 总条目数
*/
private Long totalCount;
/**
* 总页数
*/
private Integer totalPage;

private List<T> list;

public PageQuery() {
}

public static <T> PageQuery<T> ofPage(List<T> list) {
return new PageQuery<>(list);
}
private PageQuery(List<T> list) {
this.list = list;
if (list instanceof Page) {
Page page = (Page)list;
this.pageNum = page.getPageNum();
this.pageSize = page.getPageSize();
this.totalPage = page.getPages();
this.totalCount = page.getTotal();
} else {
this.pageNum = 1;
this.pageSize = ((Collection) list).size();
this.totalPage = this.pageSize > 0 ? 1 : 0;
this.totalCount = (long) ((Collection) list).size();
}

}

public Integer getPageNum() {
return pageNum;
}

public void setPageNum(Integer pageNum) {
this.pageNum = pageNum;
}

public Integer getPageSize() {
return pageSize;
}

public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}

public Long getTotalCount() {
return totalCount;
}

public void setTotalCount(Long totalCount) {
this.totalCount = totalCount;
}

public Integer getTotalPage() {
return totalPage;
}

public void setTotalPage(Integer totalPage) {
this.totalPage = totalPage;
}

public List<T> getList() {
return list;
}

public void setList(List<T> list) {
this.list = list;
}
}
22 changes: 22 additions & 0 deletions javayh-dependencies/javayh-db-starter/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>javayh-dependencies</artifactId>
<groupId>com.javayh</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<description>关系性数据库多数据源</description>
<artifactId>javayh-db-starter</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.javayh</groupId>
<artifactId>javayh-mybatis-starter</artifactId>
<optional>true</optional>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>javayh-starter</artifactId>
<artifactId>javayh-dependencies</artifactId>
<groupId>com.javayh</groupId>
<version>1.0.0</version>
</parent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>javayh-starter</artifactId>
<artifactId>javayh-dependencies</artifactId>
<groupId>com.javayh</groupId>
<version>1.0.0</version>
</parent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>javayh-starter</artifactId>
<artifactId>javayh-dependencies</artifactId>
<groupId>com.javayh</groupId>
<version>1.0.0</version>
</parent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>javayh-starter</artifactId>
<artifactId>javayh-dependencies</artifactId>
<groupId>com.javayh</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<description>关系性数据库</description>
<artifactId>javayh-db-starter</artifactId>
<packaging>jar</packaging>

<artifactId>javayh-mybatis-starter</artifactId>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -31,6 +31,16 @@
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
</dependency>
</dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.connector.version}</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>${pagehelpe.version}</version>
</dependency>

</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>javayh-starter</artifactId>
<artifactId>javayh-dependencies</artifactId>
<groupId>com.javayh</groupId>
<version>1.0.0</version>
</parent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>javayh-starter</artifactId>
<artifactId>javayh-dependencies</artifactId>
<groupId>com.javayh</groupId>
<version>1.0.0</version>
</parent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>javayh-starter</artifactId>
<artifactId>javayh-dependencies</artifactId>
<groupId>com.javayh</groupId>
<version>1.0.0</version>
</parent>
Expand Down
3 changes: 2 additions & 1 deletion javayh-starter/pom.xml → javayh-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>javayh-starter</artifactId>
<artifactId>javayh-dependencies</artifactId>
<packaging>pom</packaging>
<modules>
<module>javayh-common-starter</module>
Expand All @@ -20,6 +20,7 @@
<module>javayh-nacos-starter</module>
<module>javayh-kafka-starter</module>
<module>javayh-mail-starter</module>
<module>javayh-mybatis-starter</module>
</modules>


Expand Down
Loading

0 comments on commit e886d24

Please sign in to comment.