|
@@ -1,23 +1,25 @@
|
|
|
package cn.efunbox.audio.controller;
|
|
|
|
|
|
+import cn.efunbox.audio.clients.UserFeign;
|
|
|
+import cn.efunbox.audio.clients.UserHttp;
|
|
|
import cn.efunbox.audio.entity.Channel;
|
|
|
import cn.efunbox.audio.entity.Device;
|
|
|
import cn.efunbox.audio.entity.Grouping;
|
|
|
import cn.efunbox.audio.service.ChannelService;
|
|
|
import cn.efunbox.audio.service.DeviceService;
|
|
|
import cn.efunbox.audio.utils.ApiCode;
|
|
|
+import cn.efunbox.audio.utils.ApiResult;
|
|
|
import cn.efunbox.audio.utils.Common;
|
|
|
import cn.efunbox.audio.utils.HttpUtil;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* Created by yao on 17-9-26.
|
|
@@ -33,6 +35,61 @@ public class DeviceController {
|
|
|
@Autowired
|
|
|
ChannelService channelService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ UserFeign userFeign;
|
|
|
+ @Autowired
|
|
|
+ UserHttp userHttp;
|
|
|
+
|
|
|
+ @Value("${iaas.user.register}")
|
|
|
+ private String urlRegister;
|
|
|
+ @Value("${iaas.user.audio.bizCode}")
|
|
|
+ private String bizCode;
|
|
|
+ @Value("${iaas.user.audio.appCode}")
|
|
|
+ private String appCode;
|
|
|
+ @Value("${iaas.user.audio.platform}")
|
|
|
+ private String platform;
|
|
|
+ @Value("${iaas.user.audio.os}")
|
|
|
+ private String os;
|
|
|
+ @Value("${iaas.user.audio.appVer}")
|
|
|
+ private String appVer;
|
|
|
+ @Value("${iaas.user.audio.terminal}")
|
|
|
+ private String terminal;
|
|
|
+ @Value("${iaas.user.audio.entryType}")
|
|
|
+ private String entryType;
|
|
|
+
|
|
|
+ @RequestMapping(value = "/feign")
|
|
|
+ public void Feigh(HttpServletRequest request, HttpServletResponse response,
|
|
|
+ @RequestParam("idChannel")String idChannel, @RequestParam("mobile")String mobile){
|
|
|
+ String ip = HttpUtil.getRemortIP(request);
|
|
|
+ System.out.println("start:"+ip);
|
|
|
+ String res = userHttp.Register(UUID.randomUUID().toString().substring(0, 31),
|
|
|
+ idChannel, ip, mobile, mobile);
|
|
|
+// String res = userFeign.Register(
|
|
|
+//// "application/json",
|
|
|
+// bizCode,
|
|
|
+//// UUID.randomUUID().toString().substring(0, 31),
|
|
|
+// "8723-4327-64238-asdkja",
|
|
|
+// appCode,
|
|
|
+// platform,
|
|
|
+// os,
|
|
|
+// "1111",
|
|
|
+// "123.126.111.3",
|
|
|
+// appVer,
|
|
|
+// terminal,
|
|
|
+// mobile,
|
|
|
+// entryType,
|
|
|
+// "123456",
|
|
|
+// "",
|
|
|
+// ""
|
|
|
+// );
|
|
|
+// System.out.println(res);
|
|
|
+// Map map = JSONObject.parseObject(res);
|
|
|
+// HttpUtil.responseOkData(request, response, map);
|
|
|
+// System.out.println("res:"+res);
|
|
|
+// String res = userFeign.getUser("c26ceb09-4e85-40ba-a81d-1535d142cc43");
|
|
|
+// System.out.println(res);
|
|
|
+ }
|
|
|
+
|
|
|
@RequestMapping(value = "/token" ,method = RequestMethod.POST)
|
|
|
public Map Login(@RequestParam long id, @RequestParam String token){
|
|
|
Map map = new HashMap<>();
|