Commit Graph
26 Commits
Author SHA1 Message Date
zhangwenjian 954ebdc9eb refactor🎨: turn common/dto into a thin alias of go-admin-core
AutoForm, ObjectById/ObjectGetReq/ObjectDeleteReq, Pagination,
GeneralDelDto/GeneralGetDto and Index/Control are now type aliases of
go-admin-core's sdk/contract/dto; OrderDest, MakeCondition and
Paginate forward to the same package (functions cannot be aliased the
way types can).

MakeCondition no longer reads common/global.Driver to choose which SQL
dialect to resolve search tags against. The lowered version reads
db.Dialector.Name() from inside the closure it returns instead, which
is always the driver the caller's own *gorm.DB is bound to - correct
even with more than one database open with different drivers, which a
single process-wide variable could never be. global.Driver is marked
Deprecated accordingly; it is still set and still readable for fork
code that reads it directly.

PRD 006 F2/F5.

Claude-Session: https://claude.ai/code/session_01HPTAw8b8tAdFNFn8rKdPYx
2026-09-05 10:15:58 +08:00
zhangwenjian 8ffde94433 chore🔧: move to go-admin-core v2
Every import of the module changes, not only the seven packages that
moved out of sdk/pkg: Go requires the major version in the path from v2
on. Both happen in one pass —

    go run github.com/go-admin-team/go-admin-core/tools/coreupgrade@v2.0.0 -w -v2 .
    go mod tidy

— which is the command the release notes give, run here as a consumer
would run it. 210 imports across 95 files.

The compatibility shims this used are gone in v2, so the paths that
moved had to move: sdk/pkg/captcha, sdk/pkg/jwtauth and its user
package, sdk/pkg/response and sdk/pkg/casbin.

The count of unformatted files is unchanged at 34, none of them touched
by this: the tool reformats a file only if it was already gofmt clean,
so a migration cannot disappear into whitespace.
2026-08-23 13:26:46 +08:00
zhangwenjian 9f2dec3036 fix🐛: 修正 GeneralDelDto.GetIds 重复追加 Id
该方法先在开头追加了 Id,随后 else 分支中又追加一次:仅传 Id 时返回
[5 5],删除接口会对同一条记录执行两次 DELETE。

  if g.Id != 0 { ids = append(ids, g.Id) }
  if len(g.Ids) > 0 { ... } else {
      if g.Id > 0 { ids = append(ids, g.Id) }   // 重复
  }

去掉冗余分支,同时将首个判断由 != 0 收紧为 > 0,与 Ids 中逐个元素的
过滤条件保持一致(负数 Id 无意义)。

补充单元测试,覆盖仅 Id、仅 Ids、二者并存、含非正数、全空回退等场景。

问题由 PR #848 指出。
2026-08-14 15:35:55 +08:00
zhangwenjian f80e64688e refactor🎨: 修改请求参数命名 2021-06-29 16:32:44 +08:00
zhangwenjian a54d4ba0c1 format🥚 代码格式化 2021-05-31 18:10:23 +08:00
wenjianzhang 623e796c92 feat 操作日志功能更换bind方式 2021-05-25 19:35:45 +08:00
wenjianzhang 9bc2791b26 fix🐛 文件管理\内容管理\分类程序\定时任务的已知问题 2021-05-08 17:02:56 +08:00
linwenxiang e40047a88e feat 去除数据库写log对queue驱动的依赖,调整cache,分离出queue和locker 2021-04-20 11:08:46 +08:00
wenjianzhang 14db1e802c feat : 添加字段验证 2021-04-08 18:43:17 +08:00
linwenxiang 9bf9330410 api层写法统一 2021-03-12 16:02:29 +08:00
linwenxiang 8a471e1db7 修复模版不兼容actions模式生成
迁移重复问题
2021-03-11 22:19:12 +08:00
linwenxiang 25d8364bf4 修改,兼容go-admin sdk方案 2021-03-09 19:12:49 +08:00
linwenxiang 75711922b4 调整log代码,兼容zap扩展支持fields 2021-03-05 15:13:36 +08:00
linwenxiang da347e095f 权限相关问题修复 2021-02-22 22:00:34 +08:00
linwenxiang deeb82048b 数据库连接初始化优化
权限部分修改
2021-02-21 14:06:13 +08:00
linwenxiang e04b5559bd 前后端一致修复 2021-02-19 16:50:57 +08:00
wenjianzhang 792c8874aa perf👌 : 岗位、角色功能改造 2021-01-16 21:46:57 +08:00
zhangwenjian 0db2e8ef13 Merge branch 'dev' of https://github.com/go-admin-team/go-admin into go-admin-team-dev 2020-12-21 23:01:37 +08:00
zhangwenjian 746123c888 refactor🎨 : 修改文件操作函数 2020-12-21 22:02:40 +08:00
linwenxiang d9347de392 修改工具库目录
更新gorm到最新版
2020-12-10 17:55:33 +08:00
linwenxiang 52f42616a2 近期bug修复,迁移go-admin-core库, Fixed #272 Fixed #261 2020-10-21 10:09:47 +08:00
zhangwenjian bc648c3f2f test 2020-09-29 08:41:20 +08:00
linwenxiang 8460b3f385 修改action和模版,使用log打印日志,修复job删除问题,已经所有删除问题 2020-09-22 22:04:29 +08:00
linwenxiang f3e0e4dbc6 简化代码生成 2020-09-22 20:39:11 +08:00
linwenxiang 0c64d8b927 修复指针问题,提取by_id到公共结构体 2020-09-08 20:28:31 +08:00
linwenxiang 01ea376015 修改文件目录 2020-09-04 00:21:52 +08:00