|
|
@@ -6,6 +6,7 @@ import lombok.RequiredArgsConstructor;
|
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
|
import jakarta.validation.constraints.*;
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
+import org.dromara.common.message.kafka.aop.annotation.SyncDataToLocal;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
|
|
@@ -22,6 +23,8 @@ import org.dromara.backstage.consumption.domain.bo.XfLimitedBo;
|
|
|
import org.dromara.backstage.consumption.service.IXfLimitedService;
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
|
|
|
+import static org.dromara.common.message.kafka.constant.MessageEventTypeConstants.*;
|
|
|
+
|
|
|
/**
|
|
|
* 限次管理
|
|
|
* 前端访问路由地址为:/consumption/xfLimited
|
|
|
@@ -75,6 +78,7 @@ public class XfLimitedController extends BaseController {
|
|
|
@SaCheckPermission("consumption:xfLimited:add")
|
|
|
@Log(title = "限次管理", businessType = BusinessType.INSERT)
|
|
|
@RepeatSubmit()
|
|
|
+ @SyncDataToLocal(eventType = xfLimited_ADD, sender = XF_LIMITED_SENDER)
|
|
|
@PostMapping()
|
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody XfLimitedBo bo) {
|
|
|
return toAjax(xfLimitedService.insertByBo(bo));
|
|
|
@@ -86,6 +90,7 @@ public class XfLimitedController extends BaseController {
|
|
|
@SaCheckPermission("consumption:xfLimited:edit")
|
|
|
@Log(title = "限次管理", businessType = BusinessType.UPDATE)
|
|
|
@RepeatSubmit()
|
|
|
+ @SyncDataToLocal(eventType = xfLimited_EDIT, sender = XF_LIMITED_SENDER)
|
|
|
@PutMapping()
|
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody XfLimitedBo bo) {
|
|
|
return toAjax(xfLimitedService.updateByBo(bo));
|
|
|
@@ -98,6 +103,7 @@ public class XfLimitedController extends BaseController {
|
|
|
*/
|
|
|
@SaCheckPermission("consumption:xfLimited:remove")
|
|
|
@Log(title = "限次管理", businessType = BusinessType.DELETE)
|
|
|
+ @SyncDataToLocal(eventType = xfLimited_REMOVE, sender = XF_LIMITED_SENDER)
|
|
|
@DeleteMapping("/{limitedIds}")
|
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
|
@PathVariable Long[] limitedIds) {
|