|
@@ -6,6 +6,7 @@ import java.util.List;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
|
|
|
|
|
|
|
|
+import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.exception.CustomException;
|
|
import com.fs.common.exception.CustomException;
|
|
|
import com.fs.common.utils.ServletUtils;
|
|
import com.fs.common.utils.ServletUtils;
|
|
|
import com.fs.common.utils.StringUtils;
|
|
import com.fs.common.utils.StringUtils;
|
|
@@ -225,7 +226,7 @@ public class QwAcquisitionLinkInfoController extends BaseController
|
|
|
* @return 生成的文本内容
|
|
* @return 生成的文本内容
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/extractLinkNol")
|
|
@PostMapping("/extractLinkNol")
|
|
|
- public AjaxResult extractLinkNol(@RequestBody Map<String, Object> params) {
|
|
|
|
|
|
|
+ public R extractLinkNol(@RequestBody Map<String, Object> params) {
|
|
|
try {
|
|
try {
|
|
|
// 参数校验
|
|
// 参数校验
|
|
|
Long qwAcquisitionAssistantId = null;
|
|
Long qwAcquisitionAssistantId = null;
|
|
@@ -241,10 +242,10 @@ public class QwAcquisitionLinkInfoController extends BaseController
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (qwAcquisitionAssistantId == null) {
|
|
if (qwAcquisitionAssistantId == null) {
|
|
|
- return AjaxResult.error("获客链接ID不能为空");
|
|
|
|
|
|
|
+ return R.error("获客链接ID不能为空");
|
|
|
}
|
|
}
|
|
|
if (StringUtils.isEmpty(url)) {
|
|
if (StringUtils.isEmpty(url)) {
|
|
|
- return AjaxResult.error("获客链接URL不能为空");
|
|
|
|
|
|
|
+ return R.error("获客链接URL不能为空");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 获取当前登录用户信息
|
|
// 获取当前登录用户信息
|
|
@@ -252,17 +253,16 @@ public class QwAcquisitionLinkInfoController extends BaseController
|
|
|
if (loginUser == null || loginUser.getCompany() == null) {
|
|
if (loginUser == null || loginUser.getCompany() == null) {
|
|
|
throw new CustomException("请登录");
|
|
throw new CustomException("请登录");
|
|
|
}
|
|
}
|
|
|
- // 调用服务层方法生成短链接文本
|
|
|
|
|
- String resultText = qwAcquisitionLinkInfoService.extractLinkNol(qwAcquisitionAssistantId, url,loginUser.getCompany().getCompanyId());
|
|
|
|
|
|
|
|
|
|
- return AjaxResult.success(resultText);
|
|
|
|
|
|
|
+ // 调用服务层方法生成短链接文本
|
|
|
|
|
+ return qwAcquisitionLinkInfoService.extractLinkNol(qwAcquisitionAssistantId, url,loginUser.getCompany().getCompanyId());
|
|
|
|
|
|
|
|
} catch (CustomException e) {
|
|
} catch (CustomException e) {
|
|
|
log.error("提取链接失败: {}", e.getMessage());
|
|
log.error("提取链接失败: {}", e.getMessage());
|
|
|
- return AjaxResult.error(e.getMessage());
|
|
|
|
|
|
|
+ return R.error(e.getMessage());
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("提取链接异常", e);
|
|
log.error("提取链接异常", e);
|
|
|
- return AjaxResult.error("服务器内部错误: " + e.getMessage());
|
|
|
|
|
|
|
+ return R.error("服务器内部错误: " + e.getMessage());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|