golang-im聊天
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

21 行
470 B

  1. package db
  2. import (
  3. "gim/internal/business/comm/db/model"
  4. "gim/pkg/db"
  5. "gim/pkg/gerrors"
  6. )
  7. type dbEmoticon struct{}
  8. var DbEmoticon = new(dbEmoticon)
  9. // EmoticonFind 获取记录
  10. func (*dbEmoticon) EmoticonFind(masterId string) (*[]model.Emoticon, error) {
  11. var list []model.Emoticon
  12. if err := db.DB.Where("`state` = 1 and `master_id` = ?", masterId).Order("sort desc").Find(&list).Error; err != nil {
  13. return nil, gerrors.WrapError(err)
  14. }
  15. return &list, nil
  16. }