商城架构搭建

    项目工程结构及说明:

   商城架构搭建_第1张图片 

完整项目工程目录

    项目工程目录说明:

pinyougou-parent:               聚合工程

pinyougou-pojo:                  通用实体类层

pinyougou-dao:                    通用数据访问层

pinyougou-xxxxx-interface:   某服务层接口

pinyougou-xxxxx-service:      某服务层实现

pinyougou-xxxxx-web:          web工程


    创建数据库,引入sql文件,最终创建的数据库表结构如图所示:

商城架构搭建_第2张图片

    项目框架搭建:

        1.创建父工程 :

        创建Maven工程pinyougou-parent POMgroupId com.pinyougou ,artifactId pinyougou-parent , pom.xml中添加锁定版本信息dependencyManagementpluginManagement


  4.0.0
  com.pinyougou
  pinyougou-parent
  0.0.1-SNAPSHOT
  pom
  
  
	
		4.12
		4.2.4.RELEASE
		4.0.0
		2.5
		2.8.4
		3.4.12
		0.1		
		3.2.8
		1.2.2
		1.2.15
		5.1.32		
		1.0.9
		1.3.1
		2.3.23
		5.11.2
		3.2.3.RELEASE		
		4.10.3
		2012_u6		
	
	
	
			
		
			
			
				org.springframework
				spring-context
				${spring.version}
			
			
				org.springframework
				spring-beans
				${spring.version}
			
			
				org.springframework
				spring-webmvc
				${spring.version}
			
			
				org.springframework
				spring-jdbc
				${spring.version}
			
			
				org.springframework
				spring-aspects
				${spring.version}
			
			
				org.springframework
				spring-jms
				${spring.version}
			
			
				org.springframework
				spring-context-support
				${spring.version}
			
			
				org.springframework
				spring-test
				${spring.version}
			
			
			
				com.alibaba
				dubbo
				${dubbo.version}
			
			
				org.apache.zookeeper
				zookeeper
				${zookeeper.version}
			
			
				com.github.sgroschupf
				zkclient
				${zkclient.version}
			
			
				junit
				junit
				4.9
			
			
				com.alibaba
				fastjson
				1.2.28
			
			
				javassist
				javassist
				3.11.0.GA
			
			
			    commons-codec
			    commons-codec
			    1.10
			
			
				javax.servlet
				servlet-api
				2.5
				provided
			
			
			    com.github.pagehelper
			    pagehelper
			    ${pagehelper.version}
					
		  	
			
				org.mybatis
				mybatis
				${mybatis.version}
			
			
				org.mybatis
				mybatis-spring
				${mybatis.spring.version}
			
			
				com.github.miemiedev
				mybatis-paginator
				${mybatis.paginator.version}
					
			
			
				mysql
				mysql-connector-java
				${mysql.version}
			
			
			
				com.alibaba
				druid
				${druid.version}
					
			
			    org.csource.fastdfs
			    fastdfs
			    1.2
			
			
			
				commons-fileupload
				commons-fileupload
				${commons-fileupload.version}
					
			
			 
			  redis.clients 
			  jedis 
			  2.8.1 
			 
			 
			  org.springframework.data 
			  spring-data-redis 
			  1.7.2.RELEASE 
					
			
				org.freemarker
				freemarker
				${freemarker.version}
					
			
				org.apache.activemq
				activemq-all
				${activemq.version}
			
			
			
				org.springframework.security
				spring-security-web
				4.1.0.RELEASE
			
			
				org.springframework.security
				spring-security-config
				4.1.0.RELEASE
					
			
			    com.github.penggle
			    kaptcha
			    2.3.2
			    
			    	
			    		javax.servlet
	      				javax.servlet-api
			    	
			    
					
			  
		        org.springframework.security  
		        spring-security-cas  
		        4.1.0.RELEASE  
		      
		      
		        org.jasig.cas.client  
		        cas-client-core  
		        3.3.3  
		          
		          
		              
		                org.slf4j  
		                log4j-over-slf4j  
		              
		          
		     	    
		    
			
				org.apache.solr
				solr-solrj
				${solrj.version}
			
			
				com.janeluo
				ikanalyzer
				${ik.version}
				
	  		
	  			org.apache.httpcomponents
	  			httpcore
	  			4.4.4
	  		  		
	  		
	  			org.apache.httpcomponents
	  			httpclient
	  			4.5.3
	  		
	  		
	  			dom4j
	  			dom4j
	  			1.6.1
	  		  		
	  		  
	            xml-apis  
	            xml-apis  
	            1.4.01  
	         		
			
	
	
	

	
	
		
					
			
			
				org.apache.maven.plugins
				maven-compiler-plugin
				3.2
				
					1.7
					1.7
					UTF-8
				
			

		
	
	
	
		pinyougou-pojo
		pinyougou-dao
		pinyougou-common
		pinyougou-sellergoods-interface
		pinyougou-sellergoods-service
		pinyougou-manage-web
		pinyougou-shop-web
	
父工程POM文件

2.创建通用实体类模块:

        创建通用实体类模块-pinyougou-pojo

3.创建通用数据访问模块:

        创建通用数据访问模块pinyougou-dao .添加Mybatis、PageHelper、MySQL、德鲁伊数据库连接池以及pinyougou-pojo依赖。


  4.0.0
  
    com.pinyougou
    pinyougou-parent
    0.0.1-SNAPSHOT
  
  pinyougou-dao
  
  

  	
	    com.github.pagehelper
	    pagehelper	   
			
  	
	
		org.mybatis
		mybatis		
	
	
		org.mybatis
		mybatis-spring		
	
	
		com.github.miemiedev
		mybatis-paginator		
			
	
	
		mysql
		mysql-connector-java		
	
	
	
		com.alibaba
		druid		
	

	
		com.pinyougou
		pinyougou-pojo
		0.0.1-SNAPSHOT
	
  

添加依赖

4.创建通用工具类模块:

        创建通用工具类模块pinyougou-common,不需要引入额外的依赖。

5.创建商家商品服务接口模块:

        创建mavenjar)模块pinyougou-sellergoods-interface  , pom.xml添加依赖


  4.0.0
  
    com.pinyougou
    pinyougou-parent
    0.0.1-SNAPSHOT
  
  pinyougou-sellergoods-interface
  
  	
  		com.pinyougou
  		pinyougou-pojo
  		0.0.1-SNAPSHOT
  	
  
添加依赖

6.创建商家商品服务模块:

        

创建maven(war)模块pinyougou-sellergoods-service,pom.xml引入依赖


  4.0.0
  
    com.pinyougou
    pinyougou-parent
    0.0.1-SNAPSHOT
  
  pinyougou-sellergoods-service
  war
  
  
  
  		
	
		org.springframework
		spring-context		
	
	
		org.springframework
		spring-beans		
	
	
		org.springframework
		spring-webmvc		
	
	
		org.springframework
		spring-jdbc		
	
	
		org.springframework
		spring-aspects		
	
	
		org.springframework
		spring-jms		
	
	
		org.springframework
		spring-context-support		
	
	
		org.springframework
		spring-test		
	
	
	
		com.alibaba
		dubbo	
	
	
		org.apache.zookeeper
		zookeeper	
	
	
		com.github.sgroschupf
		zkclient		
	
	
		junit
		junit		
	
	
		com.alibaba
		fastjson		
	
	
		javassist
		javassist		
	
	
	    commons-codec
	    commons-codec	   
	
	
		javax.servlet
		servlet-api		
		provided
	

	
		com.pinyougou
		pinyougou-sellergoods-interface
		0.0.1-SNAPSHOT
	
	
		com.pinyougou
		pinyougou-dao
		0.0.1-SNAPSHOT
	
	
		com.pinyougou
		pinyougou-pojo
		0.0.1-SNAPSHOT
	
  
  
    
	  	     
	      
				org.apache.tomcat.maven
				tomcat7-maven-plugin
				2.2
				
					
					9001
					
					/
				
	  	  
	    
    
添加依赖

  7.创建运营商后台管理模块:

          创建maven(war)模块pinyougou-manager-web   pom.xml引入依赖


  4.0.0
  
    com.pinyougou
    pinyougou-parent
    0.0.1-SNAPSHOT
  
  pinyougou-manage-web
  war
  
  
    
	
		org.springframework
		spring-context
	
	
		org.springframework
		spring-beans
	
	
		org.springframework
		spring-webmvc
	
	
		org.springframework
		spring-jdbc
	
	
		org.springframework
		spring-aspects
	
	
		org.springframework
		spring-jms
	
	
		org.springframework
		spring-context-support
	
	
		org.springframework
		spring-test
	
	
	
		com.alibaba
		dubbo
	
	
		org.apache.zookeeper
		zookeeper
	
	
		com.github.sgroschupf
		zkclient
	
	
		junit
		junit
	
	
		com.alibaba
		fastjson
	
	
		javassist
		javassist
	
	
	    commons-codec
	    commons-codec
	
	
		javax.servlet
		servlet-api		
		provided
	
	
	
	
		org.springframework.security
		spring-security-web
	

	
		org.springframework.security
		spring-security-config	
	

	
		com.pinyougou
		pinyougou-sellergoods-interface
		0.0.1-SNAPSHOT
	
  
  
  
      
	  
	      
				org.apache.tomcat.maven
				tomcat7-maven-plugin
				2.2
				
					
					9101
					
					/
				
	  	  
	    
    
    
添加依赖

8.创建商家后台管理模块:

构建web模块pinyougou-shop-web  与运营商管理后台的构建方式类似。区别:

(1)定义tomcat的启动端口为9102

(2)在springmvc.xml配置文件中引入dubbo服务



    
	
	
	  
	      
	      
	      
	        
	          WriteMapNullValue
	          WriteDateUseDateFormat
	        
	      
	    
	    
	

	
	
	
	  	


实体类和数据访问层模块代码编写:

        1.利用反向工程generatorSqlmapCustom实现实体类与数据访问层代码的自动生成

        2.将com.pinyougou.pojo包拷贝到pojo工程

          将com.pinyougou.mapper包和resouce下的com.pinyougou.mapper文件夹拷贝到dao工程

        3.将com.pinyougou.pojo包下的每个实体类实现Serializable序列化接口



你可能感兴趣的:(电商项目)