|
@@ -10,7 +10,7 @@ type GameShieldBackendRepository interface {
|
|
|
GetGameShieldBackendById(ctx context.Context, id int64) (*model.GameShieldBackend, error)
|
|
|
AddGameShieldBackend(ctx context.Context, req *model.GameShieldBackend) error
|
|
|
EditGameShieldBackend(ctx context.Context, req *v1.GameShieldBackendRequest) error
|
|
|
- DeleteGameShieldBackend(ctx context.Context, id int64) error
|
|
|
+ DeleteGameShieldBackend(ctx context.Context, id int, hostId int) error
|
|
|
GetGameShieldBackendByHostId(ctx context.Context, hostId int) ([]model.GameShieldBackend, error)
|
|
|
GetGameShieldBackendConfigCountByHostId(ctx context.Context, hostId int) (*v1.GameShieldHostBackendConfigResponse, error)
|
|
|
GetGameShieldBackendSourceMachineIpByHostId(ctx context.Context, hostId int) ([]string, error)
|
|
@@ -50,8 +50,8 @@ func (r *gameShieldBackendRepository) EditGameShieldBackend(ctx context.Context,
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
-func (r *gameShieldBackendRepository) DeleteGameShieldBackend(ctx context.Context, id int64) error {
|
|
|
- if err := r.DB(ctx).Delete(&model.GameShieldBackend{}, id).Where("id = ?", id).Error; err != nil {
|
|
|
+func (r *gameShieldBackendRepository) DeleteGameShieldBackend(ctx context.Context, id int, hostId int) error {
|
|
|
+ if err := r.DB(ctx).Where("id = ? AND host_id = ?", id, hostId).Delete(&model.GameShieldBackend{}).Error; err != nil {
|
|
|
return err
|
|
|
}
|
|
|
return nil
|