8 changed files with 184 additions and 1 deletions
			
			
		@ -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(); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,34 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * 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. | 
				
			|||
 * <p> | 
				
			|||
 * 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. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
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> { | 
				
			|||
 | 
				
			|||
    HelperVideoEntity getEnableHelperVideo(); | 
				
			|||
} | 
				
			|||
@ -0,0 +1,49 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * 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. | 
				
			|||
 * <p> | 
				
			|||
 * 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. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
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; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,7 @@ | 
				
			|||
package com.epmet.service; | 
				
			|||
 | 
				
			|||
import com.epmet.entity.HelperVideoEntity; | 
				
			|||
 | 
				
			|||
public interface HelperVideoService { | 
				
			|||
    HelperVideoEntity getEnableHelperVideo(); | 
				
			|||
} | 
				
			|||
@ -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(); | 
				
			|||
    } | 
				
			|||
} | 
				
			|||
@ -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='宣传视频' | 
				
			|||
@ -0,0 +1,33 @@ | 
				
			|||
<?xml version="1.0" encoding="UTF-8"?> | 
				
			|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 
				
			|||
 | 
				
			|||
<mapper namespace="com.epmet.dao.HelperVideoDao"> | 
				
			|||
 | 
				
			|||
    <resultMap type="com.epmet.entity.HelperVideoEntity" id="baseMap"> | 
				
			|||
        <result property="id" column="ID"/> | 
				
			|||
        <result property="path" column="PATH"/> | 
				
			|||
        <result property="enable" column="ENABLE"/> | 
				
			|||
        <result property="revision" column="REVISION"/> | 
				
			|||
        <result property="delFlag" column="DEL_FLAG"/> | 
				
			|||
        <result property="createdBy" column="CREATED_BY"/> | 
				
			|||
        <result property="createdTime" column="CREATED_TIME"/> | 
				
			|||
        <result property="updatedBy" column="UPDATED_BY"/> | 
				
			|||
        <result property="updatedTime" column="UPDATED_TIME"/> | 
				
			|||
    </resultMap> | 
				
			|||
    <select id="getEnableHelperVideo" resultMap="baseMap"> | 
				
			|||
        select id, | 
				
			|||
               path, | 
				
			|||
               enable, | 
				
			|||
               revision, | 
				
			|||
               del_flag, | 
				
			|||
               created_by, | 
				
			|||
               created_time, | 
				
			|||
               updated_by, | 
				
			|||
               updated_time | 
				
			|||
        from helper_video | 
				
			|||
        where ENABLE = 1 | 
				
			|||
        limit 1 | 
				
			|||
    </select> | 
				
			|||
 | 
				
			|||
 | 
				
			|||
</mapper> | 
				
			|||
					Loading…
					
					
				
		Reference in new issue