发布代码生成、更新20+表单组件,优化数据字典,gf版本更新到2.3.1

This commit is contained in:
孟帅
2023-01-18 16:23:39 +08:00
parent 50207ded90
commit 87c27a17a3
386 changed files with 27926 additions and 44297 deletions

View File

@@ -1,31 +0,0 @@
// Package consts
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2022 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package consts
// 全局状态码
const (
CodeNil = -1 // No error code specified.
CodeOK = 0 // It is OK.
CodeInternalError = 50 // An error occurred internally.
CodeValidationFailed = 51 // Data validation failed.
CodeDbOperationError = 52 // Database operation error.
CodeInvalidParameter = 53 // The given parameter for current operation is invalid.
CodeMissingParameter = 54 // Parameter for current operation is missing.
CodeInvalidOperation = 55 // The function cannot be used like this.
CodeInvalidConfiguration = 56 // The configuration is invalid for current operation.
CodeMissingConfiguration = 57 // The configuration is missing for current operation.
CodeNotImplemented = 58 // The operation is not implemented yet.
CodeNotSupported = 59 // The operation is not supported yet.
CodeOperationFailed = 60 // I tried, but I cannot give you what you want.
CodeNotAuthorized = 61 // Not Authorized.
CodeSecurityReason = 62 // Security Reason.
CodeServerBusy = 63 // Server is busy, please try again later.
CodeUnknown = 64 // Unknown error.
CodeNotFound = 65 // Resource does not exist.
CodeInvalidRequest = 66 // Invalid request.
CodeBusinessValidationFailed = 300 // Business validation failed.
)

View File

@@ -6,10 +6,74 @@
//
package consts
import "github.com/gogf/gf/v2/util/gconv"
// 配置数据类型
const (
ConfigTypeString = "string"
ConfigTypeInt = "int"
ConfigTypeBool = "bool"
ConfigTypeArray = "array"
ConfigTypeDate = "date"
ConfigTypeString = "string"
ConfigTypeInt = "int"
ConfigTypeInt8 = "int8"
ConfigTypeInt16 = "int16"
ConfigTypeInt32 = "int32"
ConfigTypeInt64 = "int64"
ConfigTypeUint = "uint"
ConfigTypeUint8 = "uint8"
ConfigTypeUint16 = "uint16"
ConfigTypeUint32 = "uint32"
ConfigTypeUint64 = "uint64"
ConfigTypeFloat32 = "float32"
ConfigTypeFloat64 = "float64"
ConfigTypeBool = "bool"
ConfigTypeDate = "date"
ConfigTypeDateTime = "datetime"
)
var ConfigTypes = []string{ConfigTypeString,
ConfigTypeInt, ConfigTypeInt8, ConfigTypeInt16, ConfigTypeInt32, ConfigTypeInt64,
ConfigTypeUint, ConfigTypeUint8, ConfigTypeUint16, ConfigTypeUint32, ConfigTypeUint64,
ConfigTypeFloat32, ConfigTypeFloat64,
ConfigTypeBool,
ConfigTypeDate, ConfigTypeDateTime,
}
// ConvType 类型转换
func ConvType(val interface{}, t string) interface{} {
switch t {
case ConfigTypeString:
val = gconv.String(val)
case ConfigTypeInt:
val = gconv.Int(val)
case ConfigTypeInt8:
val = gconv.Int8(val)
case ConfigTypeInt16:
val = gconv.Int16(val)
case ConfigTypeInt32:
val = gconv.Int32(val)
case ConfigTypeInt64:
val = gconv.Int64(val)
case ConfigTypeUint:
val = gconv.Uint(val)
case ConfigTypeUint8:
val = gconv.Uint8(val)
case ConfigTypeUint16:
val = gconv.Uint16(val)
case ConfigTypeUint32:
val = gconv.Uint32(val)
case ConfigTypeUint64:
val = gconv.Uint64(val)
case ConfigTypeFloat32:
val = gconv.Float32(val)
case ConfigTypeFloat64:
val = gconv.Float64(val)
case ConfigTypeBool:
val = gconv.Bool(val)
case ConfigTypeDate:
val = gconv.Time(val, "Y-m-d")
case ConfigTypeDateTime:
val = gconv.Time(val, "Y-m-d H:i:s")
default:
val = gconv.String(val)
}
return val
}

View File

@@ -9,5 +9,6 @@ package consts
// 碎片
const (
DemoTips = "演示系统已隐藏"
DemoTips = "演示系统已隐藏"
NilJsonToString = "{}" // 空json初始化值
)

View File

@@ -0,0 +1,74 @@
// Package consts
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2022 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package consts
// 生成代码类型
const (
GenCodesTypeCurd = 10 // 增删改查列表
GenCodesTypeTree = 11 // 树列表
GenCodesTypeQueue = 20 // 队列消费者
GenCodesTypeCron = 30 // 定时任务
)
var GenCodesTypeNameMap = map[int]string{
GenCodesTypeCurd: "增删改查列表",
GenCodesTypeTree: "关系树列表(未实现)",
GenCodesTypeQueue: "队列消费者(未实现)",
GenCodesTypeCron: "定时任务(未实现)",
}
// 生成代码状态
const (
GenCodesStatusOk = 1 // 生成成功
GenCodesStatusWait = 2 // 未生成
GenCodesStatusFail = 3 // 生成失败
)
var GenCodesStatusNameMap = map[int]string{
GenCodesStatusOk: "生成成功",
GenCodesStatusWait: "未生成",
GenCodesStatusFail: "生成失败",
}
// 生成代码关联表方式
const (
GenCodesJoinLeft = 1 // 左关联
GenCodesJoinRight = 2 // 右关联
GenCodesJoinInner = 3 // 内关联
)
var GenCodesJoinNameMap = map[int]string{
GenCodesJoinLeft: "左关联",
GenCodesJoinRight: "右关联",
GenCodesJoinInner: "内关联",
}
var GenCodesJoinLinkMap = map[int]string{
GenCodesJoinLeft: "LeftJoin",
GenCodesJoinRight: "RightJoin",
GenCodesJoinInner: "InnerJoin",
}
// 生成代码的生成方式
const (
GenCodesBuildMethCreate = 1 // 创建
GenCodesBuildMethCover = 2 // 覆盖
GenCodesBuildMethSkip = 3 // 跳过
GenCodesBuildIgnore = 4 // 不生成
)
var GenCodesBuildMethNameMap = map[int]string{
GenCodesBuildMethCreate: "创建文件",
GenCodesBuildMethCover: "强制覆盖",
GenCodesBuildMethSkip: "已存在跳过",
GenCodesBuildIgnore: "不生成",
}
const (
GenCodesIndexPK = "PRI" // 主键索引
GenCodesIndexUNI = "UNI" // 唯一索引
)

View File

@@ -0,0 +1,32 @@
// Package consts
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2022 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
//
package consts
// 数据范围
const (
RoleDataAll = 1 // 全部权限
// 通过部门划分
RoleDataNowDept = 2 // 当前部门
RoleDataDeptAndSub = 3 // 当前部门及以下部门
RoleDataDeptCustom = 4 // 自定义部门
// 通过上下级关系划分
RoleDataSelf = 5 // 仅自己
RoleDataSelfAndSub = 6 // 自己和直属下级
RoleDataSelfAndAllSub = 7 // 自己和全部下级
)
var RoleDataNameMap = map[int]string{
RoleDataAll: "全部权限",
RoleDataNowDept: "当前部门",
RoleDataDeptAndSub: "当前及以下部门",
RoleDataDeptCustom: "自定义部门",
RoleDataSelf: "仅自己",
RoleDataSelfAndSub: "自己和直属下级",
RoleDataSelfAndAllSub: "自己和全部下级",
}

View File

@@ -7,6 +7,7 @@
package consts
const (
UploadDriveLocal = "local" // 本地驱动
UploadDriveOss = "oss" // 阿里云oss
UploadDriveLocal = "local" // 本地驱动
UploadDriveOss = "oss" // 阿里云oss
UploadDriveUCloud = "ucloud" // ucloud对象存储
)

View File

@@ -6,7 +6,7 @@
//
package consts
// VersionApp 应用版本
// VersionApp HotGo版本
const (
VersionApp = "2.0.3"
VersionApp = "2.1.0"
)