|
@@ -6,6 +6,8 @@ import lombok.RequiredArgsConstructor;
|
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
|
import jakarta.validation.constraints.*;
|
|
import jakarta.validation.constraints.*;
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
|
|
+import org.dromara.backstage.aop.annotation.SyncDataToLocal;
|
|
|
|
|
+import org.dromara.common.message.kafka.constant.MessageEventTypeConstants;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
|
@@ -81,6 +83,7 @@ public class PtMealtypeController extends BaseController {
|
|
|
@SaCheckPermission("basicParameter:ptMealtype:add")
|
|
@SaCheckPermission("basicParameter:ptMealtype:add")
|
|
|
@Log(title = "营业时段", businessType = BusinessType.INSERT)
|
|
@Log(title = "营业时段", businessType = BusinessType.INSERT)
|
|
|
@RepeatSubmit()
|
|
@RepeatSubmit()
|
|
|
|
|
+ @SyncDataToLocal(eventType = MessageEventTypeConstants.ptMealtype_ADD)
|
|
|
@PostMapping()
|
|
@PostMapping()
|
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody PtMealTypeBo bo) {
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody PtMealTypeBo bo) {
|
|
|
return toAjax(ptMealtypeService.insertByBo(bo));
|
|
return toAjax(ptMealtypeService.insertByBo(bo));
|
|
@@ -92,6 +95,7 @@ public class PtMealtypeController extends BaseController {
|
|
|
@SaCheckPermission("basicParameter:ptMealtype:edit")
|
|
@SaCheckPermission("basicParameter:ptMealtype:edit")
|
|
|
@Log(title = "营业时段", businessType = BusinessType.UPDATE)
|
|
@Log(title = "营业时段", businessType = BusinessType.UPDATE)
|
|
|
@RepeatSubmit()
|
|
@RepeatSubmit()
|
|
|
|
|
+ @SyncDataToLocal(eventType = MessageEventTypeConstants.ptMealtype_EDIT)
|
|
|
@PutMapping()
|
|
@PutMapping()
|
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody PtMealTypeBo bo) {
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody PtMealTypeBo bo) {
|
|
|
return toAjax(ptMealtypeService.updateByBo(bo));
|
|
return toAjax(ptMealtypeService.updateByBo(bo));
|
|
@@ -105,6 +109,7 @@ public class PtMealtypeController extends BaseController {
|
|
|
@SaCheckPermission("basicParameter:ptMealtype:remove")
|
|
@SaCheckPermission("basicParameter:ptMealtype:remove")
|
|
|
@Log(title = "营业时段", businessType = BusinessType.DELETE)
|
|
@Log(title = "营业时段", businessType = BusinessType.DELETE)
|
|
|
@DeleteMapping("/{mealIds}")
|
|
@DeleteMapping("/{mealIds}")
|
|
|
|
|
+ @SyncDataToLocal(eventType = MessageEventTypeConstants.ptMealtype_REMOVE)
|
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
|
@PathVariable Long[] mealIds) {
|
|
@PathVariable Long[] mealIds) {
|
|
|
return toAjax(ptMealtypeService.deleteWithValidByIds(List.of(mealIds), true));
|
|
return toAjax(ptMealtypeService.deleteWithValidByIds(List.of(mealIds), true));
|