+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.modules.interfacelog.controller;
+
+import com.elink.esua.epdc.commons.tools.page.PageData;
+import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
+import com.elink.esua.epdc.commons.tools.utils.Result;
+import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
+import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
+import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
+import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
+import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
+import com.elink.esua.epdc.dto.interfacelog.InterfaceLogDTO;
+import com.elink.esua.epdc.modules.interfacelog.excel.InterfaceLogExcel;
+import com.elink.esua.epdc.modules.interfacelog.service.InterfaceLogService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 接口日志表 接口日志表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2019-11-14
+ */
+@RestController
+@RequestMapping("interfacelog")
+public class InterfaceLogController {
+
+ @Autowired
+ private InterfaceLogService interfaceLogService;
+
+ @GetMapping("page")
+ public Result> page(@RequestParam Map params){
+ PageData page = interfaceLogService.listInterfaceLog(params);
+ return new Result>().ok(page);
+ }
+
+ @GetMapping("{id}")
+ public Result get(@PathVariable("id") String id){
+ InterfaceLogDTO data = interfaceLogService.get(id);
+ return new Result().ok(data);
+ }
+
+ @PostMapping
+ public Result save(@RequestBody InterfaceLogDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ interfaceLogService.save(dto);
+ return new Result();
+ }
+
+ @PutMapping
+ public Result update(@RequestBody InterfaceLogDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ interfaceLogService.update(dto);
+ return new Result();
+ }
+
+ @DeleteMapping
+ public Result delete(@RequestBody String[] ids){
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ interfaceLogService.delete(ids);
+ return new Result();
+ }
+
+ @GetMapping("export")
+ public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
+ List list = interfaceLogService.list(params);
+ ExcelUtils.exportExcelToTarget(response, null, list, InterfaceLogExcel.class);
+ }
+
+}
diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/dao/InterfaceLogDao.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/dao/InterfaceLogDao.java
new file mode 100644
index 000000000..6cf6b38ca
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/dao/InterfaceLogDao.java
@@ -0,0 +1,42 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.modules.interfacelog.dao;
+
+import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
+import com.elink.esua.epdc.dto.interfacelog.InterfaceLogDTO;
+import com.elink.esua.epdc.modules.interfacelog.entity.InterfaceLogEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 接口日志表 接口日志表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2019-11-14
+ */
+@Mapper
+public interface InterfaceLogDao extends BaseDao {
+ /**
+ *
+ * @param params
+ * @return 获取接口日志列表
+ */
+ List listInterfaceLog(Map params);
+}
diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/entity/InterfaceLogEntity.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/entity/InterfaceLogEntity.java
new file mode 100644
index 000000000..a6c14a871
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/entity/InterfaceLogEntity.java
@@ -0,0 +1,69 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.modules.interfacelog.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 接口日志表 接口日志表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2019-11-14
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("epdc_interface_log")
+public class InterfaceLogEntity extends BaseEpdcEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 引用ID
+ */
+ private String referenceId;
+
+ /**
+ * 业务类型
+ */
+ private String businessType;
+
+ /**
+ * 调用接口名称
+ */
+ private String interfaceName;
+
+ /**
+ * 调用是否成功 0-调用失败,1-调用成功
+ */
+ private String successFlag;
+
+ /**
+ * 调用消息体
+ */
+ private String callMsgBody;
+
+ /**
+ * 调用返回消息体
+ */
+ private String returnMsgBody;
+
+}
diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/excel/InterfaceLogExcel.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/excel/InterfaceLogExcel.java
new file mode 100644
index 000000000..7026148f9
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/excel/InterfaceLogExcel.java
@@ -0,0 +1,71 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.modules.interfacelog.redis;
+
+import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 接口日志表 接口日志表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2019-11-14
+ */
+@Component
+public class InterfaceLogRedis {
+ @Autowired
+ private RedisUtils redisUtils;
+
+ public void delete(Object[] ids) {
+
+ }
+
+ public void set(){
+
+ }
+
+ public String get(String id){
+ return null;
+ }
+
+}
diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/service/InterfaceLogService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/service/InterfaceLogService.java
new file mode 100644
index 000000000..4b7aed2d4
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/service/InterfaceLogService.java
@@ -0,0 +1,95 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.elink.esua.epdc.modules.interfacelog.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
+import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
+import com.elink.esua.epdc.commons.tools.page.PageData;
+import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
+import com.elink.esua.epdc.dto.interfacelog.InterfaceLogDTO;
+import com.elink.esua.epdc.modules.interfacelog.dao.InterfaceLogDao;
+import com.elink.esua.epdc.modules.interfacelog.entity.InterfaceLogEntity;
+import com.elink.esua.epdc.modules.interfacelog.redis.InterfaceLogRedis;
+import com.elink.esua.epdc.modules.interfacelog.service.InterfaceLogService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 接口日志表 接口日志表
+ *
+ * @author qu qu@elink-cn.com
+ * @since v1.0.0 2019-11-14
+ */
+@Service
+public class InterfaceLogServiceImpl extends BaseServiceImpl implements InterfaceLogService {
+
+ @Autowired
+ private InterfaceLogRedis interfaceLogRedis;
+
+ @Override
+ public PageData listInterfaceLog(Map params) {
+ IPage page = getPage(params);
+ List list = baseDao.listInterfaceLog(params);
+ return new PageData<>(list, page.getTotal());
+ }
+
+ @Override
+ public List list(Map params) {
+ List entityList = baseDao.selectList(getWrapper(params));
+
+ return ConvertUtils.sourceToTarget(entityList, InterfaceLogDTO.class);
+ }
+
+ private QueryWrapper getWrapper(Map params){
+ String id = (String)params.get(FieldConstant.ID_HUMP);
+
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
+
+ return wrapper;
+ }
+
+ @Override
+ public InterfaceLogDTO get(String id) {
+ InterfaceLogEntity entity = baseDao.selectById(id);
+ return ConvertUtils.sourceToTarget(entity, InterfaceLogDTO.class);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void save(InterfaceLogDTO dto) {
+ InterfaceLogEntity entity = ConvertUtils.sourceToTarget(dto, InterfaceLogEntity.class);
+ insert(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void update(InterfaceLogDTO dto) {
+ InterfaceLogEntity entity = ConvertUtils.sourceToTarget(dto, InterfaceLogEntity.class);
+ updateById(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void delete(String[] ids) {
+ // 逻辑删除(@TableLogic 注解)
+ baseDao.deleteBatchIds(Arrays.asList(ids));
+ }
+}
diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/interfacelog/InterfaceLogDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/interfacelog/InterfaceLogDao.xml
new file mode 100644
index 000000000..7eccbda04
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/interfacelog/InterfaceLogDao.xml
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+