mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-14 05:10:24 +08:00
feat: 前端升级至vue3,后端代码结构重构,新增权限管理相关功能
This commit is contained in:
39
server/devops/infrastructure/persistence/machine_repo.go
Normal file
39
server/devops/infrastructure/persistence/machine_repo.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package persistence
|
||||
|
||||
import (
|
||||
"mayfly-go/base/model"
|
||||
"mayfly-go/server/devops/domain/entity"
|
||||
"mayfly-go/server/devops/domain/repository"
|
||||
)
|
||||
|
||||
type machineRepo struct{}
|
||||
|
||||
var MachineDao repository.Machine = &machineRepo{}
|
||||
|
||||
// 分页获取机器信息列表
|
||||
func (m *machineRepo) GetMachineList(condition *entity.Machine, pageParam *model.PageParam, toEntity interface{}, orderBy ...string) model.PageResult {
|
||||
return model.GetPage(pageParam, condition, toEntity, orderBy...)
|
||||
}
|
||||
|
||||
// 根据条件获取账号信息
|
||||
func (m *machineRepo) GetMachine(condition *entity.Machine, cols ...string) error {
|
||||
return model.GetBy(condition, cols...)
|
||||
}
|
||||
|
||||
// 根据id获取
|
||||
func (m *machineRepo) GetById(id uint64, cols ...string) *entity.Machine {
|
||||
machine := new(entity.Machine)
|
||||
if err := model.GetById(machine, id, cols...); err != nil {
|
||||
return nil
|
||||
|
||||
}
|
||||
return machine
|
||||
}
|
||||
|
||||
func (m *machineRepo) Create(entity *entity.Machine) {
|
||||
model.Insert(entity)
|
||||
}
|
||||
|
||||
func (m *machineRepo) UpdateById(entity *entity.Machine) {
|
||||
model.UpdateById(entity)
|
||||
}
|
||||
Reference in New Issue
Block a user