1
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package cn.van.business.controller.jd;
|
||||
|
||||
import cn.van.business.mq.MessageProducerService;
|
||||
import cn.van.business.util.JDUtils;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@@ -20,8 +22,10 @@ public class OrderController {
|
||||
public static String TOKEN = "cc0313";
|
||||
@Resource
|
||||
private JDUtils jdUtils;
|
||||
@Resource
|
||||
private MessageProducerService messageProducerService;
|
||||
|
||||
public boolean checkToken (String token){
|
||||
public boolean checkToken(String token) {
|
||||
return TOKEN.equals(token);
|
||||
}
|
||||
|
||||
@@ -29,11 +33,17 @@ public class OrderController {
|
||||
@ResponseBody
|
||||
public String refreshHistory(String token) throws Exception {
|
||||
if (checkToken(token)) {
|
||||
|
||||
jdUtils.fetchHistoricalOrders();
|
||||
|
||||
}
|
||||
return "OK";
|
||||
}
|
||||
|
||||
@RequestMapping("/mq")
|
||||
@ResponseBody
|
||||
public String mq() {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
messageProducerService.sendMessage(jsonObject);
|
||||
return "OK";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user