|
|
package repository
|
|
|
|
|
|
import (
|
|
|
"errors"
|
|
|
|
|
|
pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
|
|
|
)
|
|
|
|
|
|
type CompanyRepository struct {
|
|
|
transactionContext *pgTransaction.TransactionContext
|
|
|
}
|
|
|
|
|
|
var _ domain.CompanyRepository = (*CompanyRepository)(nil)
|
|
|
|
|
|
func (repo *CompanyRepository) Save(user *domain.Company) (*domain.Company, error) {
|
|
|
return user, nil
|
|
|
}
|
|
|
|
|
|
func (repo *CompanyRepository) Remove(user *domain.Company) (*domain.Company, error) {
|
|
|
// tx := repository.transactionContext.PgTx
|
|
|
// userModel := new(models.Company)
|
|
|
// userModel.UserId = user.Identify().(int64)
|
|
|
// if _, err := tx.Model(userModel).WherePK().Delete(); err != nil {
|
|
|
// return user, err
|
|
|
// }
|
|
|
return user, errors.New("no support")
|
|
|
}
|
|
|
|
|
|
func (repo *CompanyRepository) FindOne(queryOptions map[string]interface{}) (*domain.Company, error) {
|
|
|
return nil, nil
|
|
|
}
|
|
|
|
|
|
func (repo *CompanyRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.Company, error) {
|
|
|
return 0, nil, nil
|
|
|
} |
...
|
...
|
|