department.go
958 字节
package repository
import "opp/models"
type IDepartmentRepository interface {
GetDepartmentById(companyId int) (v *models.Department, err error)
GetDepartmentByCompanyId(companyId int64) (v []*models.Department, err error)
}
var _ IDepartmentRepository = (*DepartmentRepository)(nil)
type DepartmentRepository struct{}
func (r *DepartmentRepository) GetDepartmentById(id int) (v *models.Department, err error) {
return models.GetDepartmentById(id)
}
func (r *DepartmentRepository) GetDepartmentByCompanyId(companyId int64) (v []*models.Department, err error) {
return models.GetDepartmentByCompanyId(companyId)
}
type IUserDepartmentRepository interface {
GetUserDepartment(userId int64, companyId int64, v interface{}) (err error)
}
type UserDepartmentRepository struct{}
func (r *UserDepartmentRepository) GetUserDepartment(userId int64, companyId int64, v interface{}) (err error) {
return models.GetUserDepartments(userId, companyId, v)
}