You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by GitBox <gi...@apache.org> on 2022/06/24 08:59:10 UTC
[GitHub] [incubator-devlake] SnowMoon-Dev commented on a diff in pull request #2340: [Refactor][Gitee] use GetDal instead of deprecated GetDb
SnowMoon-Dev commented on code in PR #2340:
URL: https://github.com/apache/incubator-devlake/pull/2340#discussion_r905866461
##########
models/domainlayer/didgen/domain_id_generator.go:
##########
@@ -88,19 +88,30 @@ func NewDomainIdGenerator(entityPtr interface{}) *DomainIdGenerator {
func (g *DomainIdGenerator) Generate(pkValues ...interface{}) string {
id := g.prefix
- for i, pkValue := range pkValues {
+ isMatch := false
+
+ for _, pkValue := range pkValues {
// append pk
id += ":" + fmt.Sprintf("%v", pkValue)
// type checking
pkValueType := reflect.TypeOf(pkValue)
if pkValueType == wildcardType {
break
- } else if pkValueType != g.pkTypes[i] {
- panic(fmt.Errorf("primary key type does not match: %s should be %s",
- g.pkNames[i],
- g.pkTypes[i].Name(),
+ }
+
+ for _, pkType := range g.pkTypes {
Review Comment:
My problem, I didn't add connectId to generate domainRepoId
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org