parent
faded4e634
commit
e18ec70269
@ -0,0 +1,18 @@ |
|||||||
|
package repositories |
||||||
|
|
||||||
|
import ( |
||||||
|
"gorm.io/gorm" |
||||||
|
"sorbet/internal/entities" |
||||||
|
"sorbet/pkg/db" |
||||||
|
) |
||||||
|
|
||||||
|
type CompanyEmployeeRepository struct { |
||||||
|
*db.Repository[entities.CompanyEmployee] |
||||||
|
} |
||||||
|
|
||||||
|
// NewCompanyEmployeeRepository 创建公司员工仓库
|
||||||
|
func NewCompanyEmployeeRepository(orm *gorm.DB) *CompanyEmployeeRepository { |
||||||
|
return &CompanyEmployeeRepository{ |
||||||
|
db.NewRepositoryWith[entities.CompanyEmployee](orm, "id"), |
||||||
|
} |
||||||
|
} |
@ -1,18 +0,0 @@ |
|||||||
package repositories |
|
||||||
|
|
||||||
import ( |
|
||||||
"gorm.io/gorm" |
|
||||||
"sorbet/internal/entities" |
|
||||||
"sorbet/pkg/db" |
|
||||||
) |
|
||||||
|
|
||||||
type CompanyStaffRepository struct { |
|
||||||
*db.Repository[entities.CompanyStaff] |
|
||||||
} |
|
||||||
|
|
||||||
// NewCompanyStaffRepository 创建公司员工仓库
|
|
||||||
func NewCompanyStaffRepository(orm *gorm.DB) *CompanyStaffRepository { |
|
||||||
return &CompanyStaffRepository{ |
|
||||||
db.NewRepositoryWith[entities.CompanyStaff](orm, "id"), |
|
||||||
} |
|
||||||
} |
|
@ -0,0 +1,16 @@ |
|||||||
|
package controller |
||||||
|
|
||||||
|
import ( |
||||||
|
"github.com/labstack/echo/v4" |
||||||
|
"sorbet/internal/entities" |
||||||
|
"sorbet/internal/services/company/request" |
||||||
|
"sorbet/pkg/crud" |
||||||
|
) |
||||||
|
|
||||||
|
type CompanyEmployeeController struct { |
||||||
|
crud.Controller[entities.CompanyEmployee, request.CompanyEmployeeUpsertRequest] |
||||||
|
} |
||||||
|
|
||||||
|
func (c *CompanyEmployeeController) InitRoutes(r *echo.Group) { |
||||||
|
c.RegisterRoutes("/company/employees", r) |
||||||
|
} |
@ -1,16 +0,0 @@ |
|||||||
package controller |
|
||||||
|
|
||||||
import ( |
|
||||||
"github.com/labstack/echo/v4" |
|
||||||
"sorbet/internal/entities" |
|
||||||
"sorbet/internal/services/company/request" |
|
||||||
"sorbet/pkg/crud" |
|
||||||
) |
|
||||||
|
|
||||||
type CompanyStaffController struct { |
|
||||||
crud.Controller[entities.CompanyStaff, request.CompanyStaffUpsertRequest] |
|
||||||
} |
|
||||||
|
|
||||||
func (c *CompanyStaffController) InitRoutes(r *echo.Group) { |
|
||||||
c.RegisterRoutes("/company/staffs", r) |
|
||||||
} |
|
Loading…
Reference in new issue