mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-12-08 17:00:26 +08:00
feat: 新增机器与项目关联及相关资源列表查询以项目关联成员为准
This commit is contained in:
@@ -23,7 +23,18 @@ type Machine struct {
|
||||
}
|
||||
|
||||
func (m *Machine) Machines(rc *ctx.ReqCtx) {
|
||||
res := m.MachineApp.GetMachineList(new(entity.Machine), ginx.GetPageParam(rc.GinCtx), new([]*vo.MachineVO))
|
||||
condition := new(entity.Machine)
|
||||
// 使用创建者id模拟账号成员id
|
||||
condition.CreatorId = rc.LoginAccount.Id
|
||||
condition.Ip = rc.GinCtx.Query("ip")
|
||||
condition.ProjectId = uint64(ginx.QueryInt(rc.GinCtx, "projectId", 0))
|
||||
|
||||
res := m.MachineApp.GetMachineList(condition, ginx.GetPageParam(rc.GinCtx), new([]*vo.MachineVO))
|
||||
if res.Total == 0 {
|
||||
rc.ResData = res
|
||||
return
|
||||
}
|
||||
|
||||
list := res.List.(*[]*vo.MachineVO)
|
||||
for _, mv := range *list {
|
||||
mv.HasCli = machine.HasCli(*mv.Id)
|
||||
|
||||
Reference in New Issue
Block a user