瀏覽代碼

新增以旧换新申请接口

shenjingwei 7 月之前
父節點
當前提交
63bacdfec1
共有 1 個文件被更改,包括 41 次插入0 次删除
  1. 41 0
      src/custom/common/md/md.java

+ 41 - 0
src/custom/common/md/md.java

@@ -0,0 +1,41 @@
+package common.md;
+
+import com.alibaba.fastjson.JSONObject;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import utility.sms.Sms;
+
+@Controller
+@RequestMapping("/rest/md")
+public class md {
+
+    @RequestMapping("/yjhx")
+    @GetMapping
+    @ResponseBody
+    public Object yjhx(@RequestParam("phonenumber") String phonenumber, @RequestParam(value = "formdata") String formdata) {
+        String content = "尊敬的用户,您提交的以旧换新补贴申请美大总部已审核通过!友情提醒:该补贴金额仅限扫码门店使用,且产品安装地址与申请地址须保持一致。详情咨询当地美大门店。期待为您提供优质服务!";
+        JSONObject resultObject = new JSONObject();
+        try {
+            new Thread(() -> {
+                try {
+                    Thread.sleep(60 * 1000L);
+                    new Sms().sendout(Sms.SmsType.Notice, "MD", phonenumber, "浙江美大", content);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }).start();
+
+            resultObject.put("msg", "成功");
+            resultObject.put("status", 1);
+            return resultObject;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        resultObject.put("msg", "失败");
+        resultObject.put("status", 0);
+        return resultObject;
+    }
+}