dengbiao 1 miesiąc temu
rodzic
commit
0c4032b842
2 zmienionych plików z 0 dodań i 43 usunięć
  1. +0
    -25
      internal/business/domain/user/repo/im_package_dao.go
  2. +0
    -18
      internal/business/domain/user/repo/im_package_repo.go

+ 0
- 25
internal/business/domain/user/repo/im_package_dao.go Wyświetl plik

@@ -1,25 +0,0 @@
package repo

import (
"egg_im/internal/business/domain/user/model"
"egg_im/pkg/db"
"egg_im/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
}

+ 0
- 18
internal/business/domain/user/repo/im_package_repo.go Wyświetl plik

@@ -1,18 +0,0 @@
package repo

import (
"egg_im/internal/business/domain/user/model"
)

type imPackageRepo struct{}

var ImPackageRepo = new(imPackageRepo)

// Get 获取单个套餐包
func (*imPackageRepo) Get(id int64) (*model.ImPackage, error) {
imPackage, err := ImPackageDao.Get(id)
if err != nil {
return nil, err
}
return imPackage, err
}

Ładowanie…
Anuluj
Zapisz