This commit is contained in:
孟帅
2023-10-08 16:04:11 +08:00
parent b05f1fac36
commit f49bb56b12
50 changed files with 1280 additions and 533 deletions

View File

@@ -7,5 +7,5 @@ package consts
// VersionApp HotGo版本
const (
VersionApp = "2.8.9"
VersionApp = "2.9.3"
)

View File

@@ -3,7 +3,7 @@
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
// @AutoGenerate Version 2.7.6
// @AutoGenerate Version 2.8.9
package sys
import (

View File

@@ -17,6 +17,7 @@ import (
"github.com/gogf/gf/v2/encoding/gbase64"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gbuild"
"github.com/gogf/gf/v2/os/gcmd"
"github.com/gogf/gf/v2/os/genv"
"github.com/gogf/gf/v2/os/gfile"
@@ -46,7 +47,7 @@ const (
cBuildBrief = `cross-building go project for lots of platforms`
cBuildEg = `
gf build main.go
gf build main.go --pack public,template
gf build main.go --ps public,template
gf build main.go --cgo
gf build main.go -m none
gf build main.go -n my-app -a all -s all
@@ -311,9 +312,9 @@ func (c cBuild) getBuildInVarStr(ctx context.Context, in cBuildInput) string {
if buildInVarMap == nil {
buildInVarMap = make(g.Map)
}
buildInVarMap[`builtGit`] = c.getGitCommit(ctx)
buildInVarMap[`builtTime`] = gtime.Now().String()
buildInVarMap[`builtVersion`] = in.Version
buildInVarMap[gbuild.BuiltGit] = c.getGitCommit(ctx)
buildInVarMap[gbuild.BuiltTime] = gtime.Now().String()
buildInVarMap[gbuild.BuiltVersion] = in.Version
b, err := json.Marshal(buildInVarMap)
if err != nil {
mlog.Fatal(err)

View File

@@ -1,7 +1,12 @@
// Copyright GoFrame gf Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package cmd
import (
"fmt"
"testing"
"github.com/gogf/gf/v2/test/gtest"
@@ -10,11 +15,10 @@ import (
func Test_Fix_doFixV25Content(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
var (
content = gtest.DataContent(`fix25_content.go.txt`)
content = gtest.DataContent(`fix`, `fix25_content.go`)
f = cFix{}
)
newContent, err := f.doFixV25Content(content)
_, err := f.doFixV25Content(content)
t.AssertNil(err)
fmt.Println(newContent)
})
}

View File

@@ -0,0 +1,229 @@
// Copyright GoFrame gf Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package cmd
import (
"context"
"fmt"
"testing"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/os/gfile"
"github.com/gogf/gf/v2/test/gtest"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v2/util/guid"
"github.com/gogf/gf/v2/util/gutil"
"hotgo/internal/library/hggen/internal/cmd/gendao"
)
var ctx = context.Background()
func dropTableWithDb(db gdb.DB, table string) {
dropTableStmt := fmt.Sprintf("DROP TABLE IF EXISTS `%s`", table)
if _, err := db.Exec(ctx, dropTableStmt); err != nil {
gtest.Error(err)
}
}
func Test_Gen_Dao_Default(t *testing.T) {
link := "mysql:root:12345678@tcp(127.0.0.1:3306)/test?loc=Local&parseTime=true"
db, err := gdb.New(gdb.ConfigNode{
Link: link,
})
gtest.AssertNil(err)
gtest.C(t, func(t *gtest.T) {
var (
table = "table_user"
sqlContent = fmt.Sprintf(
gtest.DataContent(`gendao`, `user.tpl.sql`),
table,
)
)
dropTableWithDb(db, table)
array := gstr.SplitAndTrim(sqlContent, ";")
for _, v := range array {
if _, err = db.Exec(ctx, v); err != nil {
t.AssertNil(err)
}
}
defer dropTableWithDb(db, table)
var (
path = gfile.Temp(guid.S())
group = "test"
in = gendao.CGenDaoInput{
Path: path,
Link: link,
Tables: "",
TablesEx: "",
Group: group,
Prefix: "",
RemovePrefix: "",
JsonCase: "SnakeScreaming",
ImportPrefix: "",
DaoPath: "",
DoPath: "",
EntityPath: "",
TplDaoIndexPath: "",
TplDaoInternalPath: "",
TplDaoDoPath: "",
TplDaoEntityPath: "",
StdTime: false,
WithTime: false,
GJsonSupport: false,
OverwriteDao: false,
DescriptionTag: false,
NoJsonTag: false,
NoModelComment: false,
Clear: false,
TypeMapping: nil,
}
)
err = gutil.FillStructWithDefault(&in)
t.AssertNil(err)
err = gfile.Mkdir(path)
t.AssertNil(err)
// for go mod import path auto retrieve.
err = gfile.Copy(
gtest.DataPath("gendao", "go.mod.txt"),
gfile.Join(path, "go.mod"),
)
t.AssertNil(err)
_, err = gendao.CGenDao{}.Dao(ctx, in)
t.AssertNil(err)
defer gfile.Remove(path)
// files
files, err := gfile.ScanDir(path, "*.go", true)
t.AssertNil(err)
t.Assert(files, []string{
path + "/dao/internal/table_user.go",
path + "/dao/table_user.go",
path + "/model/do/table_user.go",
path + "/model/entity/table_user.go",
})
// content
testPath := gtest.DataPath("gendao", "generated_user")
expectFiles := []string{
testPath + "/dao/internal/table_user.go",
testPath + "/dao/table_user.go",
testPath + "/model/do/table_user.go",
testPath + "/model/entity/table_user.go",
}
for i, _ := range files {
t.Assert(gfile.GetContents(files[i]), gfile.GetContents(expectFiles[i]))
}
})
}
func Test_Gen_Dao_TypeMapping(t *testing.T) {
link := "mysql:root:12345678@tcp(127.0.0.1:3306)/test?loc=Local&parseTime=true"
db, err := gdb.New(gdb.ConfigNode{
Link: link,
})
gtest.AssertNil(err)
gtest.C(t, func(t *gtest.T) {
var (
table = "table_user"
sqlContent = fmt.Sprintf(
gtest.DataContent(`gendao`, `user.tpl.sql`),
table,
)
)
defer dropTableWithDb(db, table)
array := gstr.SplitAndTrim(sqlContent, ";")
for _, v := range array {
if _, err = db.Exec(ctx, v); err != nil {
t.AssertNil(err)
}
}
defer dropTableWithDb(db, table)
var (
path = gfile.Temp(guid.S())
group = "test"
in = gendao.CGenDaoInput{
Path: path,
Link: link,
Tables: "",
TablesEx: "",
Group: group,
Prefix: "",
RemovePrefix: "",
JsonCase: "",
ImportPrefix: "",
DaoPath: "",
DoPath: "",
EntityPath: "",
TplDaoIndexPath: "",
TplDaoInternalPath: "",
TplDaoDoPath: "",
TplDaoEntityPath: "",
StdTime: false,
WithTime: false,
GJsonSupport: false,
OverwriteDao: false,
DescriptionTag: false,
NoJsonTag: false,
NoModelComment: false,
Clear: false,
TypeMapping: map[gendao.DBFieldTypeName]gendao.CustomAttributeType{
"int": {
Type: "int64",
Import: "",
},
"decimal": {
Type: "decimal.Decimal",
Import: "github.com/shopspring/decimal",
},
},
}
)
err = gutil.FillStructWithDefault(&in)
t.AssertNil(err)
err = gfile.Mkdir(path)
t.AssertNil(err)
// for go mod import path auto retrieve.
err = gfile.Copy(
gtest.DataPath("gendao", "go.mod.txt"),
gfile.Join(path, "go.mod"),
)
t.AssertNil(err)
_, err = gendao.CGenDao{}.Dao(ctx, in)
t.AssertNil(err)
defer gfile.Remove(path)
// files
files, err := gfile.ScanDir(path, "*.go", true)
t.AssertNil(err)
t.Assert(files, []string{
path + "/dao/internal/table_user.go",
path + "/dao/table_user.go",
path + "/model/do/table_user.go",
path + "/model/entity/table_user.go",
})
// content
testPath := gtest.DataPath("gendao", "generated_user_type_mapping")
expectFiles := []string{
testPath + "/dao/internal/table_user.go",
testPath + "/dao/table_user.go",
testPath + "/model/do/table_user.go",
testPath + "/model/entity/table_user.go",
}
for i, _ := range files {
t.Assert(gfile.GetContents(files[i]), gfile.GetContents(expectFiles[i]))
}
})
}

View File

@@ -37,7 +37,7 @@ gf gen ctrl
)
const (
PatternApiDefinition = `type\s+(\w+)Req\s+struct\s+{`
PatternApiDefinition = `type\s+(\w+)Req\s+struct\s+{([\s\S]+?)}`
PatternCtrlDefinition = `func\s+\(.+?\)\s+\w+\(.+?\*(\w+)\.(\w+)Req\)\s+\(.+?\*(\w+)\.(\w+)Res,\s+\w+\s+error\)\s+{`
)

View File

@@ -43,11 +43,19 @@ func (c CGenCtrl) getApiItemsInSrc(apiModuleFolderPath string) (items []apiItem,
return nil, err
}
for _, match := range matches {
var (
methodName = match[1]
structBody = match[2]
)
// ignore struct name that match a request, but has no g.Meta in its body.
if !gstr.Contains(structBody, `g.Meta`) {
continue
}
item := apiItem{
Import: gstr.Trim(importPath, `"`),
Module: gfile.Basename(apiModuleFolderPath),
Version: gfile.Basename(apiVersionFolderPath),
MethodName: match[1],
MethodName: methodName,
}
items = append(items, item)
}

View File

@@ -32,9 +32,12 @@ func (c *controllerGenerator) Generate(dstModuleFolderPath string, apiModuleApiI
continue
}
// retrieve all api items of the same module.
subItems := c.getSubItemsByModuleAndVersion(apiModuleApiItems, item.Module, item.Version)
var (
subItems = c.getSubItemsByModuleAndVersion(apiModuleApiItems, item.Module, item.Version)
importPath = gstr.Replace(gfile.Dir(item.Import), "\\", "/", -1)
)
if err = c.doGenerateCtrlNewByModuleAndVersion(
dstModuleFolderPath, item.Module, item.Version, gfile.Dir(item.Import),
dstModuleFolderPath, item.Module, item.Version, importPath,
); err != nil {
return
}
@@ -69,8 +72,6 @@ func (c *controllerGenerator) doGenerateCtrlNewByModuleAndVersion(
newFuncNameDefinition = fmt.Sprintf(`func %s()`, newFuncName)
alreadyCreated bool
)
// replace "\" to "/", fix import error
importPath = gstr.Replace(importPath, "\\", "/", -1)
if !gfile.Exists(moduleFilePath) {
content := gstr.ReplaceByMap(consts.TemplateGenCtrlControllerEmpty, g.MapStrStr{
"{Module}": module,

View File

@@ -17,6 +17,7 @@ import (
"github.com/gogf/gf/v2/util/gconv"
"hotgo/internal/library/hggen/internal/consts"
"hotgo/internal/library/hggen/internal/utility/mlog"
"hotgo/internal/library/hggen/internal/utility/utils"
)
type apiInterfaceGenerator struct{}
@@ -42,6 +43,11 @@ func (c *apiInterfaceGenerator) doGenerate(apiModuleFolderPath string, module st
importPathMap = gmap.NewListMap()
importPaths []string
)
// if there's already exist file that with the same but not auto generated go file,
// it uses another file name.
if !utils.IsFileDoNotEdit(moduleFilePath) {
moduleFilePath = gfile.Join(apiModuleFolderPath, fmt.Sprintf(`%s.if.go`, module))
}
// all import paths.
importPathMap.Set("\t"+`"context"`, 1)
importPathMap.Set("\t"+``, 1)

View File

@@ -78,7 +78,7 @@ func (c *apiSdkGenerator) doGenerateSdkIClient(
pkgName = gfile.Basename(sdkFolderPath)
funcName = gstr.CaseCamel(module) + gstr.UcFirst(version)
interfaceName = fmt.Sprintf(`I%s`, funcName)
moduleImportPath = fmt.Sprintf(`"%s"`, gfile.Dir(versionImportPath))
moduleImportPath = gstr.Replace(fmt.Sprintf(`"%s"`, gfile.Dir(versionImportPath)), "\\", "/", -1)
iClientFilePath = gfile.Join(sdkFolderPath, fmt.Sprintf(`%s.iclient.go`, pkgName))
interfaceFuncDefinition = fmt.Sprintf(
`%s() %s.%s`,
@@ -116,7 +116,7 @@ func (c *apiSdkGenerator) doGenerateSdkIClient(
if !gstr.Contains(fileContent, interfaceFuncDefinition) {
isDirty = true
fileContent, err = gregex.ReplaceString(
`(type iClient interface {[\s\S]*?)}`,
`(type IClient interface {[\s\S]*?)}`,
fmt.Sprintf("$1\t%s\n}", interfaceFuncDefinition),
fileContent,
)
@@ -142,7 +142,7 @@ func (c *apiSdkGenerator) doGenerateSdkImplementer(
pkgName = gfile.Basename(sdkFolderPath)
moduleNameCamel = gstr.CaseCamel(module)
moduleNameSnake = gstr.CaseSnake(module)
moduleImportPath = gfile.Dir(versionImportPath)
moduleImportPath = gstr.Replace(gfile.Dir(versionImportPath), "\\", "/", -1)
versionPrefix = ""
implementerName = moduleNameCamel + gstr.UcFirst(version)
implementerFilePath = gfile.Join(sdkFolderPath, fmt.Sprintf(

View File

@@ -115,7 +115,7 @@ generated json tag case for model struct, cases are as follows:
var (
createdAt = gtime.Now()
defaultTypeMapping = map[string]TypeMapping{
defaultTypeMapping = map[DBFieldTypeName]CustomAttributeType{
"decimal": {
Type: "float64",
},
@@ -172,31 +172,32 @@ type (
CGenDao struct{}
CGenDaoInput struct {
g.Meta `name:"dao" config:"{CGenDaoConfig}" usage:"{CGenDaoUsage}" brief:"{CGenDaoBrief}" eg:"{CGenDaoEg}" ad:"{CGenDaoAd}"`
Path string `name:"path" short:"p" brief:"{CGenDaoBriefPath}" d:"internal"`
Link string `name:"link" short:"l" brief:"{CGenDaoBriefLink}"`
Tables string `name:"tables" short:"t" brief:"{CGenDaoBriefTables}"`
TablesEx string `name:"tablesEx" short:"x" brief:"{CGenDaoBriefTablesEx}"`
Group string `name:"group" short:"g" brief:"{CGenDaoBriefGroup}" d:"default"`
Prefix string `name:"prefix" short:"f" brief:"{CGenDaoBriefPrefix}"`
RemovePrefix string `name:"removePrefix" short:"r" brief:"{CGenDaoBriefRemovePrefix}"`
JsonCase string `name:"jsonCase" short:"j" brief:"{CGenDaoBriefJsonCase}" d:"CamelLower"`
ImportPrefix string `name:"importPrefix" short:"i" brief:"{CGenDaoBriefImportPrefix}"`
DaoPath string `name:"daoPath" short:"d" brief:"{CGenDaoBriefDaoPath}" d:"dao"`
DoPath string `name:"doPath" short:"o" brief:"{CGenDaoBriefDoPath}" d:"model/do"`
EntityPath string `name:"entityPath" short:"e" brief:"{CGenDaoBriefEntityPath}" d:"model/entity"`
TplDaoIndexPath string `name:"tplDaoIndexPath" short:"t1" brief:"{CGenDaoBriefTplDaoIndexPath}"`
TplDaoInternalPath string `name:"tplDaoInternalPath" short:"t2" brief:"{CGenDaoBriefTplDaoInternalPath}"`
TplDaoDoPath string `name:"tplDaoDoPath" short:"t3" brief:"{CGenDaoBriefTplDaoDoPathPath}"`
TplDaoEntityPath string `name:"tplDaoEntityPath" short:"t4" brief:"{CGenDaoBriefTplDaoEntityPath}"`
StdTime bool `name:"stdTime" short:"s" brief:"{CGenDaoBriefStdTime}" orphan:"true"`
WithTime bool `name:"withTime" short:"w" brief:"{CGenDaoBriefWithTime}" orphan:"true"`
GJsonSupport bool `name:"gJsonSupport" short:"n" brief:"{CGenDaoBriefGJsonSupport}" orphan:"true"`
OverwriteDao bool `name:"overwriteDao" short:"v" brief:"{CGenDaoBriefOverwriteDao}" orphan:"true"`
DescriptionTag bool `name:"descriptionTag" short:"c" brief:"{CGenDaoBriefDescriptionTag}" orphan:"true"`
NoJsonTag bool `name:"noJsonTag" short:"k" brief:"{CGenDaoBriefNoJsonTag}" orphan:"true"`
NoModelComment bool `name:"noModelComment" short:"m" brief:"{CGenDaoBriefNoModelComment}" orphan:"true"`
Clear bool `name:"clear" short:"a" brief:"{CGenDaoBriefClear}" orphan:"true"`
TypeMapping map[string]TypeMapping `name:"typeMapping" short:"y" brief:"{CGenDaoBriefTypeMapping}" orphan:"true"`
Path string `name:"path" short:"p" brief:"{CGenDaoBriefPath}" d:"internal"`
Link string `name:"link" short:"l" brief:"{CGenDaoBriefLink}"`
Tables string `name:"tables" short:"t" brief:"{CGenDaoBriefTables}"`
TablesEx string `name:"tablesEx" short:"x" brief:"{CGenDaoBriefTablesEx}"`
Group string `name:"group" short:"g" brief:"{CGenDaoBriefGroup}" d:"default"`
Prefix string `name:"prefix" short:"f" brief:"{CGenDaoBriefPrefix}"`
RemovePrefix string `name:"removePrefix" short:"r" brief:"{CGenDaoBriefRemovePrefix}"`
JsonCase string `name:"jsonCase" short:"j" brief:"{CGenDaoBriefJsonCase}" d:"CamelLower"`
ImportPrefix string `name:"importPrefix" short:"i" brief:"{CGenDaoBriefImportPrefix}"`
DaoPath string `name:"daoPath" short:"d" brief:"{CGenDaoBriefDaoPath}" d:"dao"`
DoPath string `name:"doPath" short:"o" brief:"{CGenDaoBriefDoPath}" d:"model/do"`
EntityPath string `name:"entityPath" short:"e" brief:"{CGenDaoBriefEntityPath}" d:"model/entity"`
TplDaoIndexPath string `name:"tplDaoIndexPath" short:"t1" brief:"{CGenDaoBriefTplDaoIndexPath}"`
TplDaoInternalPath string `name:"tplDaoInternalPath" short:"t2" brief:"{CGenDaoBriefTplDaoInternalPath}"`
TplDaoDoPath string `name:"tplDaoDoPath" short:"t3" brief:"{CGenDaoBriefTplDaoDoPathPath}"`
TplDaoEntityPath string `name:"tplDaoEntityPath" short:"t4" brief:"{CGenDaoBriefTplDaoEntityPath}"`
StdTime bool `name:"stdTime" short:"s" brief:"{CGenDaoBriefStdTime}" orphan:"true"`
WithTime bool `name:"withTime" short:"w" brief:"{CGenDaoBriefWithTime}" orphan:"true"`
GJsonSupport bool `name:"gJsonSupport" short:"n" brief:"{CGenDaoBriefGJsonSupport}" orphan:"true"`
OverwriteDao bool `name:"overwriteDao" short:"v" brief:"{CGenDaoBriefOverwriteDao}" orphan:"true"`
DescriptionTag bool `name:"descriptionTag" short:"c" brief:"{CGenDaoBriefDescriptionTag}" orphan:"true"`
NoJsonTag bool `name:"noJsonTag" short:"k" brief:"{CGenDaoBriefNoJsonTag}" orphan:"true"`
NoModelComment bool `name:"noModelComment" short:"m" brief:"{CGenDaoBriefNoModelComment}" orphan:"true"`
Clear bool `name:"clear" short:"a" brief:"{CGenDaoBriefClear}" orphan:"true"`
TypeMapping map[DBFieldTypeName]CustomAttributeType `name:"typeMapping" short:"y" brief:"{CGenDaoBriefTypeMapping}" orphan:"true"`
}
CGenDaoOutput struct{}
@@ -207,7 +208,8 @@ type (
NewTableNames []string
}
TypeMapping struct {
DBFieldTypeName = string
CustomAttributeType struct {
Type string `brief:"custom attribute type name"`
Import string `brief:"custom import for this type"`
}

View File

@@ -67,9 +67,10 @@ func generateStructFieldDefinition(
ctx context.Context, field *gdb.TableField, in generateStructDefinitionInput,
) (attrLines []string, appendImport string) {
var (
err error
typeName string
jsonTag = getJsonTagFromCase(field.Name, in.JsonCase)
err error
localTypeName gdb.LocalType
localTypeNameStr string
jsonTag = getJsonTagFromCase(field.Name, in.JsonCase)
)
if in.TypeMapping != nil && len(in.TypeMapping) > 0 {
@@ -84,38 +85,39 @@ func generateStructFieldDefinition(
}
if tryTypeName != "" {
if typeMapping, ok := in.TypeMapping[strings.ToLower(tryTypeName)]; ok {
typeName = typeMapping.Type
localTypeNameStr = typeMapping.Type
appendImport = typeMapping.Import
}
}
}
if typeName == "" {
typeName, err = in.DB.CheckLocalTypeForField(ctx, field.Type, nil)
if localTypeNameStr == "" {
localTypeName, err = in.DB.CheckLocalTypeForField(ctx, field.Type, nil)
if err != nil {
panic(err)
}
}
switch typeName {
case gdb.LocalTypeDate, gdb.LocalTypeDatetime:
if in.StdTime {
typeName = "time.Time"
} else {
typeName = "*gtime.Time"
}
localTypeNameStr = string(localTypeName)
switch localTypeName {
case gdb.LocalTypeDate, gdb.LocalTypeDatetime:
if in.StdTime {
localTypeNameStr = "time.Time"
} else {
localTypeNameStr = "*gtime.Time"
}
case gdb.LocalTypeInt64Bytes:
typeName = "int64"
case gdb.LocalTypeInt64Bytes:
localTypeNameStr = "int64"
case gdb.LocalTypeUint64Bytes:
typeName = "uint64"
case gdb.LocalTypeUint64Bytes:
localTypeNameStr = "uint64"
// Special type handle.
case gdb.LocalTypeJson, gdb.LocalTypeJsonb:
if in.GJsonSupport {
typeName = "*gjson.Json"
} else {
typeName = "string"
// Special type handle.
case gdb.LocalTypeJson, gdb.LocalTypeJsonb:
if in.GJsonSupport {
localTypeNameStr = "*gjson.Json"
} else {
localTypeNameStr = "string"
}
}
}
@@ -125,7 +127,7 @@ func generateStructFieldDefinition(
)
attrLines = []string{
" #" + gstr.CaseCamel(field.Name),
" #" + typeName,
" #" + localTypeNameStr,
}
attrLines = append(attrLines, " #"+fmt.Sprintf(tagKey+`json:"%s"`, jsonTag))
attrLines = append(attrLines, " #"+fmt.Sprintf(`description:"%s"`+tagKey, descriptionTag))

View File

@@ -12,6 +12,8 @@ import (
"fmt"
"strings"
"github.com/olekukonko/tablewriter"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gctx"
@@ -21,7 +23,6 @@ import (
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v2/util/gconv"
"github.com/gogf/gf/v2/util/gtag"
"github.com/olekukonko/tablewriter"
"hotgo/internal/library/hggen/internal/consts"
"hotgo/internal/library/hggen/internal/utility/mlog"
)
@@ -294,17 +295,17 @@ func generateEntityMessageDefinition(entityName string, fieldMap map[string]*gdb
// generateMessageFieldForPbEntity generates and returns the message definition for specified field.
func generateMessageFieldForPbEntity(index int, field *gdb.TableField, in CGenPbEntityInternalInput) []string {
var (
typeName string
comment string
jsonTagStr string
err error
ctx = gctx.GetInitCtx()
localTypeName gdb.LocalType
comment string
jsonTagStr string
err error
ctx = gctx.GetInitCtx()
)
typeName, err = in.DB.CheckLocalTypeForField(ctx, field.Type, nil)
localTypeName, err = in.DB.CheckLocalTypeForField(ctx, field.Type, nil)
if err != nil {
panic(err)
}
var typeMapping = map[string]string{
var typeMapping = map[gdb.LocalType]string{
gdb.LocalTypeString: "string",
gdb.LocalTypeDate: "google.protobuf.Timestamp",
gdb.LocalTypeDatetime: "google.protobuf.Timestamp",
@@ -324,9 +325,9 @@ func generateMessageFieldForPbEntity(index int, field *gdb.TableField, in CGenPb
gdb.LocalTypeJson: "string",
gdb.LocalTypeJsonb: "string",
}
typeName = typeMapping[typeName]
if typeName == "" {
typeName = "string"
localTypeNameStr := typeMapping[localTypeName]
if localTypeNameStr == "" {
localTypeNameStr = "string"
}
comment = gstr.ReplaceByArray(field.Comment, g.SliceStr{
@@ -350,7 +351,7 @@ func generateMessageFieldForPbEntity(index int, field *gdb.TableField, in CGenPb
}
}
return []string{
" #" + typeName,
" #" + localTypeNameStr,
" #" + formatCase(field.Name, in.NameCase),
" #= " + gconv.String(index) + jsonTagStr + ";",
" #" + fmt.Sprintf(`// %s`, comment),

View File

@@ -194,7 +194,7 @@ func (c CGenService) Service(ctx context.Context, in CGenServiceInput) (out *CGe
return nil, err
}
// remove all comments.
fileContent, err = gregex.ReplaceString(`/[/|\*](.*)`, "", fileContent)
fileContent, err = gregex.ReplaceString(`(//.*)|((?s)/\*.*?\*/)`, "", fileContent)
if err != nil {
return nil, err
}

View File

@@ -137,7 +137,7 @@ func (c CGenService) isToGenerateServiceGoFile(dstPackageName, filePath string,
return true
}
// remove all comments.
fileContent, err = gregex.ReplaceString(`/[/|\*](.*)`, "", fileContent)
fileContent, err = gregex.ReplaceString(`(//.*)|((?s)/\*.*?\*/)`, "", fileContent)
if err != nil {
panic(err)
return false

View File

@@ -27,4 +27,4 @@ func Test_Router_Hook_Multi(t *testing.T) {
r.Response.Write("2")
},
})
}
}

View File

@@ -0,0 +1,85 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TableUserDao is the data access object for table table_user.
type TableUserDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of current DAO.
columns TableUserColumns // columns contains all the column names of Table for convenient usage.
}
// TableUserColumns defines and stores column names for table table_user.
type TableUserColumns struct {
Id string // User ID
Passport string // User Passport
Password string // User Password
Nickname string // User Nickname
Score string // Total score amount.
CreateAt string // Created Time
UpdateAt string // Updated Time
}
// tableUserColumns holds the columns for table table_user.
var tableUserColumns = TableUserColumns{
Id: "id",
Passport: "passport",
Password: "password",
Nickname: "nickname",
Score: "score",
CreateAt: "create_at",
UpdateAt: "update_at",
}
// NewTableUserDao creates and returns a new DAO object for table data access.
func NewTableUserDao() *TableUserDao {
return &TableUserDao{
group: "test",
table: "table_user",
columns: tableUserColumns,
}
}
// DB retrieves and returns the underlying raw database management object of current DAO.
func (dao *TableUserDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of current dao.
func (dao *TableUserDao) Table() string {
return dao.table
}
// Columns returns all column names of current dao.
func (dao *TableUserDao) Columns() TableUserColumns {
return dao.columns
}
// Group returns the configuration group name of database of current dao.
func (dao *TableUserDao) Group() string {
return dao.group
}
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (dao *TableUserDao) Ctx(ctx context.Context) *gdb.Model {
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note that, you should not Commit or Rollback the transaction in function f
// as it is automatically handled by this function.
func (dao *TableUserDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@@ -0,0 +1,27 @@
// =================================================================================
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
// =================================================================================
package dao
import (
"for-gendao-test/pkg/dao/internal"
)
// internalTableUserDao is internal type for wrapping internal DAO implements.
type internalTableUserDao = *internal.TableUserDao
// tableUserDao is the data access object for table table_user.
// You can define custom methods on it to extend its functionality as you wish.
type tableUserDao struct {
internalTableUserDao
}
var (
// TableUser is globally public accessible object for table table_user operations.
TableUser = tableUserDao{
internal.NewTableUserDao(),
}
)
// Fill with you ideas below.

View File

@@ -0,0 +1,22 @@
// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package do
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
)
// TableUser is the golang structure of table table_user for DAO operations like Where/Data.
type TableUser struct {
g.Meta `orm:"table:table_user, do:true"`
Id interface{} // User ID
Passport interface{} // User Passport
Password interface{} // User Password
Nickname interface{} // User Nickname
Score interface{} // Total score amount.
CreateAt *gtime.Time // Created Time
UpdateAt *gtime.Time // Updated Time
}

View File

@@ -0,0 +1,20 @@
// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package entity
import (
"github.com/gogf/gf/v2/os/gtime"
)
// TableUser is the golang structure for table table_user.
type TableUser struct {
Id uint `json:"ID" ` // User ID
Passport string `json:"PASSPORT" ` // User Passport
Password string `json:"PASSWORD" ` // User Password
Nickname string `json:"NICKNAME" ` // User Nickname
Score float64 `json:"SCORE" ` // Total score amount.
CreateAt *gtime.Time `json:"CREATE_AT" ` // Created Time
UpdateAt *gtime.Time `json:"UPDATE_AT" ` // Updated Time
}

View File

@@ -0,0 +1,85 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TableUserDao is the data access object for table table_user.
type TableUserDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of current DAO.
columns TableUserColumns // columns contains all the column names of Table for convenient usage.
}
// TableUserColumns defines and stores column names for table table_user.
type TableUserColumns struct {
Id string // User ID
Passport string // User Passport
Password string // User Password
Nickname string // User Nickname
Score string // Total score amount.
CreateAt string // Created Time
UpdateAt string // Updated Time
}
// tableUserColumns holds the columns for table table_user.
var tableUserColumns = TableUserColumns{
Id: "id",
Passport: "passport",
Password: "password",
Nickname: "nickname",
Score: "score",
CreateAt: "create_at",
UpdateAt: "update_at",
}
// NewTableUserDao creates and returns a new DAO object for table data access.
func NewTableUserDao() *TableUserDao {
return &TableUserDao{
group: "test",
table: "table_user",
columns: tableUserColumns,
}
}
// DB retrieves and returns the underlying raw database management object of current DAO.
func (dao *TableUserDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of current dao.
func (dao *TableUserDao) Table() string {
return dao.table
}
// Columns returns all column names of current dao.
func (dao *TableUserDao) Columns() TableUserColumns {
return dao.columns
}
// Group returns the configuration group name of database of current dao.
func (dao *TableUserDao) Group() string {
return dao.group
}
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (dao *TableUserDao) Ctx(ctx context.Context) *gdb.Model {
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note that, you should not Commit or Rollback the transaction in function f
// as it is automatically handled by this function.
func (dao *TableUserDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@@ -0,0 +1,27 @@
// =================================================================================
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
// =================================================================================
package dao
import (
"for-gendao-test/pkg/dao/internal"
)
// internalTableUserDao is internal type for wrapping internal DAO implements.
type internalTableUserDao = *internal.TableUserDao
// tableUserDao is the data access object for table table_user.
// You can define custom methods on it to extend its functionality as you wish.
type tableUserDao struct {
internalTableUserDao
}
var (
// TableUser is globally public accessible object for table table_user operations.
TableUser = tableUserDao{
internal.NewTableUserDao(),
}
)
// Fill with you ideas below.

View File

@@ -0,0 +1,22 @@
// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package do
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
)
// TableUser is the golang structure of table table_user for DAO operations like Where/Data.
type TableUser struct {
g.Meta `orm:"table:table_user, do:true"`
Id interface{} // User ID
Passport interface{} // User Passport
Password interface{} // User Password
Nickname interface{} // User Nickname
Score interface{} // Total score amount.
CreateAt *gtime.Time // Created Time
UpdateAt *gtime.Time // Updated Time
}

View File

@@ -0,0 +1,21 @@
// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package entity
import (
"github.com/gogf/gf/v2/os/gtime"
"github.com/shopspring/decimal"
)
// TableUser is the golang structure for table table_user.
type TableUser struct {
Id int64 `json:"id" ` // User ID
Passport string `json:"passport" ` // User Passport
Password string `json:"password" ` // User Password
Nickname string `json:"nickname" ` // User Nickname
Score decimal.Decimal `json:"score" ` // Total score amount.
CreateAt *gtime.Time `json:"createAt" ` // Created Time
UpdateAt *gtime.Time `json:"updateAt" ` // Updated Time
}

View File

@@ -0,0 +1,32 @@
module for-gendao-test/pkg
go 1.18
require (
github.com/gogf/gf/v2 v2.5.3
github.com/shopspring/decimal v1.3.1
)
require (
github.com/BurntSushi/toml v1.2.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grokify/html-strip-tags-go v0.0.1 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
go.opentelemetry.io/otel v1.14.0 // indirect
go.opentelemetry.io/otel/sdk v1.14.0 // indirect
go.opentelemetry.io/otel/trace v1.14.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

View File

@@ -0,0 +1,10 @@
CREATE TABLE `%s` (
`id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'User ID',
`passport` varchar(45) NOT NULL COMMENT 'User Passport',
`password` varchar(45) NOT NULL COMMENT 'User Password',
`nickname` varchar(45) NOT NULL COMMENT 'User Nickname',
`score` decimal(10,2) unsigned DEFAULT NULL COMMENT 'Total score amount.',
`create_at` datetime DEFAULT NULL COMMENT 'Created Time',
`update_at` datetime DEFAULT NULL COMMENT 'Updated Time',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View File

@@ -7,6 +7,10 @@
package consts
const TemplateGenCtrlControllerEmpty = `
// =================================================================================
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
// =================================================================================
package {Module}
`

View File

@@ -25,7 +25,7 @@ type implementer struct {
config httpclient.Config
}
func New(config httpclient.Config) iClient {
func New(config httpclient.Config) IClient {
if !gstr.HasPrefix(config.URL, "http") {
config.URL = fmt.Sprintf("http://%s", config.URL)
}
@@ -49,7 +49,7 @@ package {PkgName}
import (
)
type iClient interface {
type IClient interface {
}
`
@@ -84,6 +84,7 @@ func (i *implementer) {ImplementerName}() {Module}.I{ImplementerName} {
client.Client = client.Prefix(prefix)
return &implementer{ImplementerName}{client}
}
`
const TemplateGenCtrlSdkImplementerFunc = `

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -62,7 +62,7 @@ func CustomAttributes(ctx context.Context, field *sysin.GenCodesColumnListModel,
}
// GenGotype 生成字段的go类型
func GenGotype(ctx context.Context, field *sysin.GenCodesColumnListModel, in gendao.CGenDaoInput) (goName, typeName, tsName, tsType string) {
func GenGotype(ctx context.Context, field *sysin.GenCodesColumnListModel, in gendao.CGenDaoInput) (goName, typeName, tsName string, tsType string) {
var err error
tsName = getJsonTagFromCase(field.Name, in.JsonCase)
goName = gstr.CaseCamel(field.Name)
@@ -71,7 +71,8 @@ func GenGotype(ctx context.Context, field *sysin.GenCodesColumnListModel, in gen
if err != nil {
panic(err)
}
switch typeName {
switch gdb.LocalType(typeName) {
case gdb.LocalTypeDate, gdb.LocalTypeDatetime:
if in.StdTime {
typeName = "time.Time"
@@ -120,7 +121,7 @@ func CheckLocalTypeForField(ctx context.Context, fieldType string, fieldValue in
"tinyblob",
"mediumblob",
"longblob":
return gdb.LocalTypeBytes, nil
return string(gdb.LocalTypeBytes), nil
case
"int",
@@ -131,22 +132,22 @@ func CheckLocalTypeForField(ctx context.Context, fieldType string, fieldValue in
"mediumint",
"serial":
if gstr.ContainsI(fieldType, "unsigned") {
return gdb.LocalTypeUint, nil
return string(gdb.LocalTypeUint), nil
}
return gdb.LocalTypeInt, nil
return string(gdb.LocalTypeInt), nil
case
"big_int",
"bigint",
"bigserial":
if gstr.ContainsI(fieldType, "unsigned") {
return gdb.LocalTypeUint64, nil
return string(gdb.LocalTypeUint64), nil
}
return gdb.LocalTypeInt64, nil
return string(gdb.LocalTypeInt64), nil
case
"real":
return gdb.LocalTypeFloat32, nil
return string(gdb.LocalTypeFloat32), nil
case
"float",
@@ -155,75 +156,75 @@ func CheckLocalTypeForField(ctx context.Context, fieldType string, fieldValue in
"money",
"numeric",
"smallmoney":
return gdb.LocalTypeFloat64, nil
return string(gdb.LocalTypeFloat64), nil
case
"bit":
// It is suggested using bit(1) as boolean.
if typePattern == "1" {
return gdb.LocalTypeBool, nil
return string(gdb.LocalTypeBool), nil
}
s := gconv.String(fieldValue)
// mssql is true|false string.
if strings.EqualFold(s, "true") || strings.EqualFold(s, "false") {
return gdb.LocalTypeBool, nil
return string(gdb.LocalTypeBool), nil
}
if gstr.ContainsI(fieldType, "unsigned") {
return gdb.LocalTypeUint64Bytes, nil
return string(gdb.LocalTypeUint64Bytes), nil
}
return gdb.LocalTypeInt64Bytes, nil
return string(gdb.LocalTypeInt64Bytes), nil
case
"bool":
return gdb.LocalTypeBool, nil
return string(gdb.LocalTypeBool), nil
case
"date":
return gdb.LocalTypeDate, nil
return string(gdb.LocalTypeDate), nil
case
"datetime",
"timestamp",
"timestamptz":
return gdb.LocalTypeDatetime, nil
return string(gdb.LocalTypeDatetime), nil
case
"json":
return gdb.LocalTypeJson, nil
return string(gdb.LocalTypeJson), nil
case
"jsonb":
return gdb.LocalTypeJsonb, nil
return string(gdb.LocalTypeJsonb), nil
default:
// Auto-detect field type, using key match.
switch {
case strings.Contains(typeName, "text") || strings.Contains(typeName, "char") || strings.Contains(typeName, "character"):
return gdb.LocalTypeString, nil
return string(gdb.LocalTypeString), nil
case strings.Contains(typeName, "float") || strings.Contains(typeName, "double") || strings.Contains(typeName, "numeric"):
return gdb.LocalTypeFloat64, nil
return string(gdb.LocalTypeFloat64), nil
case strings.Contains(typeName, "bool"):
return gdb.LocalTypeBool, nil
return string(gdb.LocalTypeBool), nil
case strings.Contains(typeName, "binary") || strings.Contains(typeName, "blob"):
return gdb.LocalTypeBytes, nil
return string(gdb.LocalTypeBytes), nil
case strings.Contains(typeName, "int"):
if gstr.ContainsI(fieldType, "unsigned") {
return gdb.LocalTypeUint, nil
return string(gdb.LocalTypeUint), nil
}
return gdb.LocalTypeInt, nil
return string(gdb.LocalTypeInt), nil
case strings.Contains(typeName, "time"):
return gdb.LocalTypeDatetime, nil
return string(gdb.LocalTypeDatetime), nil
case strings.Contains(typeName, "date"):
return gdb.LocalTypeDatetime, nil
return string(gdb.LocalTypeDatetime), nil
default:
return gdb.LocalTypeString, nil
return string(gdb.LocalTypeString), nil
}
}
}

View File

@@ -44,7 +44,7 @@ func (l *gCurd) generateWebModelState(ctx context.Context, in *CurdPreviewInput)
func (l *gCurd) generateWebModelDefaultState(ctx context.Context, in *CurdPreviewInput) string {
buffer := bytes.NewBuffer(nil)
buffer.WriteString("export const defaultState = {\n")
buffer.WriteString("export const defaultState: State = {\n")
for _, field := range in.masterFields {
var value = field.DefaultValue
if value == nil {

View File

@@ -117,7 +117,8 @@ func DoUpload(ctx context.Context, typ string, file *ghttp.UploadFile) (result *
return
}
if result != nil {
// 相同存储相同身份才复用
if result != nil && result.Drive == config.Drive && result.MemberId == contexts.GetUserId(ctx) && result.AppId == contexts.GetModule(ctx) {
return
}

View File

@@ -236,6 +236,17 @@ func (s *sAdminSite) handleLogin(ctx context.Context, mb *entity.AdminMember) (r
return
}
var dept *entity.AdminDept
if err = g.Model("admin_dept").Ctx(ctx).Fields("id,status").Where("id", mb.DeptId).Scan(&dept); err != nil || dept == nil {
err = gerror.Wrap(err, "获取部门信息失败,请稍后重试!")
return
}
if dept.Status != consts.StatusEnabled {
err = gerror.New("部门已被禁用,如有疑问请联系管理员")
return
}
user := &model.Identity{
Id: mb.Id,
Pid: mb.Pid,
@@ -294,6 +305,17 @@ func (s *sAdminSite) BindUserContext(ctx context.Context, claims *model.Identity
return
}
var dept *entity.AdminDept
if err = g.Model("admin_dept").Ctx(ctx).Fields("id,status").Where("id", mb.DeptId).Scan(&dept); err != nil || dept == nil {
err = gerror.Wrap(err, "获取部门信息失败,请稍后重试!")
return
}
if dept.Status != consts.StatusEnabled {
err = gerror.New("部门已被禁用,如有疑问请联系管理员")
return
}
user := &model.Identity{
Id: mb.Id,
Pid: mb.Pid,

View File

@@ -3,7 +3,7 @@
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
// @AutoGenerate Version 2.7.6
// @AutoGenerate Version 2.8.9
package sys
import (

View File

@@ -181,7 +181,7 @@ func (s *sSysLog) AnalysisLog(ctx context.Context) entity.SysLog {
postForm := gjson.New(gconv.String(request.PostForm)).Map()
if len(postForm) > 0 {
for k, v := range postForm {
postData.MustAppend(k, v)
postData.MustSet(k, v)
}
}

View File

@@ -3,7 +3,7 @@
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
// @AutoGenerate Version 2.7.6
// @AutoGenerate Version 2.8.9
package sysin
import (

View File

@@ -3,7 +3,7 @@
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
// @AutoGenerate Version 2.7.6
// @AutoGenerate Version 2.8.9
package genrouter
import "hotgo/internal/controller/admin/sys"

View File

@@ -18,21 +18,103 @@ import (
)
type (
ISysCronGroup interface {
ISysEmsLog interface {
// Delete 删除
Delete(ctx context.Context, in *sysin.CronGroupDeleteInp) (err error)
Delete(ctx context.Context, in *sysin.EmsLogDeleteInp) (err error)
// Edit 修改/新增
Edit(ctx context.Context, in *sysin.CronGroupEditInp) (err error)
// Status 更新状态
Status(ctx context.Context, in *sysin.CronGroupStatusInp) (err error)
// MaxSort 最大排序
MaxSort(ctx context.Context, in *sysin.CronGroupMaxSortInp) (res *sysin.CronGroupMaxSortModel, err error)
// View 获取指定信息
View(ctx context.Context, in *sysin.CronGroupViewInp) (res *sysin.CronGroupViewModel, err error)
Edit(ctx context.Context, in *sysin.EmsLogEditInp) (err error)
// Status 更新部门状态
Status(ctx context.Context, in *sysin.EmsLogStatusInp) (err error)
// View 获取指定字典类型信息
View(ctx context.Context, in *sysin.EmsLogViewInp) (res *sysin.EmsLogViewModel, err error)
// List 获取列表
List(ctx context.Context, in *sysin.CronGroupListInp) (list []*sysin.CronGroupListModel, totalCount int, err error)
// Select 选项
Select(ctx context.Context, in *sysin.CronGroupSelectInp) (res *sysin.CronGroupSelectModel, err error)
List(ctx context.Context, in *sysin.EmsLogListInp) (list []*sysin.EmsLogListModel, totalCount int, err error)
// Send 发送邮件
Send(ctx context.Context, in *sysin.SendEmsInp) (err error)
// GetTemplate 获取指定邮件模板
GetTemplate(ctx context.Context, template string, config *model.EmailConfig) (val string, err error)
// AllowSend 是否允许发送
AllowSend(ctx context.Context, models *entity.SysEmsLog, config *model.EmailConfig) (err error)
// NowDayCount 当天发送次数
NowDayCount(ctx context.Context, event, email string) (count int, err error)
// VerifyCode 效验验证码
VerifyCode(ctx context.Context, in *sysin.VerifyEmsCodeInp) (err error)
}
ISysAddons interface {
// List 获取列表
List(ctx context.Context, in *sysin.AddonsListInp) (list []*sysin.AddonsListModel, totalCount int, err error)
// Selects 选项
Selects(ctx context.Context, in *sysin.AddonsSelectsInp) (res *sysin.AddonsSelectsModel, err error)
// Build 提交生成
Build(ctx context.Context, in *sysin.AddonsBuildInp) (err error)
// Install 安装模块
Install(ctx context.Context, in *sysin.AddonsInstallInp) (err error)
// Upgrade 更新模块
Upgrade(ctx context.Context, in *sysin.AddonsUpgradeInp) (err error)
// UnInstall 卸载模块
UnInstall(ctx context.Context, in *sysin.AddonsUnInstallInp) (err error)
}
ISysAttachment interface {
// Model ORM模型
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
// Delete 删除附件
Delete(ctx context.Context, in *sysin.AttachmentDeleteInp) (err error)
// View 获取附件信息
View(ctx context.Context, in *sysin.AttachmentViewInp) (res *sysin.AttachmentViewModel, err error)
// List 获取附件列表
List(ctx context.Context, in *sysin.AttachmentListInp) (list []*sysin.AttachmentListModel, totalCount int, err error)
// ClearKind 清空上传类型
ClearKind(ctx context.Context, in *sysin.AttachmentClearKindInp) (err error)
}
ISysDictData interface {
// Delete 删除
Delete(ctx context.Context, in *sysin.DictDataDeleteInp) error
// Edit 修改/新增
Edit(ctx context.Context, in *sysin.DictDataEditInp) (err error)
// List 获取列表
List(ctx context.Context, in *sysin.DictDataListInp) (list []*sysin.DictDataListModel, totalCount int, err error)
// GetId 获取指定类型的ID
GetId(ctx context.Context, t string) (id int64, err error)
// GetType 获取指定ID的类型标识
GetType(ctx context.Context, id int64) (types string, err error)
// GetTypes 获取指定ID的所有类型标识包含下级
GetTypes(ctx context.Context, id int64) (types []string, err error)
// Select 获取列表
Select(ctx context.Context, in *sysin.DataSelectInp) (list sysin.DataSelectModel, err error)
}
ISysServeLog interface {
// Model 服务日志Orm模型
Model(ctx context.Context) *gdb.Model
// List 获取服务日志列表
List(ctx context.Context, in *sysin.ServeLogListInp) (list []*sysin.ServeLogListModel, totalCount int, err error)
// Export 导出服务日志
Export(ctx context.Context, in *sysin.ServeLogListInp) (err error)
// Delete 删除服务日志
Delete(ctx context.Context, in *sysin.ServeLogDeleteInp) (err error)
// View 获取服务日志指定信息
View(ctx context.Context, in *sysin.ServeLogViewInp) (res *sysin.ServeLogViewModel, err error)
// RealWrite 真实写入
RealWrite(ctx context.Context, models entity.SysServeLog) (err error)
}
ISysCurdDemo interface {
// Model 生成演示ORM模型
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
// List 获取生成演示列表
List(ctx context.Context, in *sysin.CurdDemoListInp) (list []*sysin.CurdDemoListModel, totalCount int, err error)
// Export 导出生成演示
Export(ctx context.Context, in *sysin.CurdDemoListInp) (err error)
// Edit 修改/新增生成演示
Edit(ctx context.Context, in *sysin.CurdDemoEditInp) (err error)
// Delete 删除生成演示
Delete(ctx context.Context, in *sysin.CurdDemoDeleteInp) (err error)
// MaxSort 获取生成演示最大排序
MaxSort(ctx context.Context, in *sysin.CurdDemoMaxSortInp) (res *sysin.CurdDemoMaxSortModel, err error)
// View 获取生成演示指定信息
View(ctx context.Context, in *sysin.CurdDemoViewInp) (res *sysin.CurdDemoViewModel, err error)
// Status 更新生成演示状态
Status(ctx context.Context, in *sysin.CurdDemoStatusInp) (err error)
// Switch 更新生成演示开关
Switch(ctx context.Context, in *sysin.CurdDemoSwitchInp) (err error)
}
ISysDictType interface {
// Tree 树
@@ -44,6 +126,32 @@ type (
// TreeSelect 获取类型关系树选项
TreeSelect(ctx context.Context, in *sysin.DictTreeSelectInp) (list []*sysin.DictTypeTree, err error)
}
ISysGenCodes interface {
// Delete 删除
Delete(ctx context.Context, in *sysin.GenCodesDeleteInp) (err error)
// Edit 修改/新增
Edit(ctx context.Context, in *sysin.GenCodesEditInp) (res *sysin.GenCodesEditModel, err error)
// Status 更新部门状态
Status(ctx context.Context, in *sysin.GenCodesStatusInp) (err error)
// MaxSort 最大排序
MaxSort(ctx context.Context, in *sysin.GenCodesMaxSortInp) (res *sysin.GenCodesMaxSortModel, err error)
// View 获取指定字典类型信息
View(ctx context.Context, in *sysin.GenCodesViewInp) (res *sysin.GenCodesViewModel, err error)
// List 获取列表
List(ctx context.Context, in *sysin.GenCodesListInp) (list []*sysin.GenCodesListModel, totalCount int, err error)
// Selects 选项
Selects(ctx context.Context, in *sysin.GenCodesSelectsInp) (res *sysin.GenCodesSelectsModel, err error)
// TableSelect 表选项
TableSelect(ctx context.Context, in *sysin.GenCodesTableSelectInp) (res []*sysin.GenCodesTableSelectModel, err error)
// ColumnSelect 表字段选项
ColumnSelect(ctx context.Context, in *sysin.GenCodesColumnSelectInp) (res []*sysin.GenCodesColumnSelectModel, err error)
// ColumnList 表字段列表
ColumnList(ctx context.Context, in *sysin.GenCodesColumnListInp) (res []*sysin.GenCodesColumnListModel, err error)
// Preview 生成预览
Preview(ctx context.Context, in *sysin.GenCodesPreviewInp) (res *sysin.GenCodesPreviewModel, err error)
// Build 提交生成
Build(ctx context.Context, in *sysin.GenCodesBuildInp) (err error)
}
ISysLog interface {
// Export 导出
Export(ctx context.Context, in *sysin.LogListInp) (err error)
@@ -60,55 +168,33 @@ type (
// List 列表
List(ctx context.Context, in *sysin.LogListInp) (list []*sysin.LogListModel, totalCount int, err error)
}
ISysLoginLog interface {
// Model 登录日志Orm模型
Model(ctx context.Context) *gdb.Model
// List 获取登录日志列表
List(ctx context.Context, in *sysin.LoginLogListInp) (list []*sysin.LoginLogListModel, totalCount int, err error)
// Export 导出登录日志
Export(ctx context.Context, in *sysin.LoginLogListInp) (err error)
// Delete 删除登录日志
Delete(ctx context.Context, in *sysin.LoginLogDeleteInp) (err error)
// View 获取登录日志指定信息
View(ctx context.Context, in *sysin.LoginLogViewInp) (res *sysin.LoginLogViewModel, err error)
// Push 推送登录日志
Push(ctx context.Context, in *sysin.LoginLogPushInp)
// RealWrite 真实写入
RealWrite(ctx context.Context, models entity.SysLoginLog) (err error)
ISysAddonsConfig interface {
// GetConfigByGroup 获取指定分组的配置
GetConfigByGroup(ctx context.Context, in *sysin.GetAddonsConfigInp) (res *sysin.GetAddonsConfigModel, err error)
// ConversionType 转换类型
ConversionType(ctx context.Context, models *entity.SysAddonsConfig) (value interface{}, err error)
// UpdateConfigByGroup 更新指定分组的配置
UpdateConfigByGroup(ctx context.Context, in *sysin.UpdateAddonsConfigInp) (err error)
}
ISysProvinces interface {
// Tree 关系树选项列表
Tree(ctx context.Context) (list []*sysin.ProvincesTree, err error)
// Delete 删除省市区数据
Delete(ctx context.Context, in *sysin.ProvincesDeleteInp) (err error)
// Edit 修改/新增省市区数据
Edit(ctx context.Context, in *sysin.ProvincesEditInp) (err error)
// Status 更新省市区状态
Status(ctx context.Context, in *sysin.ProvincesStatusInp) (err error)
// MaxSort 最大排序
MaxSort(ctx context.Context, in *sysin.ProvincesMaxSortInp) (res *sysin.ProvincesMaxSortModel, err error)
// View 获取省市区信息
View(ctx context.Context, in *sysin.ProvincesViewInp) (res *sysin.ProvincesViewModel, err error)
ISysBlacklist interface {
// Delete 删除
Delete(ctx context.Context, in *sysin.BlacklistDeleteInp) (err error)
// Edit 修改/新增
Edit(ctx context.Context, in *sysin.BlacklistEditInp) (err error)
// Status 更新部门状态
Status(ctx context.Context, in *sysin.BlacklistStatusInp) (err error)
// View 获取指定字典类型信息
View(ctx context.Context, in *sysin.BlacklistViewInp) (res *sysin.BlacklistViewModel, err error)
// List 获取列表
List(ctx context.Context, in *sysin.ProvincesListInp) (list []*sysin.ProvincesListModel, totalCount int, err error)
// ChildrenList 获取省市区下级列表
ChildrenList(ctx context.Context, in *sysin.ProvincesChildrenListInp) (list []*sysin.ProvincesChildrenListModel, totalCount int, err error)
// UniqueId 获取省市区下级列表
UniqueId(ctx context.Context, in *sysin.ProvincesUniqueIdInp) (res *sysin.ProvincesUniqueIdModel, err error)
// Select 省市区选项
Select(ctx context.Context, in *sysin.ProvincesSelectInp) (res *sysin.ProvincesSelectModel, err error)
}
ISysAttachment interface {
// Model ORM模型
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
// Delete 删除附件
Delete(ctx context.Context, in *sysin.AttachmentDeleteInp) (err error)
// View 获取附件信息
View(ctx context.Context, in *sysin.AttachmentViewInp) (res *sysin.AttachmentViewModel, err error)
// List 获取附件列表
List(ctx context.Context, in *sysin.AttachmentListInp) (list []*sysin.AttachmentListModel, totalCount int, err error)
// ClearKind 清空上传类型
ClearKind(ctx context.Context, in *sysin.AttachmentClearKindInp) (err error)
List(ctx context.Context, in *sysin.BlacklistListInp) (list []*sysin.BlacklistListModel, totalCount int, err error)
// VariableLoad 变化加载
VariableLoad(ctx context.Context, err error)
// Load 加载黑名单
Load(ctx context.Context)
// VerifyRequest 验证请求的访问IP是否在黑名单如果存在则返回错误
VerifyRequest(r *ghttp.Request) (err error)
// ClusterSync 集群同步
ClusterSync(ctx context.Context, message *gredis.Message)
}
ISysConfig interface {
// InitConfig 初始化系统配置
@@ -171,66 +257,6 @@ type (
// OnlineExec 在线执行
OnlineExec(ctx context.Context, in *sysin.OnlineExecInp) (err error)
}
ISysServeLicense interface {
// Model 服务许可证ORM模型
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
// List 获取服务许可证列表
List(ctx context.Context, in *sysin.ServeLicenseListInp) (list []*sysin.ServeLicenseListModel, totalCount int, err error)
// Export 导出服务许可证
Export(ctx context.Context, in *sysin.ServeLicenseListInp) (err error)
// Edit 修改/新增服务许可证
Edit(ctx context.Context, in *sysin.ServeLicenseEditInp) (err error)
// Delete 删除服务许可证
Delete(ctx context.Context, in *sysin.ServeLicenseDeleteInp) (err error)
// View 获取服务许可证指定信息
View(ctx context.Context, in *sysin.ServeLicenseViewInp) (res *sysin.ServeLicenseViewModel, err error)
// Status 更新服务许可证状态
Status(ctx context.Context, in *sysin.ServeLicenseStatusInp) (err error)
// AssignRouter 分配服务许可证路由
AssignRouter(ctx context.Context, in *sysin.ServeLicenseAssignRouterInp) (err error)
}
ISysDictData interface {
// Delete 删除
Delete(ctx context.Context, in *sysin.DictDataDeleteInp) error
// Edit 修改/新增
Edit(ctx context.Context, in *sysin.DictDataEditInp) (err error)
// List 获取列表
List(ctx context.Context, in *sysin.DictDataListInp) (list []*sysin.DictDataListModel, totalCount int, err error)
// GetId 获取指定类型的ID
GetId(ctx context.Context, t string) (id int64, err error)
// GetType 获取指定ID的类型标识
GetType(ctx context.Context, id int64) (types string, err error)
// GetTypes 获取指定ID的所有类型标识包含下级
GetTypes(ctx context.Context, id int64) (types []string, err error)
// Select 获取列表
Select(ctx context.Context, in *sysin.DataSelectInp) (list sysin.DataSelectModel, err error)
}
ISysGenCodes interface {
// Delete 删除
Delete(ctx context.Context, in *sysin.GenCodesDeleteInp) (err error)
// Edit 修改/新增
Edit(ctx context.Context, in *sysin.GenCodesEditInp) (res *sysin.GenCodesEditModel, err error)
// Status 更新部门状态
Status(ctx context.Context, in *sysin.GenCodesStatusInp) (err error)
// MaxSort 最大排序
MaxSort(ctx context.Context, in *sysin.GenCodesMaxSortInp) (res *sysin.GenCodesMaxSortModel, err error)
// View 获取指定字典类型信息
View(ctx context.Context, in *sysin.GenCodesViewInp) (res *sysin.GenCodesViewModel, err error)
// List 获取列表
List(ctx context.Context, in *sysin.GenCodesListInp) (list []*sysin.GenCodesListModel, totalCount int, err error)
// Selects 选项
Selects(ctx context.Context, in *sysin.GenCodesSelectsInp) (res *sysin.GenCodesSelectsModel, err error)
// TableSelect 表选项
TableSelect(ctx context.Context, in *sysin.GenCodesTableSelectInp) (res []*sysin.GenCodesTableSelectModel, err error)
// ColumnSelect 表字段选项
ColumnSelect(ctx context.Context, in *sysin.GenCodesColumnSelectInp) (res []*sysin.GenCodesColumnSelectModel, err error)
// ColumnList 表字段列表
ColumnList(ctx context.Context, in *sysin.GenCodesColumnListInp) (res []*sysin.GenCodesColumnListModel, err error)
// Preview 生成预览
Preview(ctx context.Context, in *sysin.GenCodesPreviewInp) (res *sysin.GenCodesPreviewModel, err error)
// Build 提交生成
Build(ctx context.Context, in *sysin.GenCodesBuildInp) (err error)
}
ISysSmsLog interface {
// Delete 删除
Delete(ctx context.Context, in *sysin.SmsLogDeleteInp) (err error)
@@ -253,259 +279,101 @@ type (
// VerifyCode 效验验证码
VerifyCode(ctx context.Context, in *sysin.VerifyCodeInp) (err error)
}
ISysAddons interface {
ISysCronGroup interface {
// Delete 删除
Delete(ctx context.Context, in *sysin.CronGroupDeleteInp) (err error)
// Edit 修改/新增
Edit(ctx context.Context, in *sysin.CronGroupEditInp) (err error)
// Status 更新状态
Status(ctx context.Context, in *sysin.CronGroupStatusInp) (err error)
// MaxSort 最大排序
MaxSort(ctx context.Context, in *sysin.CronGroupMaxSortInp) (res *sysin.CronGroupMaxSortModel, err error)
// View 获取指定信息
View(ctx context.Context, in *sysin.CronGroupViewInp) (res *sysin.CronGroupViewModel, err error)
// List 获取列表
List(ctx context.Context, in *sysin.AddonsListInp) (list []*sysin.AddonsListModel, totalCount int, err error)
// Selects 选项
Selects(ctx context.Context, in *sysin.AddonsSelectsInp) (res *sysin.AddonsSelectsModel, err error)
// Build 提交生成
Build(ctx context.Context, in *sysin.AddonsBuildInp) (err error)
// Install 安装模块
Install(ctx context.Context, in *sysin.AddonsInstallInp) (err error)
// Upgrade 更新模块
Upgrade(ctx context.Context, in *sysin.AddonsUpgradeInp) (err error)
// UnInstall 卸载模块
UnInstall(ctx context.Context, in *sysin.AddonsUnInstallInp) (err error)
List(ctx context.Context, in *sysin.CronGroupListInp) (list []*sysin.CronGroupListModel, totalCount int, err error)
// Select 选项
Select(ctx context.Context, in *sysin.CronGroupSelectInp) (res *sysin.CronGroupSelectModel, err error)
}
ISysAddonsConfig interface {
// GetConfigByGroup 获取指定分组的配置
GetConfigByGroup(ctx context.Context, in *sysin.GetAddonsConfigInp) (res *sysin.GetAddonsConfigModel, err error)
// ConversionType 转换类型
ConversionType(ctx context.Context, models *entity.SysAddonsConfig) (value interface{}, err error)
// UpdateConfigByGroup 更新指定分组的配置
UpdateConfigByGroup(ctx context.Context, in *sysin.UpdateAddonsConfigInp) (err error)
}
ISysServeLog interface {
// Model 服务日志Orm模型
ISysLoginLog interface {
// Model 登录日志Orm模型
Model(ctx context.Context) *gdb.Model
// List 获取服务日志列表
List(ctx context.Context, in *sysin.ServeLogListInp) (list []*sysin.ServeLogListModel, totalCount int, err error)
// Export 导出服务日志
Export(ctx context.Context, in *sysin.ServeLogListInp) (err error)
// Delete 删除服务日志
Delete(ctx context.Context, in *sysin.ServeLogDeleteInp) (err error)
// View 获取服务日志指定信息
View(ctx context.Context, in *sysin.ServeLogViewInp) (res *sysin.ServeLogViewModel, err error)
// List 获取登录日志列表
List(ctx context.Context, in *sysin.LoginLogListInp) (list []*sysin.LoginLogListModel, totalCount int, err error)
// Export 导出登录日志
Export(ctx context.Context, in *sysin.LoginLogListInp) (err error)
// Delete 删除登录日志
Delete(ctx context.Context, in *sysin.LoginLogDeleteInp) (err error)
// View 获取登录日志指定信息
View(ctx context.Context, in *sysin.LoginLogViewInp) (res *sysin.LoginLogViewModel, err error)
// Push 推送登录日志
Push(ctx context.Context, in *sysin.LoginLogPushInp)
// RealWrite 真实写入
RealWrite(ctx context.Context, models entity.SysServeLog) (err error)
RealWrite(ctx context.Context, models entity.SysLoginLog) (err error)
}
ISysBlacklist interface {
// Delete 删除
Delete(ctx context.Context, in *sysin.BlacklistDeleteInp) (err error)
// Edit 修改/新增
Edit(ctx context.Context, in *sysin.BlacklistEditInp) (err error)
// Status 更新部门状态
Status(ctx context.Context, in *sysin.BlacklistStatusInp) (err error)
// View 获取指定字典类型信息
View(ctx context.Context, in *sysin.BlacklistViewInp) (res *sysin.BlacklistViewModel, err error)
ISysProvinces interface {
// Tree 关系树选项列表
Tree(ctx context.Context) (list []*sysin.ProvincesTree, err error)
// Delete 删除省市区数据
Delete(ctx context.Context, in *sysin.ProvincesDeleteInp) (err error)
// Edit 修改/新增省市区数据
Edit(ctx context.Context, in *sysin.ProvincesEditInp) (err error)
// Status 更新省市区状态
Status(ctx context.Context, in *sysin.ProvincesStatusInp) (err error)
// MaxSort 最大排序
MaxSort(ctx context.Context, in *sysin.ProvincesMaxSortInp) (res *sysin.ProvincesMaxSortModel, err error)
// View 获取省市区信息
View(ctx context.Context, in *sysin.ProvincesViewInp) (res *sysin.ProvincesViewModel, err error)
// List 获取列表
List(ctx context.Context, in *sysin.BlacklistListInp) (list []*sysin.BlacklistListModel, totalCount int, err error)
// VariableLoad 变化加载
VariableLoad(ctx context.Context, err error)
// Load 加载黑名单
Load(ctx context.Context)
// VerifyRequest 验证请求的访问IP是否在黑名单如果存在则返回错误
VerifyRequest(r *ghttp.Request) (err error)
// ClusterSync 集群同步
ClusterSync(ctx context.Context, message *gredis.Message)
List(ctx context.Context, in *sysin.ProvincesListInp) (list []*sysin.ProvincesListModel, totalCount int, err error)
// ChildrenList 获取省市区下级列表
ChildrenList(ctx context.Context, in *sysin.ProvincesChildrenListInp) (list []*sysin.ProvincesChildrenListModel, totalCount int, err error)
// UniqueId 获取省市区下级列表
UniqueId(ctx context.Context, in *sysin.ProvincesUniqueIdInp) (res *sysin.ProvincesUniqueIdModel, err error)
// Select 省市区选项
Select(ctx context.Context, in *sysin.ProvincesSelectInp) (res *sysin.ProvincesSelectModel, err error)
}
ISysCurdDemo interface {
// Model 生成演示ORM模型
ISysServeLicense interface {
// Model 服务许可证ORM模型
Model(ctx context.Context, option ...*handler.Option) *gdb.Model
// List 获取生成演示列表
List(ctx context.Context, in *sysin.CurdDemoListInp) (list []*sysin.CurdDemoListModel, totalCount int, err error)
// Export 导出生成演示
Export(ctx context.Context, in *sysin.CurdDemoListInp) (err error)
// Edit 修改/新增生成演示
Edit(ctx context.Context, in *sysin.CurdDemoEditInp) (err error)
// Delete 删除生成演示
Delete(ctx context.Context, in *sysin.CurdDemoDeleteInp) (err error)
// MaxSort 获取生成演示最大排序
MaxSort(ctx context.Context, in *sysin.CurdDemoMaxSortInp) (res *sysin.CurdDemoMaxSortModel, err error)
// View 获取生成演示指定信息
View(ctx context.Context, in *sysin.CurdDemoViewInp) (res *sysin.CurdDemoViewModel, err error)
// Status 更新生成演示状态
Status(ctx context.Context, in *sysin.CurdDemoStatusInp) (err error)
// Switch 更新生成演示开关
Switch(ctx context.Context, in *sysin.CurdDemoSwitchInp) (err error)
}
ISysEmsLog interface {
// Delete 删除
Delete(ctx context.Context, in *sysin.EmsLogDeleteInp) (err error)
// Edit 修改/新增
Edit(ctx context.Context, in *sysin.EmsLogEditInp) (err error)
// Status 更新部门状态
Status(ctx context.Context, in *sysin.EmsLogStatusInp) (err error)
// View 获取指定字典类型信息
View(ctx context.Context, in *sysin.EmsLogViewInp) (res *sysin.EmsLogViewModel, err error)
// List 获取列表
List(ctx context.Context, in *sysin.EmsLogListInp) (list []*sysin.EmsLogListModel, totalCount int, err error)
// Send 发送邮件
Send(ctx context.Context, in *sysin.SendEmsInp) (err error)
// GetTemplate 获取指定邮件模板
GetTemplate(ctx context.Context, template string, config *model.EmailConfig) (val string, err error)
// AllowSend 是否允许发送
AllowSend(ctx context.Context, models *entity.SysEmsLog, config *model.EmailConfig) (err error)
// NowDayCount 当天发送次数
NowDayCount(ctx context.Context, event, email string) (count int, err error)
// VerifyCode 效验验证码
VerifyCode(ctx context.Context, in *sysin.VerifyEmsCodeInp) (err error)
// List 获取服务许可证列表
List(ctx context.Context, in *sysin.ServeLicenseListInp) (list []*sysin.ServeLicenseListModel, totalCount int, err error)
// Export 导出服务许可证
Export(ctx context.Context, in *sysin.ServeLicenseListInp) (err error)
// Edit 修改/新增服务许可证
Edit(ctx context.Context, in *sysin.ServeLicenseEditInp) (err error)
// Delete 删除服务许可证
Delete(ctx context.Context, in *sysin.ServeLicenseDeleteInp) (err error)
// View 获取服务许可证指定信息
View(ctx context.Context, in *sysin.ServeLicenseViewInp) (res *sysin.ServeLicenseViewModel, err error)
// Status 更新服务许可证状态
Status(ctx context.Context, in *sysin.ServeLicenseStatusInp) (err error)
// AssignRouter 分配服务许可证路由
AssignRouter(ctx context.Context, in *sysin.ServeLicenseAssignRouterInp) (err error)
}
)
var (
localSysCron ISysCron
localSysCronGroup ISysCronGroup
localSysDictType ISysDictType
localSysLog ISysLog
localSysLoginLog ISysLoginLog
localSysProvinces ISysProvinces
localSysAttachment ISysAttachment
localSysConfig ISysConfig
localSysServeLicense ISysServeLicense
localSysSmsLog ISysSmsLog
localSysDictData ISysDictData
localSysGenCodes ISysGenCodes
localSysAddons ISysAddons
localSysAddonsConfig ISysAddonsConfig
localSysEmsLog ISysEmsLog
localSysAddons ISysAddons
localSysAttachment ISysAttachment
localSysDictData ISysDictData
localSysServeLog ISysServeLog
localSysAddonsConfig ISysAddonsConfig
localSysBlacklist ISysBlacklist
localSysConfig ISysConfig
localSysCron ISysCron
localSysCurdDemo ISysCurdDemo
localSysDictType ISysDictType
localSysGenCodes ISysGenCodes
localSysLog ISysLog
localSysSmsLog ISysSmsLog
)
func SysDictData() ISysDictData {
if localSysDictData == nil {
panic("implement not found for interface ISysDictData, forgot register?")
}
return localSysDictData
}
func RegisterSysDictData(i ISysDictData) {
localSysDictData = i
}
func SysGenCodes() ISysGenCodes {
if localSysGenCodes == nil {
panic("implement not found for interface ISysGenCodes, forgot register?")
}
return localSysGenCodes
}
func RegisterSysGenCodes(i ISysGenCodes) {
localSysGenCodes = i
}
func SysSmsLog() ISysSmsLog {
if localSysSmsLog == nil {
panic("implement not found for interface ISysSmsLog, forgot register?")
}
return localSysSmsLog
}
func RegisterSysSmsLog(i ISysSmsLog) {
localSysSmsLog = i
}
func SysAddons() ISysAddons {
if localSysAddons == nil {
panic("implement not found for interface ISysAddons, forgot register?")
}
return localSysAddons
}
func RegisterSysAddons(i ISysAddons) {
localSysAddons = i
}
func SysAddonsConfig() ISysAddonsConfig {
if localSysAddonsConfig == nil {
panic("implement not found for interface ISysAddonsConfig, forgot register?")
}
return localSysAddonsConfig
}
func RegisterSysAddonsConfig(i ISysAddonsConfig) {
localSysAddonsConfig = i
}
func SysServeLog() ISysServeLog {
if localSysServeLog == nil {
panic("implement not found for interface ISysServeLog, forgot register?")
}
return localSysServeLog
}
func RegisterSysServeLog(i ISysServeLog) {
localSysServeLog = i
}
func SysBlacklist() ISysBlacklist {
if localSysBlacklist == nil {
panic("implement not found for interface ISysBlacklist, forgot register?")
}
return localSysBlacklist
}
func RegisterSysBlacklist(i ISysBlacklist) {
localSysBlacklist = i
}
func SysCurdDemo() ISysCurdDemo {
if localSysCurdDemo == nil {
panic("implement not found for interface ISysCurdDemo, forgot register?")
}
return localSysCurdDemo
}
func RegisterSysCurdDemo(i ISysCurdDemo) {
localSysCurdDemo = i
}
func SysEmsLog() ISysEmsLog {
if localSysEmsLog == nil {
panic("implement not found for interface ISysEmsLog, forgot register?")
}
return localSysEmsLog
}
func RegisterSysEmsLog(i ISysEmsLog) {
localSysEmsLog = i
}
func SysCronGroup() ISysCronGroup {
if localSysCronGroup == nil {
panic("implement not found for interface ISysCronGroup, forgot register?")
}
return localSysCronGroup
}
func RegisterSysCronGroup(i ISysCronGroup) {
localSysCronGroup = i
}
func SysDictType() ISysDictType {
if localSysDictType == nil {
panic("implement not found for interface ISysDictType, forgot register?")
}
return localSysDictType
}
func RegisterSysDictType(i ISysDictType) {
localSysDictType = i
}
func SysLog() ISysLog {
if localSysLog == nil {
panic("implement not found for interface ISysLog, forgot register?")
}
return localSysLog
}
func RegisterSysLog(i ISysLog) {
localSysLog = i
}
func SysLoginLog() ISysLoginLog {
if localSysLoginLog == nil {
panic("implement not found for interface ISysLoginLog, forgot register?")
@@ -528,6 +396,39 @@ func RegisterSysProvinces(i ISysProvinces) {
localSysProvinces = i
}
func SysServeLicense() ISysServeLicense {
if localSysServeLicense == nil {
panic("implement not found for interface ISysServeLicense, forgot register?")
}
return localSysServeLicense
}
func RegisterSysServeLicense(i ISysServeLicense) {
localSysServeLicense = i
}
func SysCronGroup() ISysCronGroup {
if localSysCronGroup == nil {
panic("implement not found for interface ISysCronGroup, forgot register?")
}
return localSysCronGroup
}
func RegisterSysCronGroup(i ISysCronGroup) {
localSysCronGroup = i
}
func SysEmsLog() ISysEmsLog {
if localSysEmsLog == nil {
panic("implement not found for interface ISysEmsLog, forgot register?")
}
return localSysEmsLog
}
func RegisterSysEmsLog(i ISysEmsLog) {
localSysEmsLog = i
}
func SysAttachment() ISysAttachment {
if localSysAttachment == nil {
panic("implement not found for interface ISysAttachment, forgot register?")
@@ -539,6 +440,50 @@ func RegisterSysAttachment(i ISysAttachment) {
localSysAttachment = i
}
func SysDictData() ISysDictData {
if localSysDictData == nil {
panic("implement not found for interface ISysDictData, forgot register?")
}
return localSysDictData
}
func RegisterSysDictData(i ISysDictData) {
localSysDictData = i
}
func SysServeLog() ISysServeLog {
if localSysServeLog == nil {
panic("implement not found for interface ISysServeLog, forgot register?")
}
return localSysServeLog
}
func RegisterSysServeLog(i ISysServeLog) {
localSysServeLog = i
}
func SysAddons() ISysAddons {
if localSysAddons == nil {
panic("implement not found for interface ISysAddons, forgot register?")
}
return localSysAddons
}
func RegisterSysAddons(i ISysAddons) {
localSysAddons = i
}
func SysBlacklist() ISysBlacklist {
if localSysBlacklist == nil {
panic("implement not found for interface ISysBlacklist, forgot register?")
}
return localSysBlacklist
}
func RegisterSysBlacklist(i ISysBlacklist) {
localSysBlacklist = i
}
func SysConfig() ISysConfig {
if localSysConfig == nil {
panic("implement not found for interface ISysConfig, forgot register?")
@@ -561,13 +506,68 @@ func RegisterSysCron(i ISysCron) {
localSysCron = i
}
func SysServeLicense() ISysServeLicense {
if localSysServeLicense == nil {
panic("implement not found for interface ISysServeLicense, forgot register?")
func SysCurdDemo() ISysCurdDemo {
if localSysCurdDemo == nil {
panic("implement not found for interface ISysCurdDemo, forgot register?")
}
return localSysServeLicense
return localSysCurdDemo
}
func RegisterSysServeLicense(i ISysServeLicense) {
localSysServeLicense = i
func RegisterSysCurdDemo(i ISysCurdDemo) {
localSysCurdDemo = i
}
func SysDictType() ISysDictType {
if localSysDictType == nil {
panic("implement not found for interface ISysDictType, forgot register?")
}
return localSysDictType
}
func RegisterSysDictType(i ISysDictType) {
localSysDictType = i
}
func SysGenCodes() ISysGenCodes {
if localSysGenCodes == nil {
panic("implement not found for interface ISysGenCodes, forgot register?")
}
return localSysGenCodes
}
func RegisterSysGenCodes(i ISysGenCodes) {
localSysGenCodes = i
}
func SysLog() ISysLog {
if localSysLog == nil {
panic("implement not found for interface ISysLog, forgot register?")
}
return localSysLog
}
func RegisterSysLog(i ISysLog) {
localSysLog = i
}
func SysAddonsConfig() ISysAddonsConfig {
if localSysAddonsConfig == nil {
panic("implement not found for interface ISysAddonsConfig, forgot register?")
}
return localSysAddonsConfig
}
func RegisterSysAddonsConfig(i ISysAddonsConfig) {
localSysAddonsConfig = i
}
func SysSmsLog() ISysSmsLog {
if localSysSmsLog == nil {
panic("implement not found for interface ISysSmsLog, forgot register?")
}
return localSysSmsLog
}
func RegisterSysSmsLog(i ISysSmsLog) {
localSysSmsLog = i
}