forked from lanyulei/ferry
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request lanyulei#28 from lanyulei/dev
github 托管教程文档。
- Loading branch information
Showing
14 changed files
with
485 additions
and
0 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 @@ | ||
theme: jekyll-theme-cayman |
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,5 @@ | ||
# 会签 | ||
|
||
当在一个阶段出现多个处理人的时候,同时也需要多个处理人都处理完成,才可以进入下一个阶段的时候,则需要选择上会签的功能。 | ||
|
||
也就说,如果选择了会签,则需要当前阶段的所有人处理完成,才能进入下一个阶段。 |
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,29 @@ | ||
# Mac、Linux、Windows下分别进行交叉编译 | ||
|
||
Golang 支持交叉编译,在一个平台上生成另一个平台的可执行程序。 | ||
|
||
Mac 下编译 Linux 和 Windows 64位可执行程序 | ||
|
||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build main.go | ||
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build main.go | ||
|
||
Linux 下编译 Mac 和 Windows 64位可执行程序 | ||
|
||
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build main.go | ||
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build main.go | ||
|
||
Windows 下编译 Mac 和 Linux 64位可执行程序 | ||
|
||
SET CGO_ENABLED=0 | ||
SET GOOS=darwin | ||
SET GOARCH=amd64 | ||
go build main.go | ||
------------------------------------------------- | ||
SET CGO_ENABLED=0 | ||
SET GOOS=linux | ||
SET GOARCH=amd64 | ||
go build main.go | ||
|
||
GOOS:目标平台的操作系统(darwin、freebsd、linux、windows)。 | ||
GOARCH:目标平台的体系架构(386、amd64、arm)。 | ||
CGO_ENABLED:交叉编译不支持 CGO 所以要禁用它。 |
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,5 @@ | ||
# 结单 | ||
|
||
当发现提交的工单有误,可以根据实际情况,直接结束工单。 | ||
|
||
![](https://www.fdevops.com/wp-content/uploads/2020/07/image-12.png) |
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,17 @@ | ||
# 排他网关 | ||
|
||
在平时的业务中,有的时候需要根据表单数据的值来判断跳转到啥位置。 | ||
|
||
例如:如果申请的服务器价格低于1000元就是部门领导审批,如果超过1000元,那么就是CTO审批。为兼容这种情况因此加入了排他网关的概念。 | ||
|
||
此外还需注意,如果使用了排他网关,则必须有一个条件判断是正确的,否则流程将无法进行下去,报错失败。 | ||
|
||
将下面的Json格式数据,修改为自己的表单数据,写入到对应的流转线条中即可,但是流转线条的源阶段必须要排他网关的图标。 | ||
|
||
[ | ||
{ | ||
"key":"字段名称", | ||
"sign":"==", | ||
"value":"需要判断的值" | ||
} | ||
] |
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,5 @@ | ||
# 转交 | ||
|
||
进行工单转交,只能在当前阶段将工单转交给他人。 | ||
|
||
![](https://www.fdevops.com/wp-content/uploads/2020/07/image-11.png) |
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,59 @@ | ||
# IDE开发 | ||
|
||
众多 IDE 里边,推荐使用 `goland IDE`进行调试 | ||
|
||
首先我们启动 `Goland` , 点击 `Open Project`,下图红框圈选部分; | ||
|
||
![](https://www.fdevops.com/wp-content/uploads/2020/08/image.png) | ||
|
||
选择 ferry 存放的路径,找到并打开; | ||
|
||
# 配置 GOPORXY | ||
|
||
然后选择`Goland` > `Preferences` ; | ||
|
||
![](https://www.fdevops.com/wp-content/uploads/2020/08/image-1.png) | ||
|
||
# 添加运行或调试配置 | ||
|
||
### 添加 init 配置 | ||
|
||
1\. 打开`Edit Configurations` | ||
|
||
![](https://www.fdevops.com/wp-content/uploads/2020/08/image-2.png) | ||
|
||
2\. 选择 `+` > `go build` | ||
|
||
![](https://www.fdevops.com/wp-content/uploads/2020/08/image-3.png) | ||
|
||
3\. 按照下图所示进行配置,注意:填写 `Program arguments` 为 `init -c=config/settings.dev.yml`,完成之后点击保存 | ||
|
||
![](https://www.fdevops.com/wp-content/uploads/2020/08/image-4.png) | ||
|
||
4\. 修改数据库 | ||
|
||
![](https://www.fdevops.com/wp-content/uploads/2020/08/image-5.png) | ||
|
||
5\. 初使化 | ||
|
||
![](https://www.fdevops.com/wp-content/uploads/2020/08/image-6.png) | ||
|
||
### 添加 server 配置 | ||
|
||
1\. 打开`Edit Configurations` | ||
|
||
![](https://www.fdevops.com/wp-content/uploads/2020/08/image-7.png) | ||
|
||
2\. 选择 `+` > `go build` | ||
|
||
![](https://www.fdevops.com/wp-content/uploads/2020/08/image-8.png) | ||
|
||
3\. 按照下图所示进行配置,注意:填写 `Program arguments` 为`server -c=config/settings.dev.yml`,完成之后点击保存 | ||
|
||
![](https://www.fdevops.com/wp-content/uploads/2020/08/image-9.png) | ||
|
||
4\. 启动 debug | ||
|
||
![](https://www.fdevops.com/wp-content/uploads/2020/08/image-10.png) | ||
|
||
转载自:[http://doc.zhangwj.com/go-admin-site/guide/ide.html#%E6%B7%BB%E5%8A%A0-server-%E9%85%8D%E7%BD%AE](http://doc.zhangwj.com/go-admin-site/guide/ide.html#%E6%B7%BB%E5%8A%A0-server-%E9%85%8D%E7%BD%AE) |
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,15 @@ | ||
# 目录 | ||
|
||
* [介绍](https://lanyulei.github.io/ferry_docs/introduction "介绍") | ||
* [安装](https://lanyulei.github.io/ferry_docs/install "安装") | ||
* [IDE 开发](https://lanyulei.github.io/ferry_docs/ide_development "IDE 开发") | ||
* [系统管理](https://lanyulei.github.io/ferry_docs/system_manager "系统管理") | ||
* 工单系统 | ||
* * [创建一个新流程](https://lanyulei.github.io/ferry_docs/new_process "创建一个新流程") | ||
* * [催办](https://lanyulei.github.io/ferry_docs/urge "催办") | ||
* * [转交](https://lanyulei.github.io/ferry_docs/forward "转交") | ||
* * [结单](https://lanyulei.github.io/ferry_docs/end_process "结单") | ||
* * [排他网关](https://lanyulei.github.io/ferry_docs/exclusive_gateway "排他网关") | ||
* * [并行网关](https://lanyulei.github.io/ferry_docs/parallel_gateway "并行网关") | ||
* * [会签](https://lanyulei.github.io/ferry_docs/countersign "会签") | ||
* [Mac、Linux、Windows下分别进行交叉编译](https://lanyulei.github.io/ferry_docs/cross_compile "Mac、Linux、Windows下分别进行交叉编译") |
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,226 @@ | ||
# 安装 | ||
|
||
> 需注意因使用到了json类型的字段,因此MySQL需是5.7以上的版本。 | ||
> | ||
> MySQL > 5.7 | ||
> | ||
> Go >= 1.14 | ||
> | ||
> Redis | ||
若是安装出错,请先确认redis及MySQL是否安装配置成功,若是还有问题,可在群内提问。 | ||
|
||
## 配置文件介绍 | ||
|
||
script: | ||
path: ./static/scripts # 任务脚本路径 | ||
settings: | ||
application: | ||
domain: localhost:8002 # 用于将HTTP请求重定向到HTTPS的主机名 | ||
host: 0.0.0.0 # 启动的地址,主机ip 或者域名,默认0.0.0.0 | ||
ishttps: false # 是否为HTTPS | ||
mode: dev # 开发模式 | ||
name: ferry-test # 服务名称 | ||
port: "8002" # 启动端口 | ||
readtimeout: 1 # 请求读取超时时间,从连接被接受(accept)到request body完全被读取(如果你不读取body,那么时间截止到读完header为止) | ||
writertimeout: 2 # 从request header的读取结束开始,到response write结束为止(也就是ServeHTTP 方法的声明周期) | ||
database: | ||
dbtype: mysql # 数据库类型 | ||
host: 127.0.0.1 # 数据库地址 | ||
name: ferry # 数据库名称 | ||
password: 123456 # 数据库密码 | ||
port: 3306 # 数据库端口 | ||
username: ferry # 数据库用户名 | ||
email: | ||
alias: ferry # 邮箱别名 | ||
host: smtp.163.com # 邮件服务器 | ||
pass: your password # 邮箱密码 | ||
port: 465 # 邮件服务器端口 | ||
user: [email protected] # 邮箱账号 | ||
gorm: | ||
logmode: 0 # gorm详细日志输出,0表示不输出,1表示输出 | ||
maxidleconn: 0 # 最大空闲连接 | ||
maxopenconn: 20000 # 最大连接数据 | ||
jwt: | ||
secret: ferry # JWT加密字符串 | ||
timeout: 3600 # 过期时间单位:秒 | ||
log: | ||
dir: logs # 日志路径 | ||
operdb: false | ||
ssl: | ||
key: keystring | ||
pem: temp/pem.pem | ||
|
||
## 本地开发 | ||
|
||
后端程序启动: | ||
|
||
# 1\. 拉取代码,以下命令二选一即可: | ||
git clone https://github.com/lanyulei/ferry.git | ||
git clone https://gitee.com/yllan/ferry.git | ||
|
||
# 2\. 进入工作路径 | ||
cd ferry | ||
|
||
# 3\. 修改配置 | ||
vim config/settings.dev.yml | ||
1). 修改为自己的数据库信息 | ||
2). 修改为自己的邮件服务器地址 | ||
其他的根据情况来修改调整 | ||
|
||
# 4\. 安装依赖 | ||
go get | ||
|
||
# 5\. 连接数据库,并创建数据库 | ||
create database ferry charset 'utf8mb4'; | ||
|
||
# 6\. 初始化数据结构 | ||
go run main.go init -c=config/settings.dev.yml | ||
|
||
# 7\. 测试启动程序,没有报错及没有问题 | ||
go run main.go server -c=config/settings.dev.yml | ||
|
||
# 8\. 热加载方式启动 | ||
air | ||
|
||
前端程序启动: | ||
|
||
# 1\. 拉取代码,以下命令二选一即可: | ||
git clone https://github.com/lanyulei/ferry_web.git | ||
git clone https://gitee.com/yllan/ferry_web.git | ||
|
||
# 2\. 进入工作路径 | ||
cd ferry_web | ||
|
||
# 3\. 安装依赖 | ||
npm config set registry https://registry.npm.taobao.org | ||
npm install | ||
# 若npm install安装失败,可尝试使用一下命令安装 | ||
npm install --unsafe-perm | ||
|
||
# 推荐使用cnpm | ||
npm install -g cnpm --registry=https://registry.npm.taobao.org | ||
cnpm install | ||
|
||
# 4\. 启动程序 | ||
npm run dev | ||
|
||
# 5\. 访问http://localhost:9527,是否可正常访问 | ||
|
||
## 部署线上 | ||
|
||
后端部署: | ||
|
||
# 1\. 拉取代码,以下命令二选一即可: | ||
git clone https://github.com/lanyulei/ferry.git | ||
git clone https://gitee.com/yllan/ferry.git | ||
|
||
# 2\. 进入工作路径 | ||
cd ferry | ||
|
||
# 3\. 交叉编译(centos) | ||
env GOOS=linux GOARCH=amd64 go build | ||
更多交叉编译内容,请访问 https://www.fdevops.com/2020/03/08/go-locale-configuration | ||
|
||
# 4\. config目录上传到项目根路径下,并确认配置信息是否正确 | ||
vim config/settings.yml | ||
1). 修改为自己的数据库信息 | ||
2). 修改为自己的邮件服务器地址 | ||
其他的根据情况来修改调整 | ||
|
||
# 4\. 创建日志路径及静态文件经历 | ||
mkdir -p log static/uploadfile static/scripts static/template | ||
|
||
# 5\. 将本地项目下static/template目录下的所有文件上传的到,服务器对应的项目目录下static/template | ||
|
||
# 6\. 连接数据库,并创建数据库 | ||
create database ferry charset 'utf8mb4'; | ||
|
||
# 7\. 初始化数据 | ||
./ferry init -c=config/settings.yml | ||
|
||
# 8\. 启动程序,推荐通过"进程管理工具"进行启动维护 | ||
nohup ./ferry server -c=config/settings.yml > /dev/null 2>&1 & | ||
|
||
前端部署: | ||
|
||
# 1\. 拉取代码,以下命令二选一即可: | ||
git clone https://github.com/lanyulei/ferry_web.git | ||
git clone https://gitee.com/yllan/ferry_web.git | ||
|
||
# 2\. 进入工作路径 | ||
cd ferry_web | ||
|
||
# 3\. 安装依赖 | ||
npm config set registry https://registry.npm.taobao.org | ||
npm install | ||
# 若npm install安装失败,可尝试使用一下命令安装 | ||
npm install --unsafe-perm | ||
|
||
# 推荐使用cnpm | ||
npm install -g cnpm --registry=https://registry.npm.taobao.org | ||
cnpm install | ||
|
||
# 4\. 修改 .env.production 文件 | ||
# base api | ||
VUE_APP_BASE_API = 'http://fdevops.com:8001' # 修改为您自己的域名 | ||
|
||
# 5\. 编译 | ||
npm run build:prod | ||
|
||
# 6\. 将dist目录上传至项目路径下即可。 | ||
mv dist web | ||
|
||
# 7\. nginx配置,根据业务自行调整即可 | ||
server { | ||
listen 8001; # 监听端口 | ||
server_name localhost; # 域名可以有多个,用空格隔开 | ||
|
||
#charset koi8-r; | ||
|
||
#access_log logs/host.access.log main; | ||
location / { | ||
root /data/ferry/web; | ||
index index.html index.htm; #目录内的默认打开文件,如果没有匹配到index.html,则搜索index.htm,依次类推 | ||
} | ||
|
||
#ssl配置省略 | ||
location /api { | ||
# rewrite ^.+api/?(.*)$ /$1 break; | ||
proxy_pass http://127.0.0.1:8002; #node api server 即需要代理的IP地址 | ||
proxy_redirect off; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
} | ||
|
||
# 登陆 | ||
location /login { | ||
proxy_pass http://127.0.0.1:8002; #node api server 即需要代理的IP地址 | ||
} | ||
|
||
# 刷新token | ||
location /refresh_token { | ||
proxy_pass http://127.0.0.1:8002; #node api server 即需要代理的IP地址 | ||
} | ||
|
||
# 接口地址 | ||
location /swagger { | ||
proxy_pass http://127.0.0.1:8002; #node api server 即需要代理的IP地址 | ||
} | ||
|
||
# 后端静态文件路径 | ||
location /static/uploadfile { | ||
proxy_pass http://127.0.0.1:8002; #node api server 即需要代理的IP地址 | ||
} | ||
|
||
#error_page 404 /404.html; #对错误页面404.html 做了定向配置 | ||
|
||
# redirect server error pages to the static page /50x.html | ||
#将服务器错误页面重定向到静态页面/50x.html | ||
# | ||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root html; | ||
} | ||
} |
Oops, something went wrong.