Browse Source

修改白泽包版本

yjp 1 năm trước cách đây
mục cha
commit
62a27906d1

+ 1 - 1
go.mod

@@ -3,7 +3,7 @@ module baize-demo
 go 1.22.3
 
 require (
-	git.sxidc.com/go-framework/baize v1.0.7
+	git.sxidc.com/go-framework/baize v1.0.8
 	git.sxidc.com/go-tools/utils v1.5.23
 	git.sxidc.com/service-supports/fslog v0.5.9
 	git.sxidc.com/service-supports/scm-sdk v0.1.0

+ 2 - 2
project/server/application/domain/student/entity.go

@@ -1,7 +1,7 @@
 package student
 
 import (
-	"git.sxidc.com/go-framework/baize/convenient/domain/query_rule"
+	"git.sxidc.com/go-framework/baize/convenient/domain/query_rule/definition"
 	"git.sxidc.com/go-framework/baize/framework/core/domain"
 	"git.sxidc.com/go-framework/baize/framework/core/domain/entity"
 	"git.sxidc.com/go-framework/baize/framework/core/tag/check"
@@ -32,7 +32,7 @@ type Entity struct {
 }
 
 func RegisterQueryRule() error {
-	return query_rule.RegisterQueryRuleDefinitionByEntity(query_rule.RegisterQueryRuleDefinitionsByEntityItem{
+	return definition.RegisterByDomainEntity(definition.RegisterByEntityItem{
 		Entity:   &Entity{},
 		FieldMap: fieldMap,
 	})

+ 3 - 3
project/server/application/service/student.go

@@ -2,7 +2,7 @@ package service
 
 import (
 	"baize-demo/project/server/application/domain/student"
-	"git.sxidc.com/go-framework/baize/convenient/domain/query_rule"
+	"git.sxidc.com/go-framework/baize/convenient/domain/query_rule/rule"
 	"git.sxidc.com/go-framework/baize/convenient/entity_crud"
 	"git.sxidc.com/go-framework/baize/framework/binding"
 	"git.sxidc.com/go-framework/baize/framework/core/api"
@@ -66,7 +66,7 @@ func (svc *StudentService) v1(appInstance *application.App) {
 				return errResponse, err
 			}
 
-			hasRule, err := query_rule.HasRule(dbSchema, "global", e.DomainCamelName(), i)
+			hasRule, err := rule.HasRule(dbSchema, "global", e.DomainCamelName(), i)
 			if err != nil {
 				return errResponse, err
 			}
@@ -76,7 +76,7 @@ func (svc *StudentService) v1(appInstance *application.App) {
 				return queryFunc(c, params, objects, i)
 			}
 
-			conditionClause, err := query_rule.GetRulesAndFormConditionClause(dbSchema, "global", e.DomainCamelName(), i, e.FormQueryRuleParams())
+			conditionClause, err := rule.FormConditionClause(dbSchema, "global", e.DomainCamelName(), i, e.FormQueryRuleParams())
 			if err != nil {
 				return errResponse, err
 			}

+ 3 - 3
project/server/main.go

@@ -84,11 +84,11 @@ import (
 
 // Query Rule
 // curl -X GET "http://localhost:31000/example/api/queryRuleDefinition/get?domainName=Student"
-// curl -X POST -H 'Content-Type: application/json' -d '{"scope": "global", "domainName": "Student", "rule": "{\"fieldName\": \"Name\", \"fieldType\": \"string\", \"columnName\": \"name\", \"operator\": \"eq\", \"value\": \"test\"}"}' "http://localhost:31000/example/api/queryRule/create"
-// curl -X POST -H 'Content-Type: application/json' -d '{"scope": "global", "domainName": "Student", "rule": "{\"fieldName\": \"Name\", \"fieldType\": \"string\", \"columnName\": \"name\", \"operator\": \"contains\"}"}' "http://localhost:31000/example/api/queryRule/create"
+// curl -X POST -H 'Content-Type: application/json' -d '{"scope": "global", "domainName": "Student", "rule": "{\"fieldName\": \"Name\", \"fieldType\": \"string\", \"operator\": \"eq\", \"value\": \"test\"}"}' "http://localhost:31000/example/api/queryRule/create"
+// curl -X POST -H 'Content-Type: application/json' -d '{"scope": "global", "domainName": "Student", "rule": "{\"fieldName\": \"Name\", \"fieldType\": \"string\", \"operator\": \"contains\"}"}' "http://localhost:31000/example/api/queryRule/create"
 // curl -X POST -H 'Content-Type: application/json' -d '{"scope": "global", "domainName": "Student"}' "http://localhost:31000/example/api/queryRule/query"
 // curl -X POST -H 'Content-Type: application/json' -d '{"scope": "global", "domainName": "Student"}' "http://localhost:31000/example/api/queryRule/enabled/get"
-// curl -X POST -H 'Content-Type: application/json' -d '{"id": "7011cde771a045a885872529ab77e79b"}' "http://localhost:31000/example/api/queryRule/enable"
+// curl -X POST -H 'Content-Type: application/json' -d '{"id": "f696ca9174734349a39915e76217899c"}' "http://localhost:31000/example/api/queryRule/enable"
 // curl -X POST -H 'Content-Type: application/json' -d '{"id": "7011cde771a045a885872529ab77e79b"}' "http://localhost:31000/example/api/queryRule/disable"
 // curl -X DELETE "http://localhost:31000/example/api/queryRule/delete?id=7011cde771a045a885872529ab77e79b"
 // curl -X DELETE "http://localhost:31000/example/api/queryRule/delete?id=597ad3bbb97d4b7aa5196cd9366f07f2"