Commit feccc210 authored by 技术部-任文超's avatar 技术部-任文超

代码格式及log优化

parent 015803cb
package cn.quantgroup.xyqb.controller.external.index;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.util.IPUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
/**
* Created by xuran on 2017/7/12.
*/
@RestController
@Slf4j
@RequestMapping("/hello")
public class HelloController {
@RequestMapping("/hello")
public String hello(){
public String hello(HttpServletRequest request) {
String ip = IPUtil.getRemoteIP(request);
if(ip.startsWith("192.168.12.")){
log.error("测试:", new Exception("Sentry捕获异常"));
}
return "ok";
}
}
......@@ -672,11 +672,11 @@ public class InnerController implements IBaseController {
return null;
}
UserAssociationModel bean = new UserAssociationModel();
bean.setId(user.getId());
bean.setUuid(user.getUuid());
bean.setRegisterFrom(user.getRegisteredFrom());
UserDetail userDetail = userDetailService.findByUserId(user.getId());
if (!Objects.isNull(userDetail)) {
bean.setId(userDetail.getUserId());
bean.setPhoneNo(userDetail.getPhoneNo());
bean.setName(userDetail.getName());
bean.setIdNo(userDetail.getIdNo());
......@@ -687,7 +687,7 @@ public class InnerController implements IBaseController {
if (!Objects.isNull(userBtRegister)) {
bean.setMerchantId(userBtRegister.getRegisterBtMerchantId());
}
UserExtInfo extInfo = userExtInfoService.findByUserId(userDetail.getUserId());
UserExtInfo extInfo = userExtInfoService.findByUserId(user.getId());
if (!Objects.isNull(extInfo)) {
if (null == extInfo.getEducationEnum()) {
bean.setEducationEnum(cn.quantgroup.user.enums.EducationEnum.UNKNOWN.getName());
......@@ -705,11 +705,11 @@ public class InnerController implements IBaseController {
bean.setMarryStatus(extInfo.getMarryStatus().getDescription());
}
}
Address address = addressService.findByUserId(userDetail.getUserId());
Address address = addressService.findByUserId(user.getId());
if (!Objects.isNull(address)) {
bean.putAddressList(Arrays.asList(address));
}
List<Contact> contacts = contactService.findByUserId(userDetail.getUserId(), true);
List<Contact> contacts = contactService.findByUserId(user.getId(), true);
if (!Objects.isNull(address)) {
bean.putContactList(contacts);
}
......@@ -720,7 +720,7 @@ public class InnerController implements IBaseController {
@RequestMapping("/user-association/search/userId")
public JsonResult findUserAssociationModelByUserId(Long userId) {
if (Objects.isNull(userId) || userId < 1) {
return JsonResult.buildErrorStateResult("", "");
return JsonResult.buildErrorStateResult("params invalid", null);
}
UserAssociationModel bean = null;
User user = userService.findById(userId);
......
......@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 查询已登录信息
* Created by Miraculous on 2016/12/30.
*/
@RestController
......
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