未验证 提交 e1958efb 编写于 作者: G Grant 提交者: GitHub

Merge pull request #1 from piexlmax/master

update
......@@ -2,10 +2,10 @@ package api
import (
"fmt"
"gin-vue-admin/controller/servers"
"gin-vue-admin/model/dbModel"
"gin-vue-admin/model/modelInterface"
"github.com/gin-gonic/gin"
"main/controller/servers"
"main/model/dbModel"
"main/model/modelInterface"
"strings"
)
......@@ -18,7 +18,7 @@ import (
// @Success 200 {string} string "{"success":true,"data":{},"msg":"上传成功"}"
// @Router /fileUploadAndDownload/upload [post]
func UploadFile(c *gin.Context) {
noSave := c.DefaultQuery("noSave","0")
noSave := c.DefaultQuery("noSave", "0")
_, header, err := c.Request.FormFile("file")
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("上传文件失败,%v", err), gin.H{})
......@@ -35,7 +35,7 @@ func UploadFile(c *gin.Context) {
s := strings.Split(file.Name, ".")
file.Tag = s[len(s)-1]
file.Key = key
if(noSave=="0"){
if noSave == "0" {
err = file.Upload()
}
if err != nil {
......
......@@ -2,10 +2,10 @@ package api
import (
"fmt"
"gin-vue-admin/controller/servers"
"gin-vue-admin/model/modelInterface"
"gin-vue-admin/model/sysModel"
"github.com/gin-gonic/gin"
"main/controller/servers"
"main/model/modelInterface"
"main/model/sysModel"
)
type CreateApiParams struct {
......
......@@ -2,13 +2,13 @@ package api
import (
"fmt"
"gin-vue-admin/controller/servers"
"gin-vue-admin/model/modelInterface"
"gin-vue-admin/model/sysModel"
"github.com/gin-gonic/gin"
"main/controller/servers"
"main/model/modelInterface"
"main/model/sysModel"
)
type CreateAuthorityPatams struct {
type CreateAuthorityParams struct {
AuthorityId string `json:"authorityId"`
AuthorityName string `json:"authorityName"`
}
......@@ -18,7 +18,7 @@ type CreateAuthorityPatams struct {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body api.CreateAuthorityPatams true "创建角色"
// @Param data body api.CreateAuthorityParams true "创建角色"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /authority/createAuthority [post]
func CreateAuthority(c *gin.Context) {
......
......@@ -2,9 +2,9 @@ package api
import (
"fmt"
"gin-vue-admin/controller/servers"
"gin-vue-admin/model/sysModel"
"github.com/gin-gonic/gin"
"main/controller/servers"
"main/model/sysModel"
)
type CasbinInReceive struct {
......@@ -17,7 +17,7 @@ type CasbinInReceive struct {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body api.CreateAuthorityPatams true "更改角色api权限"
// @Param data body api.CreateAuthorityParams true "更改角色api权限"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /casbin/casbinPUpdata [post]
func CasbinPUpdata(c *gin.Context) {
......@@ -36,7 +36,7 @@ func CasbinPUpdata(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body api.CreateAuthorityPatams true "获取权限列表"
// @Param data body api.CreateAuthorityParams true "获取权限列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /casbin/getPolicyPathByAuthorityId [post]
func GetPolicyPathByAuthorityId(c *gin.Context) {
......
......@@ -2,11 +2,11 @@ package api
import (
"fmt"
"gin-vue-admin/controller/servers"
"gin-vue-admin/middleware"
"gin-vue-admin/model/modelInterface"
"gin-vue-admin/model/sysModel"
"github.com/gin-gonic/gin"
"main/controller/servers"
"main/middleware"
"main/model/modelInterface"
"main/model/sysModel"
)
// @Tags authorityAndMenu
......
......@@ -2,13 +2,13 @@ package api
import (
"fmt"
"gin-vue-admin/controller/servers"
"gin-vue-admin/middleware"
"gin-vue-admin/model/modelInterface"
"gin-vue-admin/model/sysModel"
"github.com/dgrijalva/jwt-go"
"github.com/gin-gonic/gin"
uuid "github.com/satori/go.uuid"
"main/controller/servers"
"main/middleware"
"main/model/modelInterface"
"main/model/sysModel"
"mime/multipart"
"time"
)
......@@ -24,11 +24,11 @@ type RegistAndLoginStuct struct {
}
type RegestStuct struct {
Username string `json:"userName"`
Password string `json:"passWord"`
NickName string `json:"nickName" gorm:"default:'QMPlusUser'"`
HeaderImg string `json:"headerImg" gorm:"default:'http://www.henrongyi.top/avatar/lufu.jpg'"`
AuthorityId string `json:"authorityId" gorm:"default:888"`
Username string `json:"userName"`
Password string `json:"passWord"`
NickName string `json:"nickName" gorm:"default:'QMPlusUser'"`
HeaderImg string `json:"headerImg" gorm:"default:'http://www.henrongyi.top/avatar/lufu.jpg'"`
AuthorityId string `json:"authorityId" gorm:"default:888"`
}
// @Tags Base
......@@ -40,7 +40,7 @@ type RegestStuct struct {
func Regist(c *gin.Context) {
var R RegestStuct
_ = c.BindJSON(&R)
user := &sysModel.SysUser{Username:R.Username,NickName:R.NickName,Password:R.Password,HeaderImg:R.HeaderImg,AuthorityId:R.AuthorityId}
user := &sysModel.SysUser{Username: R.Username, NickName: R.NickName, Password: R.Password, HeaderImg: R.HeaderImg, AuthorityId: R.AuthorityId}
err, user := user.Regist()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("%v", err), gin.H{
......
......@@ -2,9 +2,9 @@ package api
import (
"fmt"
"gin-vue-admin/controller/servers"
"gin-vue-admin/model/sysModel"
"github.com/gin-gonic/gin"
"main/controller/servers"
"main/model/sysModel"
)
// @Tags workflow
......
package servers
import (
"gin-vue-admin/init/qmsql"
"gin-vue-admin/model/modelInterface"
"github.com/jinzhu/gorm"
"main/init/qmsql"
"main/model/modelInterface"
)
//获取分页功能 接收实现了分页接口的结构体 返回搜索完成的结果 许需要自行scan 或者find
......
package servers
import (
"gin-vue-admin/init/qmlog"
"github.com/gin-gonic/gin"
"main/init/qmlog"
"net/http"
"time"
)
......
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag at
// 2019-12-13 14:31:12.9298434 +0800 CST m=+0.056881601
// 2019-12-20 11:36:51.4275267 +0800 CST m=+0.082812601
package docs
......@@ -273,7 +273,7 @@ var doc = `{
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/api.CreateAuthorityPatams"
"$ref": "#/definitions/api.CreateAuthorityParams"
}
}
],
......@@ -413,7 +413,7 @@ var doc = `{
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/api.RegistAndLoginStuct"
"$ref": "#/definitions/sysModel.SysUser"
}
}
],
......@@ -452,7 +452,7 @@ var doc = `{
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/api.CreateAuthorityPatams"
"$ref": "#/definitions/api.CreateAuthorityParams"
}
}
],
......@@ -491,7 +491,7 @@ var doc = `{
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/api.CreateAuthorityPatams"
"$ref": "#/definitions/api.CreateAuthorityParams"
}
}
],
......@@ -1159,7 +1159,7 @@ var doc = `{
}
}
},
"api.CreateAuthorityPatams": {
"api.CreateAuthorityParams": {
"type": "object",
"properties": {
"authorityId": {
......@@ -1258,6 +1258,17 @@ var doc = `{
}
}
},
"sysModel.SysAuthority": {
"type": "object",
"properties": {
"authorityId": {
"type": "string"
},
"authorityName": {
"type": "string"
}
}
},
"sysModel.SysBaseMenu": {
"type": "object",
"properties": {
......@@ -1296,6 +1307,30 @@ var doc = `{
}
}
},
"sysModel.SysUser": {
"type": "object",
"properties": {
"authority": {
"type": "object",
"$ref": "#/definitions/sysModel.SysAuthority"
},
"authorityId": {
"type": "string"
},
"headerImg": {
"type": "string"
},
"nickName": {
"type": "string"
},
"userName": {
"type": "string"
},
"uuid": {
"type": "string"
}
}
},
"sysModel.SysWorkflow": {
"type": "object",
"properties": {
......
......@@ -256,7 +256,7 @@
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/api.CreateAuthorityPatams"
"$ref": "#/definitions/api.CreateAuthorityParams"
}
}
],
......@@ -396,7 +396,7 @@
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/api.RegistAndLoginStuct"
"$ref": "#/definitions/sysModel.SysUser"
}
}
],
......@@ -435,7 +435,7 @@
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/api.CreateAuthorityPatams"
"$ref": "#/definitions/api.CreateAuthorityParams"
}
}
],
......@@ -474,7 +474,7 @@
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/api.CreateAuthorityPatams"
"$ref": "#/definitions/api.CreateAuthorityParams"
}
}
],
......@@ -1142,7 +1142,7 @@
}
}
},
"api.CreateAuthorityPatams": {
"api.CreateAuthorityParams": {
"type": "object",
"properties": {
"authorityId": {
......@@ -1241,6 +1241,17 @@
}
}
},
"sysModel.SysAuthority": {
"type": "object",
"properties": {
"authorityId": {
"type": "string"
},
"authorityName": {
"type": "string"
}
}
},
"sysModel.SysBaseMenu": {
"type": "object",
"properties": {
......@@ -1279,6 +1290,30 @@
}
}
},
"sysModel.SysUser": {
"type": "object",
"properties": {
"authority": {
"type": "object",
"$ref": "#/definitions/sysModel.SysAuthority"
},
"authorityId": {
"type": "string"
},
"headerImg": {
"type": "string"
},
"nickName": {
"type": "string"
},
"userName": {
"type": "string"
},
"uuid": {
"type": "string"
}
}
},
"sysModel.SysWorkflow": {
"type": "object",
"properties": {
......
......@@ -30,7 +30,7 @@ definitions:
path:
type: string
type: object
api.CreateAuthorityPatams:
api.CreateAuthorityParams:
properties:
authorityId:
type: string
......@@ -93,6 +93,13 @@ definitions:
path:
type: string
type: object
sysModel.SysAuthority:
properties:
authorityId:
type: string
authorityName:
type: string
type: object
sysModel.SysBaseMenu:
properties:
children:
......@@ -118,6 +125,22 @@ definitions:
title:
type: string
type: object
sysModel.SysUser:
properties:
authority:
$ref: '#/definitions/sysModel.SysAuthority'
type: object
authorityId:
type: string
headerImg:
type: string
nickName:
type: string
userName:
type: string
uuid:
type: string
type: object
sysModel.SysWorkflow:
properties:
workflowDescription:
......@@ -309,7 +332,7 @@ paths:
name: data
required: true
schema:
$ref: '#/definitions/api.CreateAuthorityPatams'
$ref: '#/definitions/api.CreateAuthorityParams'
type: object
produces:
- application/json
......@@ -399,7 +422,7 @@ paths:
name: data
required: true
schema:
$ref: '#/definitions/api.RegistAndLoginStuct'
$ref: '#/definitions/sysModel.SysUser'
type: object
produces:
- application/json
......@@ -421,7 +444,7 @@ paths:
name: data
required: true
schema:
$ref: '#/definitions/api.CreateAuthorityPatams'
$ref: '#/definitions/api.CreateAuthorityParams'
type: object
produces:
- application/json
......@@ -445,7 +468,7 @@ paths:
name: data
required: true
schema:
$ref: '#/definitions/api.CreateAuthorityPatams'
$ref: '#/definitions/api.CreateAuthorityParams'
type: object
produces:
- application/json
......
module main
module gin-vue-admin
go 1.12
......
package initRouter
import (
_ "gin-vue-admin/docs"
"gin-vue-admin/middleware"
"gin-vue-admin/router"
"github.com/gin-gonic/gin"
"github.com/swaggo/gin-swagger"
"github.com/swaggo/gin-swagger/swaggerFiles"
_ "main/docs"
"main/middleware"
"main/router"
)
//初始化总路由
......
......@@ -3,17 +3,18 @@ package qmlog
// 日志初始化包 调用qmlog.QMLog.Info 记录日志 24小时切割 日志保存7天 可自行设置
import (
"fmt"
"gin-vue-admin/tools"
rotatelogs "github.com/lestrrat/go-file-rotatelogs"
"github.com/rifflock/lfshook"
"github.com/sirupsen/logrus"
"main/tools"
"os"
"time"
)
var QMLog = logrus.New()
//禁止logrus的输出
func InitLog() *logrus.Logger{
func InitLog() *logrus.Logger {
src, err := os.OpenFile(os.DevNull, os.O_APPEND|os.O_WRONLY, os.ModeAppend)
if err != nil {
fmt.Println("err", err)
......@@ -23,7 +24,7 @@ func InitLog() *logrus.Logger{
if ok, _ := tools.PathExists("./log"); !ok {
// Directory not exist
fmt.Println("Create log.")
os.Mkdir("log", os.ModePerm)
_ = os.Mkdir("log", os.ModePerm)
}
apiLogPath := "./log/api.log"
logWriter, err := rotatelogs.New(
......
package qmsql
import (
"gin-vue-admin/config"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/mysql"
"log"
"main/config"
)
var DEFAULTDB *gorm.DB
......
package registTable
import (
"gin-vue-admin/model/dbModel"
"gin-vue-admin/model/sysModel"
"github.com/jinzhu/gorm"
"main/model/dbModel"
"main/model/sysModel"
)
//注册数据库表专用
......
......@@ -2,16 +2,15 @@ package main
import (
"fmt"
"main/config"
"main/init/initRouter"
"main/init/qmlog"
"main/init/qmsql"
"main/init/registTable"
"gin-vue-admin/config"
"gin-vue-admin/init/initRouter"
"gin-vue-admin/init/qmlog"
"gin-vue-admin/init/qmsql"
"gin-vue-admin/init/registTable"
"net/http"
"time"
)
// @title Swagger Example API
// @version 0.0.1
// @description This is a sample Server pets
......@@ -21,12 +20,12 @@ import (
// @BasePath /
func main() {
qmlog.InitLog() // 初始化日志
db:=qmsql.InitMysql(config.Dbconfig.Admin) // 链接初始化数据库
registTable.RegistTable(db) //注册数据库表
defer qmsql.DEFAULTDB.Close() // 程序结束前关闭数据库链接
Router := initRouter.InitRouter() //注册路由
qmlog.QMLog.Info("服务器开启") // 日志测试代码
qmlog.InitLog() // 初始化日志
db := qmsql.InitMysql(config.Dbconfig.Admin) // 链接初始化数据库
registTable.RegistTable(db) //注册数据库表
defer qmsql.DEFAULTDB.Close() // 程序结束前关闭数据库链接
Router := initRouter.InitRouter() //注册路由
qmlog.QMLog.Info("服务器开启") // 日志测试代码
//Router.RunTLS(":443","ssl.pem", "ssl.key") // https支持 需要添加中间件
s := &http.Server{
Addr: ":8888",
......
......@@ -2,9 +2,9 @@ package middleware
import (
"fmt"
"gin-vue-admin/controller/servers"
"gin-vue-admin/model/sysModel"
"github.com/gin-gonic/gin"
"main/controller/servers"
"main/model/sysModel"
)
//拦截器
......@@ -18,7 +18,7 @@ func CasbinHandler() gin.HandlerFunc {
act := c.Request.Method
//获取用户的角色
sub := waitUse.AuthorityId
e:=sysModel.Casbin()
e := sysModel.Casbin()
//判断策略中是否存在
if e.Enforce(sub, obj, act) {
c.Next()
......
......@@ -2,10 +2,10 @@ package middleware
import (
"errors"
"gin-vue-admin/controller/servers"
"github.com/dgrijalva/jwt-go"
"github.com/gin-gonic/gin"
uuid "github.com/satori/go.uuid"
"main/controller/servers"
"time"
)
......
package middleware
import (
"gin-vue-admin/init/qmlog"
"github.com/gin-gonic/gin"
"main/init/qmlog"
"time"
)
......
package dbModel
import (
"gin-vue-admin/controller/servers"
"gin-vue-admin/init/qmsql"
"gin-vue-admin/model/modelInterface"
"github.com/jinzhu/gorm"
"main/controller/servers"
"main/init/qmsql"
"main/model/modelInterface"
)
type ExaFileUploadAndDownload struct {
......
package sysModel
import (
"gin-vue-admin/controller/servers"
"gin-vue-admin/init/qmsql"
"gin-vue-admin/model/modelInterface"
"github.com/jinzhu/gorm"
"github.com/pkg/errors"
"main/controller/servers"
"main/init/qmsql"
"main/model/modelInterface"
)
type SysApi struct {
......@@ -27,20 +27,20 @@ func (a *SysApi) CreateApi() (err error) {
func (a *SysApi) DeleteApi() (err error) {
err = qmsql.DEFAULTDB.Delete(a).Error
new(CasbinModel).clearCasbin(1,a.Path)
new(CasbinModel).clearCasbin(1, a.Path)
return err
}
func (a *SysApi) UpdataApi() (err error) {
var oldA SysApi
err = qmsql.DEFAULTDB.Where("id = ?", a.ID).First(&oldA).Error
if(err!=nil){
if err != nil {
return err
}else{
err = new(CasbinModel).CasbinApiUpdata(oldA.Path,a.Path)
if(err!=nil){
} else {
err = new(CasbinModel).CasbinApiUpdata(oldA.Path, a.Path)
if err != nil {
return err
}else{
} else {
err = qmsql.DEFAULTDB.Save(a).Error
}
}
......
package sysModel
import (
"gin-vue-admin/controller/servers"
"gin-vue-admin/init/qmsql"
"gin-vue-admin/model/modelInterface"
"github.com/jinzhu/gorm"
"github.com/pkg/errors"
"main/controller/servers"
"main/init/qmsql"
"main/model/modelInterface"
)
type SysAuthority struct {
......
......@@ -2,11 +2,11 @@ package sysModel
import (
"fmt"
"gin-vue-admin/controller/servers"
"gin-vue-admin/init/qmsql"
"gin-vue-admin/model/modelInterface"
"github.com/jinzhu/gorm"
"github.com/pkg/errors"
"main/controller/servers"
"main/init/qmsql"
"main/model/modelInterface"
)
type SysBaseMenu struct {
......
......@@ -2,27 +2,25 @@ package sysModel
import (
"errors"
"gin-vue-admin/init/qmsql"
"github.com/casbin/casbin"
gormadapter "github.com/casbin/gorm-adapter"
"main/init/qmsql"
"strings"
)
type CasbinModel struct {
ID uint `json:"id" gorm:"column:_id"`
Ptype string `json:"ptype" gorm:"column:ptype"`
AuthorityId string `json:"rolename" gorm:"column:v0"`
Path string `json:"path" gorm:"column:v1"`
Method string `json:"method" gorm:"column:v2"`
ID uint `json:"id" gorm:"column:_id"`
Ptype string `json:"ptype" gorm:"column:ptype"`
AuthorityId string `json:"rolename" gorm:"column:v0"`
Path string `json:"path" gorm:"column:v1"`
Method string `json:"method" gorm:"column:v2"`
}
// 更新权限
func (c *CasbinModel) CasbinPUpdata(AuthorityId string,Paths []string)error{
c.clearCasbin(0,AuthorityId)
for _,v:=range Paths{
cm:= CasbinModel{
func (c *CasbinModel) CasbinPUpdata(AuthorityId string, Paths []string) error {
c.clearCasbin(0, AuthorityId)
for _, v := range Paths {
cm := CasbinModel{
ID: 0,
Ptype: "p",
AuthorityId: AuthorityId,
......@@ -30,7 +28,7 @@ func (c *CasbinModel) CasbinPUpdata(AuthorityId string,Paths []string)error{
Method: "POST",
}
addflag := c.AddCasbin(cm)
if(addflag == false){
if addflag == false {
return errors.New("存在相同api,添加失败,请联系管理员")
}
}
......@@ -38,39 +36,39 @@ func (c *CasbinModel) CasbinPUpdata(AuthorityId string,Paths []string)error{
}
// API更新随动
func (c *CasbinModel) CasbinApiUpdata(oldPath string,newPath string)error{
func (c *CasbinModel) CasbinApiUpdata(oldPath string, newPath string) error {
var cs []CasbinModel
err := qmsql.DEFAULTDB.Table("casbin_rule").Where("v1 = ?",oldPath).Find(&cs).Update("v1", newPath).Error
err := qmsql.DEFAULTDB.Table("casbin_rule").Where("v1 = ?", oldPath).Find(&cs).Update("v1", newPath).Error
return err
}
//添加权限
func (c *CasbinModel) AddCasbin(cm CasbinModel) bool {
e := Casbin()
return e.AddPolicy( cm.AuthorityId, cm.Path, cm.Method)
return e.AddPolicy(cm.AuthorityId, cm.Path, cm.Method)
}
//获取权限列表
func (c *CasbinModel) GetPolicyPathByAuthorityId(AuthorityId string)[]string {
func (c *CasbinModel) GetPolicyPathByAuthorityId(AuthorityId string) []string {
e := Casbin()
var pathList []string
list := e.GetFilteredPolicy(0, AuthorityId)
for _,v:=range list{
for _, v := range list {
pathList = append(pathList, v[1])
}
return pathList
}
//清除匹配的权限
func (c *CasbinModel) clearCasbin(v int,p string) bool {
func (c *CasbinModel) clearCasbin(v int, p string) bool {
e := Casbin()
return e.RemoveFilteredPolicy(v,p)
return e.RemoveFilteredPolicy(v, p)
}
// 自定义规则函数
func ParamsMatch(key1 string, key2 string) bool {
k1arr := strings.Split(key1,"?")
k1arr := strings.Split(key1, "?")
return k1arr[0] == key2
}
......
......@@ -2,7 +2,7 @@ package sysModel
import (
"fmt"
"main/init/qmsql"
"gin-vue-admin/init/qmsql"
)
// menu需要构建的点有点多 这里关联关系表直接把所有数据拿过来 用代码实现关联 后期实现主外键模式
......
package sysModel
import (
"gin-vue-admin/controller/servers"
"gin-vue-admin/init/qmsql"
"gin-vue-admin/model/modelInterface"
"gin-vue-admin/tools"
"github.com/jinzhu/gorm"
"github.com/pkg/errors"
uuid "github.com/satori/go.uuid"
"main/controller/servers"
"main/init/qmsql"
"main/model/modelInterface"
"main/tools"
)
type SysUser struct {
......@@ -62,8 +62,8 @@ func (u *SysUser) Login() (err error, userInter *SysUser) {
var user SysUser
u.Password = tools.MD5V(u.Password)
err = qmsql.DEFAULTDB.Where("username = ? AND password = ?", u.Username, u.Password).First(&user).Error
if(err!=nil){
return err,&user
if err != nil {
return err, &user
}
err = qmsql.DEFAULTDB.Where("authority_id = ?", user.AuthorityId).First(&user.Authority).Error
return err, &user
......
package sysModel
import (
"gin-vue-admin/init/qmsql"
"github.com/jinzhu/gorm"
"main/init/qmsql"
)
//工作流属性表
......@@ -11,13 +11,13 @@ type SysWorkflow struct {
WorkflowNickName string `json:"workflowNickName"` // 工作流名称
WorkflowName string `json:"workflowName"` // 工作流英文id
WorkflowDescription string `json:"workflowDescription"` // 工作流描述
WorkflowStepInfo []SysWorkflowStepInfo `json:"workflowStep"` // 工作流步骤
WorkflowStepInfo []SysWorkflowStepInfo `json:"workflowStep"` // 工作流步骤
}
// 工作流状态表
type SysWorkflowStepInfo struct {
gorm.Model
SysWorkflowID uint `json:"workflowID"` // 所属工作流ID
SysWorkflowID uint `json:"workflowID"` // 所属工作流ID
IsStrat bool `json:"isStrat"` // 是否是开始流节点
StepName string `json:"stepName"` // 工作流名称
StepNo float64 `json:"stepNo"` // 步骤id (第几步)
......
package router
import (
"gin-vue-admin/controller/api"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
"main/controller/api"
"main/middleware"
)
func InitFileUploadAndDownloadRouter(Router *gin.RouterGroup) {
......
package router
import (
"gin-vue-admin/controller/api"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
"main/controller/api"
"main/middleware"
)
func InitApiRouter(Router *gin.RouterGroup) {
......
package router
import (
"gin-vue-admin/controller/api"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
"main/controller/api"
"main/middleware"
)
func InitAuthorityRouter(Router *gin.RouterGroup) {
......
package router
import (
"gin-vue-admin/controller/api"
"github.com/gin-gonic/gin"
"main/controller/api"
)
func InitBaseRouter(Router *gin.RouterGroup) (R gin.IRoutes) {
......
package router
import (
"gin-vue-admin/controller/api"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
"main/controller/api"
"main/middleware"
)
func InitCasbinRouter(Router *gin.RouterGroup) {
......
package router
import (
"gin-vue-admin/controller/api"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
"main/controller/api"
"main/middleware"
)
func InitMenuRouter(Router *gin.RouterGroup) (R gin.IRoutes) {
......
package router
import (
"gin-vue-admin/controller/api"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
"main/controller/api"
"main/middleware"
)
func InitUserRouter(Router *gin.RouterGroup) {
......
package router
import (
"gin-vue-admin/controller/api"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
"main/controller/api"
"main/middleware"
)
func InitWorkflowRouter(Router *gin.RouterGroup) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册