|
@@ -25,6 +25,8 @@ type GlobalLimitRepository interface {
|
|
|
GetNodeId(ctx context.Context, cndWebId int) (int64, error)
|
|
|
// 获取套餐Id
|
|
|
GetNodeArea(ctx context.Context, nodeAreaName string) (int64, error)
|
|
|
+ // 修改套餐状态
|
|
|
+ EditHostState(ctx context.Context, hostId int64, state int) error
|
|
|
}
|
|
|
|
|
|
func NewGlobalLimitRepository(
|
|
@@ -167,4 +169,11 @@ func (r *globalLimitRepository) GetNodeArea(ctx context.Context, nodeAreaName st
|
|
|
}
|
|
|
return nodeId, nil
|
|
|
|
|
|
+}
|
|
|
+
|
|
|
+func (r *globalLimitRepository) EditHostState(ctx context.Context, hostId int64, state int) error {
|
|
|
+ if err := r.DB(ctx).Where("host_id = ?", hostId).Update("state", state).Error; err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ return nil
|
|
|
}
|