diff --git a/frontend/package.json b/frontend/package.json index 30eef138..1f992d3d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -29,7 +29,7 @@ "jsencrypt": "^3.3.2", "mitt": "^3.0.1", "monaco-editor": "^0.52.2", - "monaco-sql-languages": "^0.15.0", + "monaco-sql-languages": "^0.15.1", "monaco-themes": "^0.4.5", "nprogress": "^0.2.0", "pinia": "^3.0.3", @@ -40,33 +40,33 @@ "trzsz": "^1.1.5", "uuid": "^9.0.1", "vue": "^3.5.17", - "vue-i18n": "^11.1.6", + "vue-i18n": "^11.1.7", "vue-router": "^4.5.1", "vuedraggable": "^4.1.0" }, "devDependencies": { - "@tailwindcss/vite": "^4.1.10", + "@tailwindcss/vite": "^4.1.11", "@types/crypto-js": "^4.2.2", - "@types/node": "^18.14.0", + "@types/node": "^22.13.14", "@types/nprogress": "^0.2.0", "@types/sortablejs": "^1.15.8", - "@typescript-eslint/eslint-plugin": "^6.7.4", - "@typescript-eslint/parser": "^6.7.4", - "@vitejs/plugin-vue": "^5.2.4", + "@typescript-eslint/eslint-plugin": "^8.35.0", + "@typescript-eslint/parser": "^8.35.0", + "@vitejs/plugin-vue": "^6.0.0", "@vue/compiler-sfc": "^3.5.17", "autoprefixer": "^10.4.21", - "code-inspector-plugin": "^0.20.9", - "dotenv": "^16.3.1", - "eslint": "^9.27.0", + "code-inspector-plugin": "^0.20.12", + "dotenv": "^16.5.0", + "eslint": "^9.29.0", "eslint-plugin-vue": "^10.2.0", "postcss": "^8.5.6", - "prettier": "^3.5.3", + "prettier": "^3.6.1", "sass": "^1.89.2", - "tailwindcss": "^4.1.10", - "typescript": "^5.8.2", + "tailwindcss": "^4.1.11", + "typescript": "^5.8.3", "vite": "npm:rolldown-vite@latest", "vite-plugin-progress": "0.0.7", - "vue-eslint-parser": "^10.1.3" + "vue-eslint-parser": "^10.1.4" }, "browserslist": [ "> 1%", diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index d6accbf1..a96e31e5 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -77,9 +77,6 @@ const viteConfig: UserConfig = { }, }, }, - esbuild: { - drop: isProd ? ['console', 'debugger'] : [], - }, define: { __VUE_I18N_LEGACY_API__: JSON.stringify(false), __VUE_I18N_FULL_INSTALL__: JSON.stringify(false), @@ -100,11 +97,6 @@ const viteConfig: UserConfig = { }, ], }, - preprocessorOptions: { - scss: { - api: 'modern-compiler', // or 'modern' - }, - }, }, }; diff --git a/server/go.mod b/server/go.mod index 7ce22f38..23868886 100644 --- a/server/go.mod +++ b/server/go.mod @@ -19,15 +19,15 @@ require ( github.com/google/uuid v1.6.0 github.com/gorilla/websocket v1.5.3 github.com/lionsoul2014/ip2region/binding/golang v0.0.0-20250508043914-ed57fa5c5274 - github.com/may-fly/cast v1.7.1 - github.com/microsoft/go-mssqldb v1.8.2 + github.com/microsoft/go-mssqldb v1.9.1 github.com/mojocn/base64Captcha v1.3.8 // 验证码 github.com/pkg/errors v0.9.1 github.com/pkg/sftp v1.13.9 github.com/pquerna/otp v1.5.0 - github.com/redis/go-redis/v9 v9.10.0 + github.com/redis/go-redis/v9 v9.11.0 github.com/robfig/cron/v3 v3.0.1 // 定时任务 github.com/sijms/go-ora/v2 v2.9.0 + github.com/spf13/cast v1.9.2 github.com/stretchr/testify v1.10.0 github.com/tidwall/gjson v1.18.0 github.com/veops/go-ansiterm v0.0.5 @@ -91,7 +91,7 @@ require ( golang.org/x/arch v0.14.0 // indirect golang.org/x/exp v0.0.0-20250210185358-939b2ce775ac // indirect golang.org/x/image v0.23.0 // indirect - golang.org/x/net v0.34.0 // indirect + golang.org/x/net v0.40.0 // indirect golang.org/x/sys v0.33.0 // indirect golang.org/x/text v0.26.0 // indirect google.golang.org/protobuf v1.34.1 // indirect diff --git a/server/internal/auth/config/config.go b/server/internal/auth/config/config.go index 624e3097..c18bd7af 100644 --- a/server/internal/auth/config/config.go +++ b/server/internal/auth/config/config.go @@ -1,10 +1,11 @@ package config import ( + "cmp" sysapp "mayfly-go/internal/sys/application" "mayfly-go/pkg/utils/stringx" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) const ( @@ -28,8 +29,8 @@ func GetAccountLoginSecurity() *AccountLoginSecurity { als := new(AccountLoginSecurity) als.UseCaptcha = c.ConvBool(jm["useCaptcha"], true) als.UseOtp = c.ConvBool(jm["useOtp"], false) - als.LoginFailCount = cast.ToIntD(jm["loginFailCount"], 5) - als.LoginFailMin = cast.ToIntD(jm["loginFailMin"], 10) + als.LoginFailCount = cmp.Or(cast.ToInt(jm["loginFailCount"]), 5) + als.LoginFailMin = cmp.Or(cast.ToInt(jm["loginFailMin"]), 10) otpIssuer := jm["otpIssuer"] if otpIssuer == "" { otpIssuer = "mayfly-go" diff --git a/server/internal/db/api/db.go b/server/internal/db/api/db.go index c4aa8847..411204ce 100644 --- a/server/internal/db/api/db.go +++ b/server/internal/db/api/db.go @@ -29,7 +29,7 @@ import ( "strings" "time" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type Db struct { diff --git a/server/internal/db/api/db_data_sync.go b/server/internal/db/api/db_data_sync.go index f4f07ae6..49cf21c7 100644 --- a/server/internal/db/api/db_data_sync.go +++ b/server/internal/db/api/db_data_sync.go @@ -13,7 +13,7 @@ import ( "mayfly-go/pkg/utils/stringx" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type DataSyncTask struct { diff --git a/server/internal/db/api/db_instance.go b/server/internal/db/api/db_instance.go index f634f41d..9eed3c94 100644 --- a/server/internal/db/api/db_instance.go +++ b/server/internal/db/api/db_instance.go @@ -17,7 +17,7 @@ import ( "mayfly-go/pkg/utils/collx" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type Instance struct { diff --git a/server/internal/db/api/db_sql_exec.go b/server/internal/db/api/db_sql_exec.go index 5b93b508..a0ba3aca 100644 --- a/server/internal/db/api/db_sql_exec.go +++ b/server/internal/db/api/db_sql_exec.go @@ -7,7 +7,7 @@ import ( "mayfly-go/pkg/req" "mayfly-go/pkg/utils/collx" - "github.com/may-fly/cast" + "github.com/spf13/cast" "strings" ) diff --git a/server/internal/db/api/db_transfer.go b/server/internal/db/api/db_transfer.go index 530b515d..c8d3fb9d 100644 --- a/server/internal/db/api/db_transfer.go +++ b/server/internal/db/api/db_transfer.go @@ -15,7 +15,7 @@ import ( "mayfly-go/pkg/req" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type DbTransferTask struct { diff --git a/server/internal/db/application/db_data_sync.go b/server/internal/db/application/db_data_sync.go index b24caa36..bb78c39e 100644 --- a/server/internal/db/application/db_data_sync.go +++ b/server/internal/db/application/db_data_sync.go @@ -23,7 +23,7 @@ import ( "time" "github.com/google/uuid" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type DataSyncTask interface { diff --git a/server/internal/db/config/config.go b/server/internal/db/config/config.go index afb11360..d881c722 100644 --- a/server/internal/db/config/config.go +++ b/server/internal/db/config/config.go @@ -6,7 +6,7 @@ import ( "path/filepath" "runtime" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) const ( @@ -29,7 +29,7 @@ func GetDbms() *Dbms { dbmsConf := new(Dbms) dbmsConf.QuerySqlSave = c.ConvBool(jm["querySqlSave"], false) dbmsConf.MaxResultSet = cast.ToInt(jm["maxResultSet"]) - dbmsConf.SqlExecTl = cast.ToIntD(jm["sqlExecTl"], 60) + dbmsConf.SqlExecTl = cmp.Or(cast.ToInt(jm["sqlExecTl"]), 60) return dbmsConf } diff --git a/server/internal/db/dbm/dbi/column.go b/server/internal/db/dbm/dbi/column.go index c74f152a..babb10e5 100644 --- a/server/internal/db/dbm/dbi/column.go +++ b/server/internal/db/dbm/dbi/column.go @@ -10,7 +10,7 @@ import ( "strings" "time" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) var ( diff --git a/server/internal/db/dbm/dm/metadata.go b/server/internal/db/dbm/dm/metadata.go index b37e2321..a1bdd250 100644 --- a/server/internal/db/dbm/dm/metadata.go +++ b/server/internal/db/dbm/dm/metadata.go @@ -10,7 +10,7 @@ import ( "mayfly-go/pkg/utils/stringx" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) const ( diff --git a/server/internal/db/dbm/mssql/metadata.go b/server/internal/db/dbm/mssql/metadata.go index 1db75127..72d90ed3 100644 --- a/server/internal/db/dbm/mssql/metadata.go +++ b/server/internal/db/dbm/mssql/metadata.go @@ -9,7 +9,7 @@ import ( "mayfly-go/pkg/utils/stringx" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) const ( diff --git a/server/internal/db/dbm/mysql/metadata.go b/server/internal/db/dbm/mysql/metadata.go index 352e813e..2950987b 100644 --- a/server/internal/db/dbm/mysql/metadata.go +++ b/server/internal/db/dbm/mysql/metadata.go @@ -9,7 +9,7 @@ import ( "mayfly-go/pkg/utils/stringx" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) const ( diff --git a/server/internal/db/dbm/mysql/sqlgen.go b/server/internal/db/dbm/mysql/sqlgen.go index 5481bc43..c8018944 100644 --- a/server/internal/db/dbm/mysql/sqlgen.go +++ b/server/internal/db/dbm/mysql/sqlgen.go @@ -6,7 +6,7 @@ import ( "mayfly-go/pkg/utils/collx" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type SQLGenerator struct { diff --git a/server/internal/db/dbm/oracle/meta.go b/server/internal/db/dbm/oracle/meta.go index 82517b62..3e2cb1c6 100644 --- a/server/internal/db/dbm/oracle/meta.go +++ b/server/internal/db/dbm/oracle/meta.go @@ -8,8 +8,8 @@ import ( "mayfly-go/pkg/utils/collx" "strings" - "github.com/may-fly/cast" go_ora "github.com/sijms/go-ora/v2" + "github.com/spf13/cast" ) func init() { diff --git a/server/internal/db/dbm/oracle/metadata.go b/server/internal/db/dbm/oracle/metadata.go index 79a32fec..2acd55c2 100644 --- a/server/internal/db/dbm/oracle/metadata.go +++ b/server/internal/db/dbm/oracle/metadata.go @@ -8,7 +8,7 @@ import ( "mayfly-go/pkg/utils/stringx" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) // ---------------------------------- DM元数据 ----------------------------------- diff --git a/server/internal/db/dbm/oracle/metadata11.go b/server/internal/db/dbm/oracle/metadata11.go index 0745104b..f0baa790 100644 --- a/server/internal/db/dbm/oracle/metadata11.go +++ b/server/internal/db/dbm/oracle/metadata11.go @@ -6,7 +6,7 @@ import ( "mayfly-go/pkg/utils/collx" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) const ( diff --git a/server/internal/db/dbm/postgres/dialect.go b/server/internal/db/dbm/postgres/dialect.go index 12bc37d9..af21e8ca 100644 --- a/server/internal/db/dbm/postgres/dialect.go +++ b/server/internal/db/dbm/postgres/dialect.go @@ -5,7 +5,7 @@ import ( "mayfly-go/internal/db/dbm/dbi" "time" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type PgsqlDialect struct { diff --git a/server/internal/db/dbm/postgres/metadata.go b/server/internal/db/dbm/postgres/metadata.go index 056beac8..712da477 100644 --- a/server/internal/db/dbm/postgres/metadata.go +++ b/server/internal/db/dbm/postgres/metadata.go @@ -8,7 +8,7 @@ import ( "mayfly-go/pkg/utils/stringx" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) const ( diff --git a/server/internal/db/dbm/sqlite/metadata.go b/server/internal/db/dbm/sqlite/metadata.go index 84d1a939..32ec2036 100644 --- a/server/internal/db/dbm/sqlite/metadata.go +++ b/server/internal/db/dbm/sqlite/metadata.go @@ -10,7 +10,7 @@ import ( "regexp" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) const ( diff --git a/server/internal/db/dbm/sqlparser/mysql/visitor.go b/server/internal/db/dbm/sqlparser/mysql/visitor.go index 324d7bea..3e26c19b 100644 --- a/server/internal/db/dbm/sqlparser/mysql/visitor.go +++ b/server/internal/db/dbm/sqlparser/mysql/visitor.go @@ -6,7 +6,7 @@ import ( mysqlparser "mayfly-go/internal/db/dbm/sqlparser/mysql/antlr4" "mayfly-go/internal/db/dbm/sqlparser/sqlstmt" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type MysqlVisitor struct { diff --git a/server/internal/db/dbm/sqlparser/pgsql/visitor.go b/server/internal/db/dbm/sqlparser/pgsql/visitor.go index a9ea064e..bc3c3622 100644 --- a/server/internal/db/dbm/sqlparser/pgsql/visitor.go +++ b/server/internal/db/dbm/sqlparser/pgsql/visitor.go @@ -6,7 +6,7 @@ import ( pgparser "mayfly-go/internal/db/dbm/sqlparser/pgsql/antlr4" "mayfly-go/internal/db/dbm/sqlparser/sqlstmt" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type PgsqlVisitor struct { diff --git a/server/internal/es/api/es_instance.go b/server/internal/es/api/es_instance.go index 9e118061..7cf13321 100644 --- a/server/internal/es/api/es_instance.go +++ b/server/internal/es/api/es_instance.go @@ -19,7 +19,7 @@ import ( "net/url" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type Instance struct { diff --git a/server/internal/file/application/file.go b/server/internal/file/application/file.go index d4845062..0df70344 100644 --- a/server/internal/file/application/file.go +++ b/server/internal/file/application/file.go @@ -16,7 +16,7 @@ import ( "path/filepath" "time" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type File interface { diff --git a/server/internal/file/config/config.go b/server/internal/file/config/config.go index 1e9cbe44..dcd1ffc5 100644 --- a/server/internal/file/config/config.go +++ b/server/internal/file/config/config.go @@ -1,9 +1,10 @@ package config import ( + "cmp" sysapp "mayfly-go/internal/sys/application" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) const ( @@ -19,6 +20,6 @@ func GetFileConfig() *FileConfig { jm := c.GetJsonMap() fc := new(FileConfig) - fc.BasePath = cast.ToStringD(jm["basePath"], "./file") + fc.BasePath = cmp.Or(cast.ToString(jm["basePath"]), "./file") return fc } diff --git a/server/internal/flow/api/procdef.go b/server/internal/flow/api/procdef.go index 3bb37a05..90ddb6dc 100644 --- a/server/internal/flow/api/procdef.go +++ b/server/internal/flow/api/procdef.go @@ -18,7 +18,7 @@ import ( "mayfly-go/pkg/utils/structx" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type Procdef struct { diff --git a/server/internal/flow/application/node_usertask.go b/server/internal/flow/application/node_usertask.go index 6f6783cc..c2477c06 100644 --- a/server/internal/flow/application/node_usertask.go +++ b/server/internal/flow/application/node_usertask.go @@ -11,7 +11,7 @@ import ( "mayfly-go/pkg/global" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) /******************* 用户任务节点 *******************/ diff --git a/server/internal/flow/application/procinst_task.go b/server/internal/flow/application/procinst_task.go index 955fb52f..7329ad09 100644 --- a/server/internal/flow/application/procinst_task.go +++ b/server/internal/flow/application/procinst_task.go @@ -11,7 +11,7 @@ import ( "mayfly-go/pkg/model" "mayfly-go/pkg/utils/stringx" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type ProcinstTask interface { diff --git a/server/internal/flow/domain/entity/procdef.go b/server/internal/flow/domain/entity/procdef.go index 6d9f931b..e44c851d 100644 --- a/server/internal/flow/domain/entity/procdef.go +++ b/server/internal/flow/domain/entity/procdef.go @@ -9,7 +9,7 @@ import ( "mayfly-go/pkg/utils/stringx" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) // 流程定义信息 diff --git a/server/internal/machine/api/machine.go b/server/internal/machine/api/machine.go index 06061627..a39ad4bd 100644 --- a/server/internal/machine/api/machine.go +++ b/server/internal/machine/api/machine.go @@ -28,7 +28,7 @@ import ( "time" "github.com/gorilla/websocket" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type Machine struct { diff --git a/server/internal/machine/api/machine_cronjob.go b/server/internal/machine/api/machine_cronjob.go index 4bee4ced..9d8a9e45 100644 --- a/server/internal/machine/api/machine_cronjob.go +++ b/server/internal/machine/api/machine_cronjob.go @@ -17,7 +17,7 @@ import ( "mayfly-go/pkg/scheduler" "mayfly-go/pkg/utils/collx" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type MachineCronJob struct { diff --git a/server/internal/machine/api/machine_file.go b/server/internal/machine/api/machine_file.go index b3d3c2b6..c9cf6f3b 100644 --- a/server/internal/machine/api/machine_file.go +++ b/server/internal/machine/api/machine_file.go @@ -30,8 +30,8 @@ import ( "strings" "sync" - "github.com/may-fly/cast" "github.com/pkg/sftp" + "github.com/spf13/cast" ) type MachineFile struct { diff --git a/server/internal/machine/api/machine_script.go b/server/internal/machine/api/machine_script.go index 2a328559..a7c57108 100644 --- a/server/internal/machine/api/machine_script.go +++ b/server/internal/machine/api/machine_script.go @@ -14,7 +14,7 @@ import ( "mayfly-go/pkg/utils/stringx" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type MachineScript struct { diff --git a/server/internal/machine/config/config.go b/server/internal/machine/config/config.go index bc7631ea..2f108f19 100644 --- a/server/internal/machine/config/config.go +++ b/server/internal/machine/config/config.go @@ -1,11 +1,12 @@ package config import ( + "cmp" sysapp "mayfly-go/internal/sys/application" "mayfly-go/pkg/logx" "mayfly-go/pkg/utils/bytex" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) const ( @@ -38,11 +39,11 @@ func GetMachine() *Machine { } } mc.UploadMaxFileSize = uploadMaxFileSize - mc.TermOpSaveDays = cast.ToIntD(jm["termOpSaveDays"], 30) + mc.TermOpSaveDays = cmp.Or(cast.ToInt(jm["termOpSaveDays"]), 30) // guacd mc.GuacdHost = cast.ToString(jm["guacdHost"]) - mc.GuacdPort = cast.ToIntD(jm["guacdPort"], 4822) - mc.GuacdFilePath = cast.ToStringD(jm["guacdFilePath"], "") + mc.GuacdPort = cmp.Or(cast.ToInt(jm["guacdPort"]), 4822) + mc.GuacdFilePath = cast.ToString(jm["guacdFilePath"]) return mc } diff --git a/server/internal/machine/mcm/client.go b/server/internal/machine/mcm/client.go index 0e6f2def..96a6b94d 100644 --- a/server/internal/machine/mcm/client.go +++ b/server/internal/machine/mcm/client.go @@ -5,8 +5,8 @@ import ( "mayfly-go/pkg/logx" "strings" - "github.com/may-fly/cast" "github.com/pkg/sftp" + "github.com/spf13/cast" "golang.org/x/crypto/ssh" ) diff --git a/server/internal/machine/mcm/terminal_session.go b/server/internal/machine/mcm/terminal_session.go index e7ccf45a..39fcf4f4 100644 --- a/server/internal/machine/mcm/terminal_session.go +++ b/server/internal/machine/mcm/terminal_session.go @@ -1,13 +1,14 @@ package mcm import ( + "cmp" "context" "fmt" "io" "mayfly-go/pkg/errorx" "mayfly-go/pkg/logx" - "github.com/may-fly/cast" + "github.com/spf13/cast" "strings" "time" @@ -258,15 +259,15 @@ func parseMsg(msg []byte) (*WsMsg, error) { } // 获取消息类型, 提取第一个 "|" 之前的内容 - msgType := cast.ToIntD(msgStr[:index], Ping) + msgType := cmp.Or(cast.ToInt(msgStr[:index]), Ping) // 其余内容则为消息内容 msgContent := msgStr[index+1:] wsMsg := &WsMsg{Type: msgType, Msg: msgContent} if msgType == Resize { rowsAndCols := strings.Split(msgContent, MsgSplit) - wsMsg.Rows = cast.ToIntD(rowsAndCols[0], 80) - wsMsg.Cols = cast.ToIntD(rowsAndCols[1], 80) + wsMsg.Rows = cmp.Or(cast.ToInt(rowsAndCols[0]), 80) + wsMsg.Cols = cmp.Or(cast.ToInt(rowsAndCols[1]), 80) } return wsMsg, nil } diff --git a/server/internal/mongo/api/mongo.go b/server/internal/mongo/api/mongo.go index 826e36c6..71fdda3b 100644 --- a/server/internal/mongo/api/mongo.go +++ b/server/internal/mongo/api/mongo.go @@ -19,7 +19,7 @@ import ( "regexp" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" "go.mongodb.org/mongo-driver/v2/bson" "go.mongodb.org/mongo-driver/v2/mongo/options" diff --git a/server/internal/msg/api/msg_channel.go b/server/internal/msg/api/msg_channel.go index 60eb5861..605b8a27 100644 --- a/server/internal/msg/api/msg_channel.go +++ b/server/internal/msg/api/msg_channel.go @@ -9,7 +9,7 @@ import ( "mayfly-go/pkg/req" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type MsgChannel struct { diff --git a/server/internal/msg/api/msg_tmpl.go b/server/internal/msg/api/msg_tmpl.go index 367f7ba0..db007642 100644 --- a/server/internal/msg/api/msg_tmpl.go +++ b/server/internal/msg/api/msg_tmpl.go @@ -12,7 +12,7 @@ import ( "mayfly-go/pkg/utils/jsonx" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type MsgTmpl struct { diff --git a/server/internal/msg/msgx/sender/email.go b/server/internal/msg/msgx/sender/email.go index 22dce464..2f78fc69 100644 --- a/server/internal/msg/msgx/sender/email.go +++ b/server/internal/msg/msgx/sender/email.go @@ -11,7 +11,7 @@ import ( "net/smtp" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type EmailSender struct{} diff --git a/server/internal/msg/msgx/sender/feishu_bot.go b/server/internal/msg/msgx/sender/feishu_bot.go index ac22f3e2..1f2c33b5 100644 --- a/server/internal/msg/msgx/sender/feishu_bot.go +++ b/server/internal/msg/msgx/sender/feishu_bot.go @@ -14,7 +14,7 @@ import ( "time" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type feishuBotMsgReq struct { diff --git a/server/internal/redis/api/redis.go b/server/internal/redis/api/redis.go index 9ede4622..f5d25779 100644 --- a/server/internal/redis/api/redis.go +++ b/server/internal/redis/api/redis.go @@ -20,8 +20,8 @@ import ( "mayfly-go/pkg/utils/stringx" "strings" - "github.com/may-fly/cast" "github.com/redis/go-redis/v9" + "github.com/spf13/cast" ) type Redis struct { diff --git a/server/internal/redis/application/redis.go b/server/internal/redis/application/redis.go index 54f86a66..c2f7965e 100644 --- a/server/internal/redis/application/redis.go +++ b/server/internal/redis/application/redis.go @@ -24,8 +24,8 @@ import ( "strconv" "strings" - "github.com/may-fly/cast" "github.com/redis/go-redis/v9" + "github.com/spf13/cast" ) type Redis interface { diff --git a/server/internal/redis/rdm/cmd.go b/server/internal/redis/rdm/cmd.go index a9b4af53..0080aae9 100644 --- a/server/internal/redis/rdm/cmd.go +++ b/server/internal/redis/rdm/cmd.go @@ -1,6 +1,6 @@ package rdm -import "github.com/may-fly/cast" +import "github.com/spf13/cast" // write cmd var writeCmd = map[string]string{ diff --git a/server/internal/sys/api/account.go b/server/internal/sys/api/account.go index f9e6618a..718d23e6 100644 --- a/server/internal/sys/api/account.go +++ b/server/internal/sys/api/account.go @@ -18,7 +18,7 @@ import ( "strings" "time" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) const ( diff --git a/server/internal/sys/api/role.go b/server/internal/sys/api/role.go index 89e942aa..341897f0 100644 --- a/server/internal/sys/api/role.go +++ b/server/internal/sys/api/role.go @@ -11,7 +11,7 @@ import ( "mayfly-go/pkg/utils/collx" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type Role struct { diff --git a/server/internal/sys/domain/entity/config.go b/server/internal/sys/domain/entity/config.go index bc5ef1d6..707ca86d 100644 --- a/server/internal/sys/domain/entity/config.go +++ b/server/internal/sys/domain/entity/config.go @@ -1,10 +1,11 @@ package entity import ( + "cmp" "encoding/json" "mayfly-go/pkg/model" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) const ( @@ -50,7 +51,7 @@ func (c *Config) IntValue(defaultValue int) int { if c.Id == 0 { return defaultValue } - return cast.ToIntD(c.Value, defaultValue) + return cmp.Or(cast.ToInt(c.Value), defaultValue) } // 转换配置中的值为bool类型(默认"1"或"true"为true,其他为false) diff --git a/server/internal/tag/api/resource_auth_cert.go b/server/internal/tag/api/resource_auth_cert.go index 1adb834a..1ac22740 100644 --- a/server/internal/tag/api/resource_auth_cert.go +++ b/server/internal/tag/api/resource_auth_cert.go @@ -11,7 +11,7 @@ import ( "mayfly-go/pkg/req" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type ResourceAuthCert struct { diff --git a/server/internal/tag/api/team.go b/server/internal/tag/api/team.go index 24756c82..aa411ac0 100644 --- a/server/internal/tag/api/team.go +++ b/server/internal/tag/api/team.go @@ -16,7 +16,7 @@ import ( "mayfly-go/pkg/utils/collx" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type Team struct { diff --git a/server/internal/tag/application/tag_tree.go b/server/internal/tag/application/tag_tree.go index a6a47c85..3ac877d6 100644 --- a/server/internal/tag/application/tag_tree.go +++ b/server/internal/tag/application/tag_tree.go @@ -18,7 +18,7 @@ import ( "slices" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type TagTree interface { diff --git a/server/internal/tag/application/tag_tree_test.go b/server/internal/tag/application/tag_tree_test.go index dc108c7d..d0eb7e68 100644 --- a/server/internal/tag/application/tag_tree_test.go +++ b/server/internal/tag/application/tag_tree_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) func TestTagPath(t *testing.T) { diff --git a/server/internal/tag/domain/entity/query.go b/server/internal/tag/domain/entity/query.go index 9348c3b1..85534dd5 100644 --- a/server/internal/tag/domain/entity/query.go +++ b/server/internal/tag/domain/entity/query.go @@ -5,7 +5,7 @@ import ( "mayfly-go/pkg/utils/collx" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type TypePath string diff --git a/server/internal/tag/domain/entity/tag_tree.go b/server/internal/tag/domain/entity/tag_tree.go index 986a271d..e28b18dd 100644 --- a/server/internal/tag/domain/entity/tag_tree.go +++ b/server/internal/tag/domain/entity/tag_tree.go @@ -7,7 +7,7 @@ import ( "mayfly-go/pkg/utils/collx" "strings" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) // 标签树 diff --git a/server/pkg/cache/cache.go b/server/pkg/cache/cache.go index 532b5770..f9cd9f6e 100644 --- a/server/pkg/cache/cache.go +++ b/server/pkg/cache/cache.go @@ -5,7 +5,7 @@ import ( "mayfly-go/pkg/utils/anyx" "time" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type Cache interface { diff --git a/server/pkg/cache/local.go b/server/pkg/cache/local.go index 029e7be3..e536b9ed 100644 --- a/server/pkg/cache/local.go +++ b/server/pkg/cache/local.go @@ -4,7 +4,7 @@ import ( "strings" "time" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) type LocalCache struct { diff --git a/server/pkg/httpx/httpx.go b/server/pkg/httpx/httpx.go index 02571a64..25e7a76b 100644 --- a/server/pkg/httpx/httpx.go +++ b/server/pkg/httpx/httpx.go @@ -14,7 +14,7 @@ import ( "os" "time" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) // 默认超时 diff --git a/server/pkg/utils/collx/map.go b/server/pkg/utils/collx/map.go index 126fe406..f6977f0b 100644 --- a/server/pkg/utils/collx/map.go +++ b/server/pkg/utils/collx/map.go @@ -5,7 +5,7 @@ import ( "encoding/json" "mayfly-go/pkg/utils/anyx" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) // M is a shortcut for map[string]any diff --git a/server/pkg/utils/stringx/template_test.go b/server/pkg/utils/stringx/template_test.go index 4458c122..594e4648 100644 --- a/server/pkg/utils/stringx/template_test.go +++ b/server/pkg/utils/stringx/template_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/may-fly/cast" + "github.com/spf13/cast" ) func TestTemplateParse(t *testing.T) {