Commit d92e5b84 authored by huyuchen's avatar huyuchen

失败原因配置

parent 86ed9134
......@@ -60,6 +60,13 @@ public class R<T> implements Serializable {
this.msg = e.getMessage();
this.code = CommonConstants.FAIL;
}
public R( String msg ,int code) {
super();
this.msg = msg;
this.code = code;
}
public static <T> R<T> ok() {
return restResult(null, CommonConstants.SUCCESS, null);
}
......
......@@ -504,7 +504,7 @@ public class UserController {
*/
@SysLog("从ldap实时更新用户和部门")
@PostMapping("/updateUserAndDept")
public R updateUserAndDept(HttpServletRequest request,@RequestBody JSONObject json) {
return R.ok(userService.updateUserAndDept(request,json));
public R<String> updateUserAndDept(HttpServletRequest request,@RequestBody JSONObject json) {
return userService.updateUserAndDept(request,json);
}
}
......@@ -184,5 +184,5 @@ public interface SysUserService extends IService<SysUser> {
* 从ldap实时更新用户和部门
* @return R
*/
R updateUserAndDept(HttpServletRequest request, JSONObject json);
R<String> updateUserAndDept(HttpServletRequest request, JSONObject json);
}
......@@ -739,18 +739,18 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
* @return R
*/
@Override
public R updateUserAndDept(HttpServletRequest request,JSONObject json) {
public R<String> updateUserAndDept(HttpServletRequest request,JSONObject json) {
//权限验证
String appId = request.getHeader("HRBS-APP-ID");
String appSecret = request.getHeader("HRBS-APP-SECRET");
if(Common.isEmpty(appId) || Common.isEmpty(appSecret)){
return R.failed("操作失败,权限标识错误!");
return new R<>("操作失败,权限标识错误!", 500);
}
if(!hcmId.equals(appId) || !hcmSecret.equals(appSecret) ){
return R.failed("操作失败,无权限!");
return new R<>("操作失败,无权限!", 500);
}
if(Common.isEmpty(json)) {
return R.failed("传参不能为空");
return new R<>("传参不能为空", 500);
}
boolean isAll = (boolean) json.get("isAll");
String dataType = json.get("dataType").toString();
......@@ -767,7 +767,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
//更新或者新增部门信息
updateOrSaveDept(updateParamsArr);
}
return R.ok();
return new R<>("同步成功!", 200);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment