This commit is contained in:
vipg
2025-11-11 18:05:20 +08:00
parent b01e82b507
commit 0f66f1a09b
3 changed files with 182 additions and 4 deletions

View File

@@ -1,6 +1,17 @@
---
分析这个项目,在 create.go 中完成以下需求:
1、接收 namecode 两个参数。
2、确认提交的 namecode 两个参数不能为空,如果有空,则返回提示。
3、第二步通过后在 country 表中,通过: "INSERT INTO "country" DEFAULT VALUES RETURNING id" 获得ID。
3、第二步通过后在 country 表中,通过: "INSERT INTO country DEFAULT VALUES RETURNING id" 获得ID。
4、通过 3 中的 id开启事务保存到 name 和 code 的表中。
---
分析这个项目,在 delete.go 中完成以下需求:
1、接收 country_id 参数。
2、确认提交的 country_id 参数不能为空,如果有空,则返回提示。
3、开启事务处理以下逻辑
3.1、把 country 中country.id==req.country_id 的 deleted 字段更新为true。
3.2、把 name 中name.country_id==req.country_id 的 deleted 字段更新为true。
3.3、把 code code.country_id==req.country_id 的 deleted 字段更新为true。
---