增加参数日志
This commit is contained in:
parent
21408a02d8
commit
8beb64e310
|
|
@ -8,10 +8,16 @@ import com.chinaweal.aiccs.org.service.IImsUserService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.slf4j.Logger;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.servlet.ServletInputStream;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IMS统一身份管理系统数据同步接口
|
* IMS统一身份管理系统数据同步接口
|
||||||
|
|
@ -41,8 +47,15 @@ public class ImsSyncController {
|
||||||
*/
|
*/
|
||||||
@PostMapping("/org/orgSynchronous")
|
@PostMapping("/org/orgSynchronous")
|
||||||
@ApiOperation(value = "机构同步接口", notes = "接收IMS推送的机构数据,支持新增、修改、删除操作")
|
@ApiOperation(value = "机构同步接口", notes = "接收IMS推送的机构数据,支持新增、修改、删除操作")
|
||||||
public ImsResultVO orgSynchronous(@RequestBody ImsOrgDTO dto) {
|
public ImsResultVO orgSynchronous(@RequestBody ImsOrgDTO dto, HttpServletRequest request) {
|
||||||
log.info("IMS机构同步请求: type={}, orgCode={}", dto.getType(), dto.getCode());
|
log.info("IMS机构同步请求: type={}, orgCode={}", dto.getType(), dto.getCode());
|
||||||
|
try (ServletInputStream inputStream = request.getInputStream();
|
||||||
|
ByteArrayOutputStream os = new ByteArrayOutputStream()) {
|
||||||
|
IOUtils.copy(inputStream, os);
|
||||||
|
log.info("IMS机构同步请求body:{}", os);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("IMS机构同步请求参数读取失败", e);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
boolean result = imsOrgService.syncOrg(dto);
|
boolean result = imsOrgService.syncOrg(dto);
|
||||||
|
|
@ -66,9 +79,17 @@ public class ImsSyncController {
|
||||||
*/
|
*/
|
||||||
@PostMapping("/user/userSynchronous")
|
@PostMapping("/user/userSynchronous")
|
||||||
@ApiOperation(value = "用户同步接口", notes = "接收IMS推送的用户数据,支持新增、修改、删除操作")
|
@ApiOperation(value = "用户同步接口", notes = "接收IMS推送的用户数据,支持新增、修改、删除操作")
|
||||||
public ImsResultVO userSynchronous(@RequestBody ImsUserDTO dto) {
|
public ImsResultVO userSynchronous(@RequestBody ImsUserDTO dto, HttpServletRequest request) {
|
||||||
log.info("IMS用户同步请求: type={}, userCode={}", dto.getType(), dto.getUsercode());
|
log.info("IMS用户同步请求: type={}, userCode={}", dto.getType(), dto.getUsercode());
|
||||||
|
|
||||||
|
try (ServletInputStream inputStream = request.getInputStream();
|
||||||
|
ByteArrayOutputStream os = new ByteArrayOutputStream()) {
|
||||||
|
IOUtils.copy(inputStream, os);
|
||||||
|
log.info("IMS用户同步请求body:{}", os);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("IMS用户同步请求参数读取失败", e);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
boolean result = imsUserService.syncUser(dto);
|
boolean result = imsUserService.syncUser(dto);
|
||||||
if (result) {
|
if (result) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue