前台系统(前台商城首页)

1课程计划

1、前台系统搭建

2、商城首页展示

3、Cms系统的实现

        a) 内容分类管理

        b) 内容管理

4.前台内容动态展示

2商城首页展示

系统架构:

页面位置:

2.1工程搭建

E3-portal-web(war)

可以参考e3-manager-web工程搭建

复制pom文件改tomcat端口,配置文件(删除图片服务器配置文件,清空resource.properties)

修改spring-mvc配置文件包名防止依赖时冲突

创建包 cn.e3mall.portal.controller

配置/全部拦截时加入(否则删除):

删除上传等配置如下:

2.2功能分析

复制ec-manager-web web.xml

配置修改配置工程名、视图解析器名为ec-manager-portal

复制页面到工程下:

请求的url:/index

Web.xml中的欢迎页配置:

http://localhost:8082/index.html

参数:没有

返回值:String 逻辑视图

@Controller

public class IndexController {

 

      @RequestMapping("/index")

      public String showIndex() {

            return "index";

      }

}

3首页动态展示分析

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

3.1动态展示分析

1.内容需要进行分类

2.分类下有子分类,需要动态管理。

3.分类下有内容列表

4.单点的内容信息

       a) 有图片

       b) 有链接

       c) 有标题

       d) 有价格

       e) 包含大文本类型,可以作为公告

需要一个内容分类表和一个内容表。内容分类和内容表是一对多的关系。

 

内容分类表,需要存储树形结构的数据。

内容分类表:tb_content_category

内容表:tb_content

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

 

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

E3-content:聚合工程打包方式pom

|--e3-content-interface jar

|--e3-content-Service  war

4内容服务系统创建

4.1工程搭建

可以参考e3-manager工程搭建。

4.2E3-content

4.2.1Pom文件

<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">

      <modelVersion>4.0.0</modelVersion>

      <parent>

            <groupId>cn.e3mall</groupId>

            <artifactId>e3-parent</artifactId>

            <version>0.0.1-SNAPSHOT</version>

      </parent>

      <groupId>cn.e3mall</groupId>

      <artifactId>e3-content</artifactId>

      <version>0.0.1-SNAPSHOT</version>

      <packaging>pom</packaging>

      <dependencies>

            <dependency>

                  <groupId>cn.e3mall</groupId>

                  <artifactId>e3-common</artifactId>

                  <version>0.0.1-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>

4.3 e3-content-interface

4.3.1 Pom文件

<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">

      <modelVersion>4.0.0</modelVersion>

      <parent>

            <groupId>cn.e3mall</groupId>

            <artifactId>e3-content</artifactId>

            <version>0.0.1-SNAPSHOT</version>

      </parent>

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

      <dependencies>

            <dependency>

                  <groupId>cn.e3mall</groupId>

                  <artifactId>e3-manager-pojo</artifactId>

                  <version>0.0.1-SNAPSHOT</version>

            </dependency>

      </dependencies>

</project>

 

4.4 e3-content-service

4.4.1 Pom文件

<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">

      <modelVersion>4.0.0</modelVersion>

      <parent>

            <groupId>cn.e3mall</groupId>

            <artifactId>e3-content</artifactId>

            <version>0.0.1-SNAPSHOT</version>

      </parent>

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

      <packaging>war</packaging>

      <dependencies>

            <dependency>

                  <groupId>cn.e3mall</groupId>

                  <artifactId>e3-manager-dao</artifactId>

                  <version>0.0.1-SNAPSHOT</version>

            </dependency>

            <dependency>

                  <groupId>cn.e3mall</groupId>

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

                  <version>0.0.1-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>

4.5 框架整合

复制配置文件:

修改applicationContext-service.xml 包名防止打包到maven仓库引入冲突:

创建e3-content-interface工程包:cn.e3mall.content.service

创建 e3-content-service工程包:cn.e3mall.content.service.impl

修改工程名和dubbo服务端口:

修改applicationContext-trans.xml事务配置:

复制e3-manager-service web.xml 修改:

参考e3-manager

4.6 dubbo发布使用tocmat

猜你喜欢

转载自blog.csdn.net/etna_hh/article/details/82556262