Commit Graph
14 Commits
Author SHA1 Message Date
zhangwenjian 4d17146a25 chore🔧: deprecate the five CRUD actions the generic ones replace
IndexAction, ViewAction, CreateAction, UpdateAction and DeleteAction
stay and behave as before; each now points at its generic replacement.
Nothing in this repository calls them any more.
2026-09-27 20:46:21 +08:00
zhangwenjian ea2d807071 fix🐛: give queries the request's context, not the pooled gin.Context
WithContextDb and the five CRUD actions passed the *gin.Context itself
to GORM as the query's context. database/sql watches the context of a
query that returns rows inside a transaction from a goroutine of its
own, which can still read it after the handler returns - and gin hands
that Context to the next request as soon as the handler returns. GORM
wraps every write in a transaction, and an INSERT on SQLite or
PostgreSQL returns the new key as a row, so any write raced with the
next request's reset. The race detector reports it on the second of
two sequential requests.

They now pass c.Request.Context(), which belongs to one request only
and is cancelled when its client goes away.
2026-09-27 20:45:45 +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 dd5f0c52fb refactor🎨: 修改错误信息提示 2021-06-29 16:33:03 +08:00
zhangwenjian a54d4ba0c1 format🥚 代码格式化 2021-05-31 18:10:23 +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 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 e2952fa393 调整整体架构写法
调整db用法
调整日志用法
调整模版
2021-03-04 23:45:16 +08:00
zhangwenjian 746123c888 refactor🎨 : 修改文件操作函数 2020-12-21 22:02:40 +08:00
linwenxiang c0ac9a6397 支持view自定义返回 2020-09-23 00:35:07 +08:00
linwenxiang 8460b3f385 修改action和模版,使用log打印日志,修复job删除问题,已经所有删除问题 2020-09-22 22:04:29 +08:00
linwenxiang 01ea376015 修改文件目录 2020-09-04 00:21:52 +08:00