-
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
Showing
107 changed files
with
4,054 additions
and
99 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "maven" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "daily" |
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,50 @@ | ||
# This workflow will build a Java project with Maven | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | ||
|
||
name: Java CI with Maven | ||
|
||
on: push | ||
|
||
jobs: | ||
build: | ||
name: 编译 | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
java-version: [8, 11] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK ${{ matrix.java-version }} | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: ${{ matrix.java-version }} | ||
- name: Build with Maven | ||
run: mvn -B package --file pom.xml | ||
deploy: | ||
name: 部署 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 拉取代码 | ||
uses: actions/checkout@v2 | ||
- name: 安装 JDK 8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 8 | ||
- name: 编译 | ||
run: mvn -B package --file pom.xml | ||
- name: 上传 jar 包 | ||
uses: easingthemes/[email protected] | ||
env: | ||
ARGS: "-rltgoDzvO" | ||
SOURCE: "target/" | ||
REMOTE_HOST: ${{ secrets.HOST }} | ||
REMOTE_USER: ${{ secrets.USER }} | ||
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }} | ||
TARGET: ${{ secrets.REMOTE_TARGET }} | ||
- name: 启动程序 | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USER }} | ||
key: ${{ secrets.SERVER_SSH_KEY }} | ||
script: sh /www/wwwroot/oerp.juzibiji.top/springboot/restart.sh |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
target/ | ||
|
||
#代码生成文件夹 | ||
ge/ | ||
### IntelliJ IDEA ### | ||
.idea | ||
*.iws | ||
|
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 Juzi | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,81 @@ | ||
<p align="center"> | ||
<a href="" target="_blank"> | ||
<img width="200" src="https://img.juzibiji.top/20200715191757.png" alt="logo"> | ||
</a> | ||
</p> | ||
|
||
<p align="center"> | ||
<a href="https://github.com/juzi214032/oerp/actions"> | ||
<img src="https://github.com/juzi214032/oerp/workflows/Java%20CI%20with%20Maven/badge.svg" alt="Github Action"> | ||
</a> | ||
<a href="https://spring.io/"> | ||
<img src="https://img.shields.io/badge/Spring%20Boot-2.3.1.RELEASE-brightgreen" alt="Spring Boot"> | ||
</a> | ||
<a href="https://mp.baomidou.com/"> | ||
<img src="https://img.shields.io/badge/MyBatis%20Plus-3.3.2-blue" alt="MyBatis Plus"> | ||
</a> | ||
<a href="https://en.wikipedia.org/wiki/MIT_License"> | ||
<img src="https://img.shields.io/badge/license-MIT-lightgrey.svg" alt="LISENCE" > | ||
</a> | ||
</p> | ||
|
||
## 介绍 | ||
|
||
OERP 是 Online Examination Registration Platform 的缩写,中文名称为:**在线考试报名平台**。 | ||
|
||
该仓库是 OERP 服务端代码仓库,使用 SpringBoot + Mybatis Plus + MySQL 实现。 | ||
|
||
## 开发环境 | ||
|
||
- Java 8 及以上 | ||
- IDEA 2020.1 | ||
- **IDEA 需要安装插件 [Lombok](https://plugins.jetbrains.com/plugin/index?xmlId=Lombook%20Plugin)** | ||
|
||
## 快速开始 | ||
|
||
- 在你的数据库中新建一个名为`oerp`的数据库 | ||
|
||
- 导入仓库目录`/src/main/resources/oerp.sql`的 SQL 文件 | ||
|
||
- 修改`/src/main/resources/application.yml`中的`spring.datasource`配置为你自己的数据库信息 | ||
|
||
- 在 **IDEA** 或 Eclipse 中启动项目 | ||
|
||
- 访问网址 [http://localhost:8080/api/v1](http://localhost:8080/api/v1),看到如下文字代表系统启动成功: | ||
|
||
![启动成功截图](https://img.juzibiji.top/20200716111640.png) | ||
|
||
## 目录结构 | ||
|
||
``` | ||
|-- src | ||
|-- main | ||
|-- java | ||
| |-- com.juzi.oerp | ||
| |-- OerpApplication.java -> SpringBoot 启动类 | ||
| |-- common -> 项目通用类 | ||
| | |-- constant -> 常量 | ||
| | |-- exception -> 自定义异常 | ||
| | |-- interceptor -> 拦截器(身份认证、权限拦截) | ||
| | |-- jackson -> Jackson 相关 | ||
| | |-- store -> 存储型对象(存储当前登录用户的信息) | ||
| |-- configuration -> 系统配置 | ||
| |-- controller -> 系统 API 接口 | ||
| |-- dao -> 自定义 DAO 层接口(主要做多表查询) | ||
| |-- mapper -> MyBatis Plus Generator 生成的 DAO 接口(主要做单表 CRUD) | ||
| |-- model -> Java POJO | ||
| | |-- dto -> 数据传输对象(主要用在 Controller 与 Service 层之间) | ||
| | | |-- param -> 用于 Controller 层接收参数的对象 | ||
| | |-- po -> 持久层对象(和数据库表一一对应,用在 DAO 层) | ||
| | |-- vo -> 视图层对象(作为 Controller 的返回值) | ||
| |-- service -> 服务层 | ||
| |-- util -> 通用工具类(JWT Token 生成等) | ||
|-- resources | ||
|-- application.yml -> Spring Boot 配置文件 | ||
|-- banner.txt | ||
|-- oerp.sql -> 数据库 SQL 文件(数据库名为 oerp) | ||
|-- mybatis | ||
|-- xml | ||
|-- dao -> 自定义 Mybatis Xml | ||
|-- mapper -> MyBatis Plus Generator 生成的 MyBatis Xml | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,38 @@ | ||
package com.juzi.oerp; | ||
|
||
import org.mybatis.spring.annotation.MapperScan; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.boot.context.properties.ConfigurationPropertiesScan; | ||
import org.springframework.cache.annotation.EnableCaching; | ||
import org.springframework.transaction.annotation.EnableTransactionManagement; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import org.springframework.web.servlet.config.annotation.EnableWebMvc; | ||
|
||
/** | ||
* @author Juzi | ||
*/ | ||
@EnableCaching | ||
@RestController | ||
@SpringBootApplication | ||
@MapperScan("com.juzi.oerp.dao") | ||
@EnableTransactionManagement | ||
@MapperScan({"com.juzi.oerp.dao","com.juzi.oerp.mapper"}) | ||
@ConfigurationPropertiesScan("com.juzi.oerp.configuration.properties") | ||
public class OerpApplication { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(OerpApplication.class, args); | ||
} | ||
|
||
@GetMapping(produces = "text/html;charset=utf-8") | ||
public String index() { | ||
return "<style type=\"text/css\">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} a{color:#2E5CD5;cursor:" + | ||
"pointer;text-decoration: none} a:hover{text-decoration:underline; } body{ background: #fff; font-family:" + | ||
"\"Century Gothic\",\"Microsoft yahei\"; color: #333;font-size:18px;} h1{ font-size: 100px; font-weight: normal;" + | ||
"margin-bottom: 12px; } p{ line-height: 1.6em; font-size: 42px }</style><div style=\"padding: 24px 48px;\"><p align='center'>" + | ||
"<span style=\"font-size:30px\">OERP 在线考试报名系统</span></p></div> "; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/com/juzi/oerp/common/constant/CacheConstants.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,16 @@ | ||
package com.juzi.oerp.common.constant; | ||
|
||
/** | ||
* 缓存常量 | ||
* | ||
* @author Juzi | ||
* @date 2020/7/17 11:56 | ||
*/ | ||
public class CacheConstants { | ||
|
||
/** | ||
* 验证码已经被验证 | ||
*/ | ||
public static final String CAPTCHA_CHECKED = "OK"; | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/com/juzi/oerp/common/constant/JWTConstants.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,14 @@ | ||
package com.juzi.oerp.common.constant; | ||
|
||
/** | ||
* JWT 常量 | ||
* | ||
* @author Juzi | ||
* @date 2020/7/14 15:47 | ||
*/ | ||
public class JWTConstants { | ||
/** | ||
* JWT 签名密钥 | ||
*/ | ||
public static final String JWT_SECRET = "OERP is good!"; | ||
} |
Oops, something went wrong.