|
@@ -1,5 +1,6 @@
|
|
|
package com.adi.airopt.controller;
|
|
|
|
|
|
+import com.adi.airopt.vo.AiroptUser;
|
|
|
import com.adi.common.core.controller.BaseController;
|
|
|
import com.adi.common.core.domain.AjaxResult;
|
|
|
import com.adi.common.core.page.PageDomain;
|
|
@@ -11,10 +12,8 @@ import com.alibaba.fastjson2.JSONObject;
|
|
|
import org.apache.http.HttpResponse;
|
|
|
import org.apache.http.util.EntityUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.util.*;
|
|
@@ -141,6 +140,40 @@ public class UserController extends BaseController {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 用户信息修改
|
|
|
+ */
|
|
|
+ @RequestMapping("update")
|
|
|
+ public AjaxResult update(@Validated @RequestBody AiroptUser user) throws IOException
|
|
|
+ {
|
|
|
+ String host =airConfig.getUrl();
|
|
|
+ Map<String, String> bodys =new HashMap<>();
|
|
|
+ bodys.put("channelNo",airConfig.getChannelNo());
|
|
|
+ bodys.put("clientToken",airConfig.getClientToken());
|
|
|
+ bodys.put("transCode","B00033");
|
|
|
+ bodys.put("userId",airConfig.getUserId());
|
|
|
+ bodys.put("uid",user.getUid());
|
|
|
+ bodys.put("nickName",user.getNickName());
|
|
|
+ bodys.put("username",user.getUsername());
|
|
|
+ bodys.put("mobileNo",user.getMobileNo());
|
|
|
+ bodys.put("headProfile",user.getHeadProfile());
|
|
|
+ bodys.put("company",user.getCompany());
|
|
|
+ bodys.put("email",user.getEmail());
|
|
|
+ try {
|
|
|
+ HttpResponse response= HttpUtils.doPost(host,bodys);
|
|
|
+ int stat = response.getStatusLine().getStatusCode();
|
|
|
+ if (stat != 200) {
|
|
|
+ return AjaxResult.error("业务服务链接失败");
|
|
|
+ }
|
|
|
+ String res = EntityUtils.toString(response.getEntity());
|
|
|
+ JSONObject res_obj = JSONObject.parseObject(res);
|
|
|
+ return AjaxResult.success(res_obj);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ return AjaxResult.error("业务服务链接失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|