mirror of
https://gitee.com/freshday/radar.git
synced 2026-03-22 12:47:16 +08:00
opts: activation can be disable.
feihu wang
This commit is contained in:
@@ -185,4 +185,14 @@ public class ActivationApiController {
|
||||
}
|
||||
ds.addChildren(preItem.getLabel(), preItem.getDestField(), children);
|
||||
}
|
||||
|
||||
@GetMapping("/disable/{activationId}")
|
||||
public CommonResult disable(@PathVariable Long activationId) {
|
||||
return activationService.updateStatus(activationId, 0);
|
||||
}
|
||||
|
||||
@PostMapping("/enable/{activationId}")
|
||||
public CommonResult enable(@PathVariable Long activationId) {
|
||||
return activationService.updateStatus(activationId, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,7 +108,20 @@ public class ActivationServiceImpl extends BaseLocalCacheService implements Acti
|
||||
return result;
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
@Override
|
||||
public CommonResult updateStatus(Long activationId, Integer status) {
|
||||
CommonResult result = new CommonResult();
|
||||
ActivationVO activation = activationDal.get(activationId);
|
||||
if (activation == null) return result;
|
||||
activation = new ActivationVO();
|
||||
activation.setId(activationId);
|
||||
activation.setStatus(status);
|
||||
activationDal.save(activation);
|
||||
result.setSuccess(true);
|
||||
return result;
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
cacheService.subscribeActivation(this);
|
||||
}
|
||||
|
||||
@@ -21,4 +21,14 @@ public interface ActivationService {
|
||||
|
||||
CommonResult updateOrder(Long activationId, String ruleOrder);
|
||||
|
||||
/**
|
||||
* update status of activation.
|
||||
* @param activationId
|
||||
* @param status
|
||||
* @return
|
||||
*
|
||||
* @author feihu.wang
|
||||
*/
|
||||
CommonResult updateStatus(Long activationId, Integer status);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user