Merge branch 'gva_gormv2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gva_workflow
Conflicts: server/api/v1/sys_work_flow.go server/service/sys_workflow.go
This commit is contained in:
@@ -13,4 +13,11 @@ type GetById struct {
|
||||
|
||||
type IdsReq struct {
|
||||
Ids []int `json:"ids" form:"ids"`
|
||||
}
|
||||
}
|
||||
|
||||
// Get role by id structure
|
||||
type GetAuthorityId struct {
|
||||
AuthorityId string
|
||||
}
|
||||
|
||||
type Empty struct {}
|
||||
@@ -1,16 +1,16 @@
|
||||
package request
|
||||
|
||||
type DBReq struct {
|
||||
Database string `json:"database";gorm:"column:database"`
|
||||
Database string `json:"database" gorm:"column:database"`
|
||||
}
|
||||
|
||||
type TableReq struct {
|
||||
TableName string `json:"tableName"`
|
||||
}
|
||||
|
||||
type ColumeReq struct {
|
||||
ColumeName string `json:"columeName";gorm:"column:colume_name"`
|
||||
DataType string `json:"dataType";gorm:"column:data_type"`
|
||||
DataTypeLong string `json:"dataTypeLong";gorm:"column:data_type_long"`
|
||||
ColumeComment string `json:"columeComment";gorm:"column:colume_comment"`
|
||||
type ColumnReq struct {
|
||||
ColumnName string `json:"columnName" gorm:"column:column_name"`
|
||||
DataType string `json:"dataType" gorm:"column:data_type"`
|
||||
DataTypeLong string `json:"dataTypeLong" gorm:"column:data_type_long"`
|
||||
ColumnComment string `json:"columnComment" gorm:"column:column_comment"`
|
||||
}
|
||||
|
||||
@@ -7,8 +7,3 @@ type AddMenuAuthorityInfo struct {
|
||||
Menus []model.SysBaseMenu
|
||||
AuthorityId string
|
||||
}
|
||||
|
||||
// Get role by id structure
|
||||
type AuthorityIdInfo struct {
|
||||
AuthorityId string
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package request
|
||||
import uuid "github.com/satori/go.uuid"
|
||||
|
||||
// User register structure
|
||||
type RegisterStruct struct {
|
||||
type Register struct {
|
||||
Username string `json:"userName"`
|
||||
Password string `json:"passWord"`
|
||||
NickName string `json:"nickName" gorm:"default:'QMPlusUser'"`
|
||||
@@ -12,7 +12,7 @@ type RegisterStruct struct {
|
||||
}
|
||||
|
||||
// User login structure
|
||||
type RegisterAndLoginStruct struct {
|
||||
type Login struct {
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
Captcha string `json:"captcha"`
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package response
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type Response struct {
|
||||
Code int `json:"code"`
|
||||
Data interface{} `json:"data"`
|
||||
Msg string `json:"msg"`
|
||||
}
|
||||
|
||||
const (
|
||||
ERROR = 7
|
||||
SUCCESS = 0
|
||||
)
|
||||
|
||||
func Result(code int, data interface{}, msg string, c *gin.Context) {
|
||||
// 开始时间
|
||||
c.JSON(http.StatusOK, Response{
|
||||
code,
|
||||
data,
|
||||
msg,
|
||||
})
|
||||
}
|
||||
|
||||
func Ok(c *gin.Context) {
|
||||
Result(SUCCESS, map[string]interface{}{}, "操作成功", c)
|
||||
}
|
||||
|
||||
func OkWithMessage(message string, c *gin.Context) {
|
||||
Result(SUCCESS, map[string]interface{}{}, message, c)
|
||||
}
|
||||
|
||||
func OkWithData(data interface{}, c *gin.Context) {
|
||||
Result(SUCCESS, data, "操作成功", c)
|
||||
}
|
||||
|
||||
func OkWithDetailed(data interface{}, message string, c *gin.Context) {
|
||||
Result(SUCCESS, data, message, c)
|
||||
}
|
||||
|
||||
func Fail(c *gin.Context) {
|
||||
Result(ERROR, map[string]interface{}{}, "操作失败", c)
|
||||
}
|
||||
|
||||
func FailWithMessage(message string, c *gin.Context) {
|
||||
Result(ERROR, map[string]interface{}{}, message, c)
|
||||
}
|
||||
|
||||
func FailWithDetailed(data interface{}, message string, c *gin.Context) {
|
||||
Result(ERROR, data, message, c)
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package model
|
||||
|
||||
import "errors"
|
||||
|
||||
// 初始版本自动化代码工具
|
||||
type AutoCodeStruct struct {
|
||||
StructName string `json:"structName"`
|
||||
@@ -8,6 +10,7 @@ type AutoCodeStruct struct {
|
||||
Abbreviation string `json:"abbreviation"`
|
||||
Description string `json:"description"`
|
||||
AutoCreateApiToSql bool `json:"autoCreateApiToSql"`
|
||||
AutoMoveFile bool `json:"autoMoveFile"`
|
||||
Fields []Field `json:"fields"`
|
||||
}
|
||||
|
||||
@@ -23,3 +26,5 @@ type Field struct {
|
||||
FieldSearchType string `json:"fieldSearchType"`
|
||||
DictType string `json:"dictType"`
|
||||
}
|
||||
|
||||
var AutoMoveErr error = errors.New("创建代码成功并移动文件成功")
|
||||
|
||||
Reference in New Issue
Block a user