package repo import ( "gim/internal/business/domain/user/model" "gim/pkg/db" "gim/pkg/gerrors" "github.com/jinzhu/gorm" ) type imPackageDao struct{} var ImPackageDao = new(imPackageDao) // Get 获取套餐包详情 func (*imPackageDao) Get(id int64) (*model.ImPackage, error) { var imPackage = model.ImPackage{Id: id} err := db.DB.First(&imPackage).Error if err != nil && err != gorm.ErrRecordNotFound { return nil, gerrors.WrapError(err) } if err == gorm.ErrRecordNotFound { return nil, nil } return &imPackage, err }