Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
HeliosJ
gin-vue-admin
提交
6e54770e
G
gin-vue-admin
项目概览
HeliosJ
/
gin-vue-admin
与 Fork 源项目一致
Fork自
FLIPPED-AURORA / gin-vue-admin
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gin-vue-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
6e54770e
编写于
11月 20, 2019
作者:
Mr.奇淼(
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
工作流重新定义 以及create路由开发
上级
d8fcf336
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
319 addition
and
28 deletion
+319
-28
QMPlusServer/controller/api/workFlow.go
QMPlusServer/controller/api/workFlow.go
+25
-0
QMPlusServer/docs/docs.go
QMPlusServer/docs/docs.go
+85
-1
QMPlusServer/docs/swagger.json
QMPlusServer/docs/swagger.json
+84
-0
QMPlusServer/docs/swagger.yaml
QMPlusServer/docs/swagger.yaml
+58
-0
QMPlusServer/init/initRouter/initRouter.go
QMPlusServer/init/initRouter/initRouter.go
+1
-0
QMPlusServer/init/registTable/registTable.go
QMPlusServer/init/registTable/registTable.go
+10
-1
QMPlusServer/model/dbModel/application.go
QMPlusServer/model/dbModel/application.go
+18
-0
QMPlusServer/model/dbModel/worfFlow.go
QMPlusServer/model/dbModel/worfFlow.go
+10
-26
QMPlusServer/model/dbModel/workFlowProcess.go
QMPlusServer/model/dbModel/workFlowProcess.go
+14
-0
QMPlusServer/router/workflow.go
QMPlusServer/router/workflow.go
+14
-0
未找到文件。
QMPlusServer/controller/api/workFlow.go
0 → 100644
浏览文件 @
6e54770e
package
api
import
(
"fmt"
"github.com/gin-gonic/gin"
"main/controller/servers"
"main/model/dbModel"
)
// @Tags workflow
// @Summary 注册工作流
// @Produce application/json
// @Param data body dbModel.Workflow true "注册工作流接口"
// @Success 200 {string} json "{"success":true,"data":{},"msg":"注册成功"}"
// @Router /workflow/createWorkFlow [post]
func
CreateWorkFlow
(
c
*
gin
.
Context
)
{
var
wk
dbModel
.
Workflow
_
=
c
.
ShouldBind
(
&
wk
)
err
:=
wk
.
Create
()
if
err
!=
nil
{
servers
.
ReportFormat
(
c
,
false
,
fmt
.
Sprintf
(
"获取失败:%v"
,
err
),
gin
.
H
{})
}
else
{
servers
.
ReportFormat
(
c
,
true
,
"获取成功"
,
gin
.
H
{})
}
}
QMPlusServer/docs/docs.go
浏览文件 @
6e54770e
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag at
// 2019-1
0-26 23:18:53.1133875 +0800 CST m=+0.2035665
01
// 2019-1
1-20 10:46:22.2795763 +0800 CST m=+0.0538962
01
package
docs
...
...
@@ -1042,6 +1042,37 @@ var doc = `{
}
}
}
},
"/workflow/createWorkFlow": {
"post": {
"produces": [
"application/json"
],
"tags": [
"workflow"
],
"summary": "注册工作流",
"parameters": [
{
"description": "注册工作流接口",
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/dbModel.Workflow"
}
}
],
"responses": {
"200": {
"description": "{\"success\":true,\"data\":{},\"msg\":\"注册成功\"}",
"schema": {
"type": "string"
}
}
}
}
}
},
"definitions": {
...
...
@@ -1220,6 +1251,59 @@ var doc = `{
}
}
},
"dbModel.Workflow": {
"type": "object",
"properties": {
"workflowDescription": {
"description": "工作流描述",
"type": "string"
},
"workflowName": {
"description": "工作流英文id",
"type": "string"
},
"workflowNickName": {
"description": "工作流名称",
"type": "string"
},
"workflowStep": {
"description": "工作流步骤",
"type": "array",
"items": {
"$ref": "#/definitions/dbModel.WorkflowStepInfo"
}
}
}
},
"dbModel.WorkflowStepInfo": {
"type": "object",
"properties": {
"isEnd": {
"description": "是否是完结流节点",
"type": "boolean"
},
"isStrat": {
"description": "是否是开始流节点",
"type": "boolean"
},
"stepAuthorityID": {
"description": "操作者级别id",
"type": "string"
},
"stepName": {
"description": "工作流名称",
"type": "string"
},
"stepNo": {
"description": "步骤id (第几步)",
"type": "number"
},
"workflowID": {
"description": "所属工作流ID",
"type": "integer"
}
}
},
"modelInterface.PageInfo": {
"type": "object",
"properties": {
...
...
QMPlusServer/docs/swagger.json
浏览文件 @
6e54770e
...
...
@@ -1025,6 +1025,37 @@
}
}
}
},
"/workflow/createWorkFlow"
:
{
"post"
:
{
"produces"
:
[
"application/json"
],
"tags"
:
[
"workflow"
],
"summary"
:
"注册工作流"
,
"parameters"
:
[
{
"description"
:
"注册工作流接口"
,
"name"
:
"data"
,
"in"
:
"body"
,
"required"
:
true
,
"schema"
:
{
"type"
:
"object"
,
"$ref"
:
"#/definitions/dbModel.Workflow"
}
}
],
"responses"
:
{
"200"
:
{
"description"
:
"{
\"
success
\"
:true,
\"
data
\"
:{},
\"
msg
\"
:
\"
注册成功
\"
}"
,
"schema"
:
{
"type"
:
"string"
}
}
}
}
}
},
"definitions"
:
{
...
...
@@ -1203,6 +1234,59 @@
}
}
},
"dbModel.Workflow"
:
{
"type"
:
"object"
,
"properties"
:
{
"workflowDescription"
:
{
"description"
:
"工作流描述"
,
"type"
:
"string"
},
"workflowName"
:
{
"description"
:
"工作流英文id"
,
"type"
:
"string"
},
"workflowNickName"
:
{
"description"
:
"工作流名称"
,
"type"
:
"string"
},
"workflowStep"
:
{
"description"
:
"工作流步骤"
,
"type"
:
"array"
,
"items"
:
{
"$ref"
:
"#/definitions/dbModel.WorkflowStepInfo"
}
}
}
},
"dbModel.WorkflowStepInfo"
:
{
"type"
:
"object"
,
"properties"
:
{
"isEnd"
:
{
"description"
:
"是否是完结流节点"
,
"type"
:
"boolean"
},
"isStrat"
:
{
"description"
:
"是否是开始流节点"
,
"type"
:
"boolean"
},
"stepAuthorityID"
:
{
"description"
:
"操作者级别id"
,
"type"
:
"string"
},
"stepName"
:
{
"description"
:
"工作流名称"
,
"type"
:
"string"
},
"stepNo"
:
{
"description"
:
"步骤id (第几步)"
,
"type"
:
"number"
},
"workflowID"
:
{
"description"
:
"所属工作流ID"
,
"type"
:
"integer"
}
}
},
"modelInterface.PageInfo"
:
{
"type"
:
"object"
,
"properties"
:
{
...
...
QMPlusServer/docs/swagger.yaml
浏览文件 @
6e54770e
...
...
@@ -112,6 +112,44 @@ definitions:
title
:
type
:
string
type
:
object
dbModel.Workflow
:
properties
:
workflowDescription
:
description
:
工作流描述
type
:
string
workflowName
:
description
:
工作流英文id
type
:
string
workflowNickName
:
description
:
工作流名称
type
:
string
workflowStep
:
description
:
工作流步骤
items
:
$ref
:
'
#/definitions/dbModel.WorkflowStepInfo'
type
:
array
type
:
object
dbModel.WorkflowStepInfo
:
properties
:
isEnd
:
description
:
是否是完结流节点
type
:
boolean
isStrat
:
description
:
是否是开始流节点
type
:
boolean
stepAuthorityID
:
description
:
操作者级别id
type
:
string
stepName
:
description
:
工作流名称
type
:
string
stepNo
:
description
:
步骤id (第几步)
type
:
number
workflowID
:
description
:
所属工作流ID
type
:
integer
type
:
object
modelInterface.PageInfo
:
properties
:
page
:
...
...
@@ -753,6 +791,26 @@ paths:
summary
:
用户上传头像
tags
:
-
User
/workflow/createWorkFlow
:
post
:
parameters
:
-
description
:
注册工作流接口
in
:
body
name
:
data
required
:
true
schema
:
$ref
:
'
#/definitions/dbModel.Workflow'
type
:
object
produces
:
-
application/json
responses
:
"
200"
:
description
:
'
{"success":true,"data":{},"msg":"注册成功"}'
schema
:
type
:
string
summary
:
注册工作流
tags
:
-
workflow
securityDefinitions
:
ApiKeyAuth
:
in
:
header
...
...
QMPlusServer/init/initRouter/initRouter.go
浏览文件 @
6e54770e
...
...
@@ -21,5 +21,6 @@ func InitRouter() *gin.Engine {
router
.
InitAuthorityRouter
(
Router
)
// 注册角色路由
router
.
InitApiRouter
(
Router
)
// 注册功能api路由
router
.
InitFileUploadAndDownloadRouter
(
Router
)
// 文件上传下载功能路由
router
.
InitWorkflowRouter
(
Router
)
// 工作流相关路由
return
Router
}
QMPlusServer/init/registTable/registTable.go
浏览文件 @
6e54770e
...
...
@@ -7,5 +7,14 @@ import (
//注册数据库表专用
func
RegistTable
(
db
*
gorm
.
DB
)
{
db
.
AutoMigrate
(
dbModel
.
User
{},
dbModel
.
Authority
{},
dbModel
.
Menu
{},
dbModel
.
Api
{},
dbModel
.
ApiAuthority
{},
dbModel
.
BaseMenu
{},
dbModel
.
FileUploadAndDownload
{})
db
.
AutoMigrate
(
dbModel
.
User
{},
dbModel
.
Authority
{},
dbModel
.
Menu
{},
dbModel
.
Api
{},
dbModel
.
ApiAuthority
{},
dbModel
.
BaseMenu
{},
dbModel
.
FileUploadAndDownload
{},
dbModel
.
Workflow
{},
dbModel
.
WorkflowStepInfo
{},
)
}
QMPlusServer/model/dbModel/application.go
0 → 100644
浏览文件 @
6e54770e
package
dbModel
import
(
"github.com/jinzhu/gorm"
"time"
)
//申请model 工作流实例
type
Application
struct
{
gorm
.
Model
WorkFlowID
string
// 所属工作流ID
WorkFlowStepInfoID
string
// 当前节点ID
ApplicationName
string
// 申请人姓名
ApplicationCause
string
// 请假原因
ApplicationStartData
time
.
Time
// 请假开始日期
ApplicationEndData
time
.
Time
// 请假开始日期
}
QMPlusServer/model/dbModel/worfFlow.go
浏览文件 @
6e54770e
...
...
@@ -2,47 +2,31 @@ package dbModel
import
(
"github.com/jinzhu/gorm"
"
time
"
"
main/init/qmsql
"
)
type
Application
struct
{
gorm
.
Model
WorkFlowID
string
// 所属工作流ID
WorkFlowStepInfoID
string
// 当前节点ID
ApplicationName
string
// 申请人姓名
ApplicationCause
string
// 请假原因
ApplicationStartData
time
.
Time
// 请假开始日期
ApplicationEndData
time
.
Time
// 请假开始日期
}
// 流转表
type
ApplicationWorkFlowProcess
struct
{
gorm
.
Model
ApplicationID
uint
// 当前工作流所属申请的ID
CurrentNode
string
// 当前进度节点
HistoricalNode
string
//上一个进度节点
CurrentUser
string
// 当前进度操作人
HistoricalUser
string
// 上一个进度的操作人
State
bool
// 状态 是否是正在进行的状态
}
//工作流属性表
type
Workflow
struct
{
gorm
.
Model
WorkflowNickName
string
// 工作流名称
WorkflowName
string
// 工作流英文id
WorkflowDescription
string
//工作流描述
WorkflowStep
[]
WorkflowStepInfo
//工作流步骤
WorkflowDescription
string
//
工作流描述
WorkflowStep
[]
WorkflowStepInfo
//
工作流步骤
}
// 工作流状态表
type
WorkflowStepInfo
struct
{
gorm
.
Model
WorkflowID
uint
// 所属工作流ID
WorkflowID
uint
`json:"-"`
// 所属工作流ID
IsStrat
bool
// 是否是开始流节点
StepName
string
// 工作流名称
StepNo
float64
// 步骤id (第几步)
StepAuthorityID
string
// 操作者级别id
IsEnd
bool
// 是否是完结流节点
}
//创建工作流
func
(
wk
*
Workflow
)
Create
()
error
{
err
:=
qmsql
.
DEFAULTDB
.
Create
(
&
wk
)
.
Error
return
err
}
QMPlusServer/model/dbModel/workFlowProcess.go
0 → 100644
浏览文件 @
6e54770e
package
dbModel
import
"github.com/jinzhu/gorm"
// 工作流流转表
type
WorkFlowProcess
struct
{
gorm
.
Model
ApplicationID
uint
// 当前工作流所属申请的ID
CurrentNode
string
// 当前进度节点
HistoricalNode
string
//上一个进度节点
CurrentUser
string
// 当前进度操作人
HistoricalUser
string
// 上一个进度的操作人
State
bool
// 状态 是否是正在进行的状态
}
QMPlusServer/router/workflow.go
0 → 100644
浏览文件 @
6e54770e
package
router
import
(
"github.com/gin-gonic/gin"
"main/controller/api"
)
func
InitWorkflowRouter
(
Router
*
gin
.
Engine
)
{
WorkflowRouter
:=
Router
.
Group
(
"workflow"
)
//.Use(middleware.JWTAuth())
{
WorkflowRouter
.
POST
(
"createWorkFlow"
,
api
.
CreateWorkFlow
)
// 创建工作流
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录