19 Commits
Author SHA1 Message Date
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 4911730012 fix🐛: give the natural keys a constraint the database can keep
sys_user.username, sys_role.role_key and sys_dict_type.dict_type had no
unique index. Uniqueness was a SELECT COUNT followed by an INSERT, which
two concurrent requests both pass — and login resolves a username with
First, so which of the two accounts answers is whichever the database
returns.

The index cannot be on the key alone, because a soft-deleted row keeps
occupying the name and a deleted user's username could never be used
again. It has to include the delete marker, and the marker has to be
non-null: two live rows are (alice, NULL) and (alice, NULL), and NULL is
not equal to NULL, so an index over a nullable marker admits both. That
is the worst of the three states — a constraint that reads as protection
and binds nothing — and there is a test that demonstrates it rather than
asserting it.

ModelTime.DeletedAt is milliseconds since the epoch now, zero while the
row is live. Sixteen tables carry it; the migration converts each one,
preserving when each deleted row was deleted, then adds the three
indexes.

Written to be re-runnable rather than transactional, because DDL does not
roll back on MySQL and an operator whose first attempt failed halfway
should have nothing to do but run it again. It refuses before altering
anything if a table already holds duplicates, naming them, rather than
letting the index fail and leaving the operator to guess.

The timestamp conversion happens in Go: turning a timestamp into epoch
milliseconds is spelled differently by every dialect this supports, and
these row counts do not justify four versions of it.
2026-08-22 11:27:22 +08:00
wenjianzhang 4dfd4e4647 refactor🎨 :统一格式 2021-06-03 19:39:19 +08:00
zhangwenjian 9b1cba311e perf👌 added menu type enum 2021-05-31 23:34:50 +08:00
wenjianzhang 2580be08ab feat 优化写法 2021-05-12 18:50:13 +08:00
wenjianzhang d0b2e8d03f feat 添加api管理 2021-05-12 18:48:01 +08:00
linwenxiang 25d8364bf4 修改,兼容go-admin sdk方案 2021-03-09 19:12:49 +08:00
linwenxiang c294bb1585 Merge remote-tracking branch 'origin/dev' into dev
# Conflicts:
#	template/v4/dto.go.template
2021-03-04 23:47:14 +08:00
linwenxiang e2952fa393 调整整体架构写法
调整db用法
调整日志用法
调整模版
2021-03-04 23:45:16 +08:00
wenjianzhang b8ec705e0a feat :添加行政区域基础数据 2021-02-26 01:05:20 +08:00
zhangwenjian f22f654c91 format🥚 :调整主键key和自增长tag 2021-02-24 14:22:33 +08:00
linwenxiang e04b5559bd 前后端一致修复 2021-02-19 16:50:57 +08:00
zhangwenjian 9186c6ce04 fix:优化代码 2021-02-19 10:48:27 +08:00
zhangwenjian 746123c888 refactor🎨 : 修改文件操作函数 2020-12-21 22:02:40 +08:00
zhangwenjian bc648c3f2f test 2020-09-29 08:41:20 +08:00
linwenxiang f3e0e4dbc6 简化代码生成 2020-09-22 20:39:11 +08:00
linwenxiang 7d8a267da7 日志生效,
调整路由注册方式
2020-09-21 23:23:40 +08:00
linwenxiang 77dfe418df 构建数据库迁移体系 2020-09-04 14:30:52 +08:00
linwenxiang 01ea376015 修改文件目录 2020-09-04 00:21:52 +08:00