feat: one-to-many, belongs-to

This commit is contained in:
2025-03-17 23:47:01 +07:00
parent db9ef0f935
commit 9d14fa7c57
8 changed files with 156 additions and 45 deletions

View File

@@ -64,6 +64,11 @@ func ParseModels(pass *analysis.Pass, models *map[string]Model) {
model.Fields[structField.Name] = structField
(*models)[model.Name] = model
}
if _, exist := model.Fields["Id"]; !exist {
pass.Reportf(model.Pos, "Id field should be presented model \"%s\"", model.Name)
}
return false
})
}