Commit Graph
30 Commits
Author SHA1 Message Date
zhangwenjian de33e527fc fix🐛: treat a column saved with isQuery "0" as not queryable
The config page saves an unticked query box as "0", and the DTO and API
templates tested IsQuery with a bare if, which is true for any
non-empty string. A column ticked and then unticked became a filter of
the generated list request and a documented query parameter anyway.
They now require "1", as the TypeScript and Vue templates already do.
2026-09-27 16:07:09 +08:00
zhangwenjian 3112896a83 fix🐛: stop a generated Update when its row is not found
Update looked its row up and ignored the result. When nothing matched -
because the key does not exist, or because the caller's data scope filters
the row out - the model stayed at its zero value, Generate copied the
request onto it, and Save, finding a zero key, inserted a new row. The
update of a row the caller may not see became a row they now own, and the
RowsAffected check meant to refuse it never fired, because the insert did
affect one.

A missing row now ends the update with the same "无权更新该数据" the
RowsAffected check returns, and any other lookup error is returned as is.
This applies to every generated table, an int id included.
2026-09-25 20:00:30 +08:00
zhangwenjian bf8a1b3374 fix🐛: bind the generated service's key as a query value
Get and Update found their row with First(&model, id). GORM reads a string
passed that way as a SQL condition rather than a key, so with a string
primary key the path parameter went into the WHERE clause as written: "c-1"
failed as the expression c - 1, and GET /…/1=1 returned a row.

Both now filter on clause.PrimaryColumn with the id as a bound value, which
GORM resolves to the model's own quoted key column whatever it is called.
Delete keeps Delete(&model, ids): a slice is always taken as key values.
2026-09-25 20:00:21 +08:00
zhangwenjian 722de8ea65 chore🔧: move the generator templates to v2 as well
The code generator writes Go files, and its templates still spelled the
old import paths, so a module generated after this migration did not
compile: the router it emits declares InitBusinessRouter with the v1
*GinJWTMiddleware while common.AuthInit now returns the v2 type.

Two of the paths moved rather than gaining a /v2 segment - the jwtauth
and response shims under sdk/pkg are gone in v2 - so this is not the
same rewrite the Go files got.
2026-08-23 13:28:17 +08:00
zhaoyidong 3685510d25 fix🐛:模板Update方法,err没有被赋值,返回的err永远是nil 2022-09-07 20:08:17 +08:00
zhaoyidong 5b1405391e fix🐛:去除模板中的多余空格 2022-08-18 18:36:50 +08:00
zhaoyidong 62d9084ee8 修复模板get update delete错误 2022-08-16 11:41:28 +08:00
inits abdc80b756 修复前端设置数据权限不生效问题 2022-01-10 10:21:10 +08:00
zhangwenjian 2decf43b4c fix🐛: 统一生成后的路由 2021-08-10 03:35:36 +08:00
zhangwenjian 37d318b4d9 feat✨: vue-cli@3 升级为 vue-cli@4、Change Node Sass to Dart Sass、代码生成工具
1. vue-cli@3 升级为 vue-cli@4
2. Change Node Sass to Dart Sass
3. 代码生成工具
2021-07-04 05:46:20 +08:00
zhangwenjian d82129d364 refactor🎨: 代码生成模版升级 2021-06-30 22:35:49 +08:00
wenjianzhang 91b93a3f48 refactor🎨:模版升级 2021-06-24 20:21:40 +08:00
zhangwenjian 4a2aa02210 refactor🎨: 批量修改通过id获取详情返回消息 2021-06-13 21:14:17 +08:00
wenjianzhang 44545f3d5b feat✨ 结构统一调整 2021-05-20 22:59:09 +08:00
wenjianzhang abcdf880fd refactor🎨 优化模版 2021-05-12 18:46:23 +08:00
wenjianzhang 03eaad5b8b feat✨ 统一api生成路径 2021-05-11 08:37:27 +08:00
wenjianzhang 50a5d6f48d feat✨ 更新service 2021-05-07 19:57:09 +08:00
wenjianzhang 946a53cb2b feat✨ 模版格式化 2021-05-07 19:02:06 +08:00
wenjianzhang e219463505 feat✨ 升级模版 2021-05-07 18:46:12 +08:00
wenjianzhang 009866ee31 feat✨ :更新api写法,同步调整模版 2021-05-07 17:56:15 +08:00
wenjianzhang 14db1e802c feat ✨: 添加字段验证 2021-04-08 18:43:17 +08:00
linwenxiang 93625a6d9f format 🥚:模版生成优化 2021-03-25 14:45:39 +08:00
linwenxiang 4182bac3a2 修改模版,优化生成的swagger 2021-03-24 22:20:23 +08:00
linwenxiang 12893fc09d 修复swagger无法生成文档 2021-03-24 18:52:59 +08:00
linwenxiang 8a471e1db7 修复模版不兼容actions模式生成
迁移重复问题
2021-03-11 22:19:12 +08:00
wenjianzhang 75b529d7b0 ormat🥚 :优化生成模版 2021-03-11 14:56:15 +08:00
linwenxiang 25d8364bf4 修改,兼容go-admin sdk方案 2021-03-09 19:12:49 +08:00
linwenxiang 39dd1ee6f8 兼容casbin2.24.0版本log
迁移脚本编译时不打包
2021-03-05 13:23:21 +08:00
linwenxiang e2952fa393 调整整体架构写法
调整db用法
调整日志用法
调整模版
2021-03-04 23:45:16 +08:00
wenjianzhang 677e54631a perf👌 : 模版升级 2021-01-14 22:41:49 +08:00