|
@@ -1,10 +1,15 @@
|
|
package com.care.outcall.controller;
|
|
package com.care.outcall.controller;
|
|
|
|
|
|
|
|
|
|
-import com.care.outcall.entity.KoalaLoggerEntity;
|
|
|
|
-import com.care.outcall.service.KoalaOutCallService;
|
|
|
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
import com.care.common.util.JsonUtil;
|
|
import com.care.common.util.JsonUtil;
|
|
|
|
+import com.care.common.util.JwtUtils;
|
|
import com.care.common.util.Result;
|
|
import com.care.common.util.Result;
|
|
|
|
+import com.care.common.vo.UserLogindConvertVO;
|
|
|
|
+import com.care.outcall.entity.KoalaLoggerEntity;
|
|
|
|
+import com.care.outcall.service.KoalaOutCallService;
|
|
|
|
+
|
|
|
|
+import io.jsonwebtoken.Claims;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
@@ -22,12 +27,37 @@ import java.util.Map;
|
|
**/
|
|
**/
|
|
@Api(value = "外呼操作-->考拉外呼日志记录", description = "外呼操作-->考拉外呼日志记录")
|
|
@Api(value = "外呼操作-->考拉外呼日志记录", description = "外呼操作-->考拉外呼日志记录")
|
|
@RestController
|
|
@RestController
|
|
-@RequestMapping("/mcdcc/outcall/")
|
|
|
|
|
|
+@RequestMapping("/bms/outcall/")
|
|
public class KoalaOutCallController {
|
|
public class KoalaOutCallController {
|
|
private static final Logger logger = LogManager.getLogger(KoalaOutCallController.class);
|
|
private static final Logger logger = LogManager.getLogger(KoalaOutCallController.class);
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private KoalaOutCallService koalaOutCallService;
|
|
private KoalaOutCallService koalaOutCallService;
|
|
|
|
+ @Autowired
|
|
|
|
+ JwtUtils jwtUtils;
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "考拉外呼--手动外呼--坐席基础信息接口", notes = "考拉外呼--手动外呼--坐席基础信息接口")
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "token", value = "放在请求头中的令牌", dataType = "String", paramType = "header", required = true)
|
|
|
|
+ })
|
|
|
|
+ @GetMapping(value = "/koala/getAgentInfo")
|
|
|
|
+ public Result getAgentInfo(@RequestHeader(name = "token") String token) {
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ Claims claims = jwtUtils.tokenParse(token);
|
|
|
|
+ if (claims != null) {
|
|
|
|
+ UserLogindConvertVO vo = JSONUtil.toBean(claims.getSubject(), UserLogindConvertVO.class);
|
|
|
|
+ String userId = vo.getId().toString();
|
|
|
|
+ Map<String, String> map = this.koalaOutCallService.getAgentInfo(userId);
|
|
|
|
+ return Result.success(map);
|
|
|
|
+ } else {
|
|
|
|
+ return Result.error("获取坐席基础信息异常");
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ logger.error("获取坐席基础信息异常,信息为:" + e.getMessage());
|
|
|
|
+ return Result.error(e.getMessage());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
@ApiOperation(value = "记录呼叫中心日志API", notes = "记录呼叫中心日志")
|
|
@ApiOperation(value = "记录呼叫中心日志API", notes = "记录呼叫中心日志")
|
|
@PostMapping(value = "/koala/addOptLog", produces = "application/json;charset=UTF-8", consumes = "application/json;charset=UTF-8")
|
|
@PostMapping(value = "/koala/addOptLog", produces = "application/json;charset=UTF-8", consumes = "application/json;charset=UTF-8")
|
|
@@ -43,22 +73,5 @@ public class KoalaOutCallController {
|
|
return Result.success();
|
|
return Result.success();
|
|
}
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "考拉外呼--手动外呼--坐席基础信息接口", notes = "考拉外呼--手动外呼--坐席基础信息接口")
|
|
|
|
- @ApiImplicitParams({
|
|
|
|
- @ApiImplicitParam(name = "token", value = "放在请求头中的令牌", dataType = "String", paramType = "header", required = true)
|
|
|
|
- })
|
|
|
|
- @GetMapping(value = "/koala/getAgentInfo")
|
|
|
|
- public Result getAgentInfo(@RequestHeader(name = "token") String token) {
|
|
|
|
|
|
|
|
- try {
|
|
|
|
-// Token tokenObj = TokenUtil.parseTokenStr(token);
|
|
|
|
-// String userId = token.getPayload().getId();
|
|
|
|
- String userId = "";
|
|
|
|
- Map<String, String> map = this.koalaOutCallService.getAgentInfo(userId);
|
|
|
|
- return Result.success();
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- logger.error("获取坐席基础信息异常,信息为:" + e.getMessage());
|
|
|
|
- return Result.error(e.getMessage());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
}
|
|
}
|