golang-im聊天
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

26 lines
538 B

  1. package repo
  2. import (
  3. "gim/internal/business/domain/user/model"
  4. "gim/pkg/db"
  5. "gim/pkg/gerrors"
  6. "github.com/jinzhu/gorm"
  7. )
  8. type imPackageDao struct{}
  9. var ImPackageDao = new(imPackageDao)
  10. // Get 获取套餐包详情
  11. func (*imPackageDao) Get(id int64) (*model.ImPackage, error) {
  12. var imPackage = model.ImPackage{Id: id}
  13. err := db.DB.First(&imPackage).Error
  14. if err != nil && err != gorm.ErrRecordNotFound {
  15. return nil, gerrors.WrapError(err)
  16. }
  17. if err == gorm.ErrRecordNotFound {
  18. return nil, nil
  19. }
  20. return &imPackage, err
  21. }