16、首页动态展示(内容服务系统)

首页动态展示(内容服务系统)

内容信息要从数据库中获得

动态展示分析

  • 内容需要进行分类
  • 分类下有子分类,需要动态管理
  • 分类下有内容列表
  • 单点的内容信息
    • 有图片
    • 有链接
    • 有标题
    • 有价格
    • 包含大文本类型,可以作为公告

在这里插入图片描述

需要一个内容分类表和一个内容表。内容分类和内容表是一对多的关系。
内容分类表,需要存储树形结构的数据。
内容分类表:tb_content_category
内容表:tb_content

需要有后台来维护内容信息—— CMS 系统。

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

内容服务系统创建

工程搭建

需要创建一个内容服务系统。可以参考 e3-manager 创建。

e3-content:聚合工程打包方式pom
    |--e3-content-interface  jar
    |--e3-content-Service  war

e3-content

pom文件

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>e3-parent</artifactId>
        <groupId>cn.ynx.e3mall</groupId>
        <version>1.0-SNAPSHOT</version>
        <relativePath>../e3-parent/pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>e3-content</artifactId>

    <packaging>pom</packaging>

    <dependencies>
        <dependency>
            <groupId>cn.ynx.e3mall</groupId>
            <artifactId>e3-common</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
    </dependencies>

    <!-- 配置tomcat插件 -->
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <configuration>
                    <port>8083</port>
                    <path>/</path>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

e3-content-interface

pom文件

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>e3-content</artifactId>
        <groupId>cn.ynx.e3mall</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>e3-content-interface</artifactId>

    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>cn.ynx.e3mall</groupId>
            <artifactId>e3-manager-pojo</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
    </dependencies>

</project>

e3-content-service

pom文件

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>e3-content</artifactId>
        <groupId>cn.ynx.e3mall</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>e3-content-service</artifactId>

    <packaging>war</packaging>

    <dependencies>
        <dependency>
            <groupId>cn.ynx.e3mall</groupId>
            <artifactId>e3-manager-dao</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>cn.ynx.e3mall</groupId>
            <artifactId>e3-content-interface</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
        <!-- spring的依赖 -->
        <!-- Spring -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aspects</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jms</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
        </dependency>
        <!-- dubbo相关 -->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>dubbo</artifactId>
            <!-- 排除依赖 -->
            <exclusions>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.jboss.netty</groupId>
                    <artifactId>netty</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.zookeeper</groupId>
            <artifactId>zookeeper</artifactId>
        </dependency>
        <dependency>
            <groupId>com.github.sgroschupf</groupId>
            <artifactId>zkclient</artifactId>
        </dependency>
    </dependencies>

</project>

框架整合

参考 e3-manager
复制 e3-manager-service 的配置文件

在这里插入图片描述

修改 applicationContext-service.xml

在这里插入图片描述

修改 applicationContext-trans.xml

在这里插入图片描述

修改 web.xml

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_42112635/article/details/84948975
今日推荐