feat sn 改成 int64
This commit is contained in:
@@ -33,9 +33,9 @@ func (d *QuestionDao) Create(question *model.Question) (*model.Question, error)
|
||||
return question, err
|
||||
}
|
||||
|
||||
func (d *QuestionDao) FindByRandom(categorySn string) (*model.Question, error) {
|
||||
func (d *QuestionDao) FindByRandom(categorySn int64) (*model.Question, error) {
|
||||
q := d.query.Question.WithContext(d.ctx)
|
||||
if categorySn != "" {
|
||||
if categorySn != 0 {
|
||||
q = q.Where(d.query.Question.CategorySn.Eq(categorySn))
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ func (d *QuestionDao) FindByRandom(categorySn string) (*model.Question, error) {
|
||||
return first, nil
|
||||
}
|
||||
|
||||
func (d *QuestionDao) FindBySn(sn string) (*model.Question, error) {
|
||||
func (d *QuestionDao) FindBySn(sn int64) (*model.Question, error) {
|
||||
if d.cache != nil {
|
||||
var question model.Question
|
||||
if ok := d.cache.Get(d.ctx, keyCacheBySn(sn, question.TableName()), &question); ok {
|
||||
|
||||
Reference in New Issue
Block a user