8.5 重构文章列表

// GetStringID 获取 ID 的字符串格式
func (a BaseModel) GetStringID() string {
    return types.Uint64ToString(a.ID)
}

这里直接跳过了该方法的讲解,导致报错

app/models/article/article.go:14:54: article.GetStringID undefined (type Article has no field or method GetStringID)
一直在学习,从未停止,终身学习。
讨论数量: 4

感谢指出,也是遇到这个问题

2年前 评论

app/models/article/article.go:14:54: article.GetStringID undefined (type Article has no field or method GetStringID) 在 app/models/article/article.go 添加: func (article Article) GetStringID() string { return types.Uint64ToString(article.ID) }

2年前 评论
任飘渺

请问 GetStringID 在那一节有讲过呢?

2年前 评论

应该是后期维护更新的,看github提交记录,开始不是这个

2年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!