|
@@ -5,6 +5,7 @@ import com.malk.taisen.dto.ArNotifyRequest;
|
|
|
import com.malk.taisen.dto.ArNotifyResponse;
|
|
import com.malk.taisen.dto.ArNotifyResponse;
|
|
|
import com.malk.taisen.service.ArNotifyService;
|
|
import com.malk.taisen.service.ArNotifyService;
|
|
|
import com.malk.utils.UtilList;
|
|
import com.malk.utils.UtilList;
|
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@@ -14,6 +15,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
/**
|
|
/**
|
|
|
* AR automatic posting notification API for SAP middleware.
|
|
* AR automatic posting notification API for SAP middleware.
|
|
|
*/
|
|
*/
|
|
|
|
|
+@Slf4j
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping("/ar-notify")
|
|
@RequestMapping("/ar-notify")
|
|
|
public class ArNotifyController {
|
|
public class ArNotifyController {
|
|
@@ -29,12 +31,13 @@ public class ArNotifyController {
|
|
|
*/
|
|
*/
|
|
|
@PostMapping
|
|
@PostMapping
|
|
|
public ArNotifyResponse notify(@RequestBody ArNotifyRequest request) {
|
|
public ArNotifyResponse notify(@RequestBody ArNotifyRequest request) {
|
|
|
|
|
+ log.info("ar-notify: {}", request);
|
|
|
if (request == null || UtilList.isEmpty(request.getItems())) {
|
|
if (request == null || UtilList.isEmpty(request.getItems())) {
|
|
|
return ArNotifyResponse.error("ITEM不能为空");
|
|
return ArNotifyResponse.error("ITEM不能为空");
|
|
|
}
|
|
}
|
|
|
- if (request.getItems().size() > 100) {
|
|
|
|
|
- return ArNotifyResponse.error("ITEM单次最多100条");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// if (request.getItems().size() > 100) {
|
|
|
|
|
+// return ArNotifyResponse.error("ITEM单次最多100条");
|
|
|
|
|
+// }
|
|
|
return arNotifyService.notify(request.getItems()) ? ArNotifyResponse.success()
|
|
return arNotifyService.notify(request.getItems()) ? ArNotifyResponse.success()
|
|
|
: ArNotifyResponse.error("通知失败");
|
|
: ArNotifyResponse.error("通知失败");
|
|
|
}
|
|
}
|