|
@@ -3,12 +3,19 @@ package com.java110.api.listener.menu;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.java110.api.listener.AbstractServiceApiListener;
|
|
import com.java110.api.listener.AbstractServiceApiListener;
|
|
|
|
|
+import com.java110.common.constant.ResponseConstant;
|
|
|
|
|
+import com.java110.common.exception.ListenerExecuteException;
|
|
|
import com.java110.common.util.Assert;
|
|
import com.java110.common.util.Assert;
|
|
|
|
|
+import com.java110.common.util.BeanConvertUtil;
|
|
|
import com.java110.core.context.DataFlowContext;
|
|
import com.java110.core.context.DataFlowContext;
|
|
|
|
|
+import com.java110.core.smo.menu.IMenuInnerServiceSMO;
|
|
|
|
|
+import com.java110.dto.menu.MenuDto;
|
|
|
import com.java110.entity.center.AppService;
|
|
import com.java110.entity.center.AppService;
|
|
|
import com.java110.event.service.api.ServiceDataFlowEvent;
|
|
import com.java110.event.service.api.ServiceDataFlowEvent;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
import org.springframework.http.HttpHeaders;
|
|
|
import org.springframework.http.HttpMethod;
|
|
import org.springframework.http.HttpMethod;
|
|
|
|
|
+import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.http.ResponseEntity;
|
|
|
import com.java110.common.constant.CommonConstant;
|
|
import com.java110.common.constant.CommonConstant;
|
|
|
import com.java110.common.constant.ServiceCodeConstant;
|
|
import com.java110.common.constant.ServiceCodeConstant;
|
|
@@ -23,6 +30,9 @@ import com.java110.common.constant.ServiceCodeMenuConstant;
|
|
|
*/
|
|
*/
|
|
|
@Java110Listener("deleteMenuListener")
|
|
@Java110Listener("deleteMenuListener")
|
|
|
public class DeleteMenuListener extends AbstractServiceApiListener {
|
|
public class DeleteMenuListener extends AbstractServiceApiListener {
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IMenuInnerServiceSMO menuInnerServiceSMOImpl;
|
|
|
@Override
|
|
@Override
|
|
|
protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
|
|
protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
|
|
|
//Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
|
|
//Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
|
|
@@ -33,7 +43,18 @@ public class DeleteMenuListener extends AbstractServiceApiListener {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
|
|
protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
|
|
|
|
|
+ MenuDto menuDto = BeanConvertUtil.covertBean(reqJson, MenuDto.class);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ int count = menuInnerServiceSMOImpl.deleteMenu(menuDto);
|
|
|
|
|
+
|
|
|
|
|
+ if (count < 1) {
|
|
|
|
|
+ throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "删除数据失败");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ ResponseEntity<String> responseEntity = new ResponseEntity<String>("", HttpStatus.OK);
|
|
|
|
|
+
|
|
|
|
|
+ context.setResponseEntity(responseEntity);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -52,4 +73,11 @@ public class DeleteMenuListener extends AbstractServiceApiListener {
|
|
|
return DEFAULT_ORDER;
|
|
return DEFAULT_ORDER;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public IMenuInnerServiceSMO getMenuInnerServiceSMOImpl() {
|
|
|
|
|
+ return menuInnerServiceSMOImpl;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setMenuInnerServiceSMOImpl(IMenuInnerServiceSMO menuInnerServiceSMOImpl) {
|
|
|
|
|
+ this.menuInnerServiceSMOImpl = menuInnerServiceSMOImpl;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|