|
@@ -3,7 +3,7 @@ package com.fs.company.controller;
|
|
|
import java.util.List;
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
-import com.baomidou.mybatisplus.extension.api.R;
|
|
|
+import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.core.domain.model.LoginUser;
|
|
|
import com.fs.common.exception.ServiceException;
|
|
|
import com.fs.common.utils.ServletUtils;
|
|
@@ -127,10 +127,10 @@ public class CompanyDomainController extends BaseController {
|
|
|
@PostMapping("/domainBatchBinding")
|
|
|
public R domainBatchBinding(@RequestBody CompanyDomainParam param) {
|
|
|
if (ObjectUtil.isEmpty(param.getDomainIds()) || param.getDomainIds().isEmpty()) {
|
|
|
- return R.failed("绑定失败,至少有一条绑定域名信息!");
|
|
|
+ return R.error("绑定失败,至少有一条绑定域名信息!");
|
|
|
}
|
|
|
if (ObjectUtil.isEmpty(param.getCompanyIds()) || param.getCompanyIds().isEmpty()) {
|
|
|
- return R.failed("绑定失败,至少有一条绑定公司信息!");
|
|
|
+ return R.error("绑定失败,至少有一条绑定公司信息!");
|
|
|
}
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
param.setUserId(loginUser.getUser().getUserId().toString());
|
|
@@ -151,18 +151,18 @@ public class CompanyDomainController extends BaseController {
|
|
|
public R importDomainData(MultipartFile file) {
|
|
|
// 1. 检查文件是否为空
|
|
|
if (file.isEmpty()) {
|
|
|
- return R.failed("上传的文件不能为空");
|
|
|
+ return R.error("上传的文件不能为空");
|
|
|
}
|
|
|
|
|
|
// 2. 检查文件大小
|
|
|
if (file.getSize() > MAX_FILE_SIZE) {
|
|
|
- return R.failed("文件大小不能超过5MB");
|
|
|
+ return R.error("文件大小不能超过5MB");
|
|
|
}
|
|
|
|
|
|
// 3. 检查文件扩展名
|
|
|
String fileName = file.getOriginalFilename();
|
|
|
if (fileName == null || !isValidExcelFile(fileName)) {
|
|
|
- return R.failed("请上传Excel文件(.xlsx或.xls格式)");
|
|
|
+ return R.error("请上传Excel文件(.xlsx或.xls格式)");
|
|
|
}
|
|
|
CompanyDomainParam param = new CompanyDomainParam();
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
@@ -173,7 +173,7 @@ public class CompanyDomainController extends BaseController {
|
|
|
return companyDomainService.importDomainData(param, companyDomainList);
|
|
|
} catch (Exception e) {
|
|
|
e.getStackTrace();
|
|
|
- return R.failed("导入失败!");
|
|
|
+ return R.error("导入失败!");
|
|
|
}
|
|
|
}
|
|
|
|