diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index 36b0025c32..43cb9543e2 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -330,7 +330,7 @@ - lb://epmet-openapi-adv-server + lb://epmet-openapi-adv-server diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/HelperController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/HelperController.java new file mode 100644 index 0000000000..d06e522e77 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/HelperController.java @@ -0,0 +1,23 @@ +package com.epmet.controller; + +import com.epmet.entity.HelperVideoEntity; +import com.epmet.service.HelperVideoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; + +@Controller +@RequestMapping("helper") +public class HelperController { + + @Autowired + private HelperVideoService helperVideoService; + + @GetMapping("helper-video") + public String getHelpVideo() { + HelperVideoEntity enableHelperVideo = helperVideoService.getEnableHelperVideo(); + return "redirect:" + enableHelperVideo.getPath(); + } + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/HelperVideoDao.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/HelperVideoDao.java new file mode 100644 index 0000000000..989989f347 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/HelperVideoDao.java @@ -0,0 +1,34 @@ +/** + * 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.HelperVideoEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 宣传视频 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-01 + */ +@Mapper +public interface HelperVideoDao extends BaseDao { + + HelperVideoEntity getEnableHelperVideo(); +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/HelperVideoEntity.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/HelperVideoEntity.java new file mode 100644 index 0000000000..d94043acec --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/HelperVideoEntity.java @@ -0,0 +1,49 @@ +/** + * 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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 宣传视频 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-01 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("helper_video") +public class HelperVideoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 存储路径 + */ + private String path; + + /** + * 是否启用 + */ + private Integer enable; + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/HelperVideoService.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/HelperVideoService.java new file mode 100644 index 0000000000..63d348075c --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/HelperVideoService.java @@ -0,0 +1,7 @@ +package com.epmet.service; + +import com.epmet.entity.HelperVideoEntity; + +public interface HelperVideoService { + HelperVideoEntity getEnableHelperVideo(); +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/HelperVideoServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/HelperVideoServiceImpl.java new file mode 100644 index 0000000000..2de1313d45 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/HelperVideoServiceImpl.java @@ -0,0 +1,19 @@ +package com.epmet.service.impl; + +import com.epmet.dao.HelperVideoDao; +import com.epmet.entity.HelperVideoEntity; +import com.epmet.service.HelperVideoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class HelperVideoServiceImpl implements HelperVideoService { + + @Autowired + private HelperVideoDao helperVideoDao; + + @Override + public HelperVideoEntity getEnableHelperVideo() { + return helperVideoDao.getEnableHelperVideo(); + } +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.8__createHelperVideo.sql b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.8__createHelperVideo.sql new file mode 100644 index 0000000000..bc17eca33d --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.8__createHelperVideo.sql @@ -0,0 +1,18 @@ +-- create database epmet_adv default character set utf8mb4; + +-- CREATE USER epmet_adv_user@'%' IDENTIFIED BY 'EpmEt-db-UsEr'; +-- GRANT ALL ON `epmet_adv%`.* TO 'epmet_adv_user'@'%'; +-- flush privileges; + +CREATE TABLE `helper_video` ( + `ID` varchar(64) NOT NULL COMMENT 'id', + `PATH` varchar(255) NOT NULL COMMENT '存储路径', + `ENABLE` tinyint(1) NOT NULL COMMENT '是否启用', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `DEL_FLAG` int(11) unsigned DEFAULT NULL COMMENT '删除标识 0:未删除 1:删除', + `CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建者', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新者', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='宣传视频' \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/HelperVideoDao.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/HelperVideoDao.xml new file mode 100644 index 0000000000..848e4de084 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/HelperVideoDao.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file