@@ -323,7 +323,7 @@ func GenCRUDData(g *GenEntLogicContext, projectCtx *ctx.ProjectContext, schema *
323
323
predicateData .WriteString (fmt .Sprintf ("\t var predicates []predicate.%s\n " , schema .Name ))
324
324
count := 0
325
325
for _ , v := range schema .Fields {
326
- if entx . IsBaseProperty ( v .Name ) || count >= g .SearchKeyNum {
326
+ if v .Name == "id" || count >= g .SearchKeyNum {
327
327
continue
328
328
}
329
329
@@ -339,7 +339,7 @@ func GenCRUDData(g *GenEntLogicContext, projectCtx *ctx.ProjectContext, schema *
339
339
camelName , strings .ToLower (schema .Name ), entx .ConvertSpecificNounToUpper (v .Name ), camelName ))
340
340
count ++
341
341
} else if entx .IsTimeProperty (v .Info .Type .String ()) {
342
- predicateData .WriteString (fmt .Sprintf ("\t if req.%s != nil {\n \t \t predicates = append(predicates, %s.%sGT (time.UnixMilli(*req.%s)))\n \t }\n " ,
342
+ predicateData .WriteString (fmt .Sprintf ("\t if req.%s != nil {\n \t \t predicates = append(predicates, %s.%sGTE (time.UnixMilli(*req.%s)))\n \t }\n " ,
343
343
camelName , strings .ToLower (schema .Name ), entFieldName , camelName ))
344
344
count ++
345
345
} else {
@@ -411,8 +411,8 @@ func GenCRUDData(g *GenEntLogicContext, projectCtx *ctx.ProjectContext, schema *
411
411
"IdType" : g .IdType ,
412
412
"HasCreated" : g .HasCreated ,
413
413
"HasPointy" : hasPointy ,
414
- "hasTime" : hasTime ,
415
- "hasUUID" : strings .Contains ("uuidx." , predicateData .String ()),
414
+ "hasTime" : strings . Contains ( predicateData . String (), "time." ) ,
415
+ "hasUUID" : strings .Contains (predicateData .String (), "uuidx." ),
416
416
})
417
417
418
418
data = append (data , & ApiLogicData {
@@ -476,7 +476,7 @@ func GenApiData(schema *load.Schema, ctx GenEntLogicContext) (string, error) {
476
476
}
477
477
478
478
for _ , v := range schema .Fields {
479
- if entx . IsBaseProperty ( v .Name ) {
479
+ if v .Name == "id" {
480
480
continue
481
481
}
482
482
@@ -507,7 +507,9 @@ func GenApiData(schema *load.Schema, ctx GenEntLogicContext) (string, error) {
507
507
entx .ConvertEntTypeToGotypeInSingleApi (v .Info .Type .String ()),
508
508
jsonTag , optionalStr )
509
509
510
- infoData .WriteString (structData )
510
+ if ! entx .IsBaseProperty (v .Name ) {
511
+ infoData .WriteString (structData )
512
+ }
511
513
512
514
if searchKeyNum > 0 {
513
515
listData .WriteString (structData )
0 commit comments