+ * 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.epmet.controller;
+
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.commons.tools.validator.group.AddGroup;
+import com.epmet.commons.tools.validator.group.UpdateGroup;
+import com.epmet.dto.form.EventFormDTO;
+import com.epmet.service.EventService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+
+/**
+ * 事件表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-16
+ */
+@RestController
+@RequestMapping("event")
+public class EventController {
+
+ @Autowired
+ private EventService eventService;
+
+ /**
+ * desc:添加事件,如果已存在则不作任何改动,直接返回成功
+ *
+ * @param formDTO
+ * @return
+ * json:{
+ * "classId":"epmet_heart",
+ * "appId":"202007161443499985fa2d397436d10356542134c8f008c48",
+ * "appName":"党群e事通开发测试",
+ * "eventCode":"epmet_heart_active_send_point",
+ * "eventName":"活动发放积分",
+ * "eventDesc":"给参加活动的人发放积分",
+ * "eventGroupId":"1234",
+ * "isCommon":"1"
+ * }
+ */
+ @PostMapping("addEvent")
+ public Result addEvent(@RequestBody EventFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, AddGroup.class);
+ eventService.addEvent(formDTO);
+ return new Result().ok(true);
+ }
+
+ /**
+ * desc:修改事件,如果已存在则不作任何改动,直接返回成功
+ *
+ * @param formDTO
+ * @return
+ */
+ @GetMapping("updateEvent")
+ public Result updateEvent(@RequestBody EventFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, UpdateGroup.class);
+ eventService.updateEvent(formDTO);
+ return new Result().ok(true);
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/EventDao.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/EventDao.java
new file mode 100644
index 0000000000..4db69553ec
--- /dev/null
+++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/EventDao.java
@@ -0,0 +1,35 @@
+/**
+ * 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.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.entity.EventEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 事件表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-16
+ */
+@Mapper
+public interface EventDao extends BaseDao {
+
+ int getCountByEventCode(@Param("eventCode") String eventCode);
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/EventEntity.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/EventEntity.java
new file mode 100644
index 0000000000..391b11ad40
--- /dev/null
+++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/EventEntity.java
@@ -0,0 +1,81 @@
+/**
+ * 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.epmet.service;
+
+import com.epmet.commons.mybatis.service.BaseService;
+import com.epmet.dto.form.EventFormDTO;
+import com.epmet.entity.EventEntity;
+
+/**
+ * 事件表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-16
+ */
+public interface EventService extends BaseService {
+
+ void addEvent(EventFormDTO formDTO);
+
+ void updateEvent(EventFormDTO formDTO);
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/EventServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/EventServiceImpl.java
new file mode 100644
index 0000000000..fed5a58ed3
--- /dev/null
+++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/EventServiceImpl.java
@@ -0,0 +1,60 @@
+/**
+ * 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.
+ *