002-demo业务说明
一、demo基本业务功能介绍
只是demo,无完整功能,不断重构系统,以搭建 高可扩展性、高性能、大数据、高并发、分布式的系统架构
客户管理、商品管理、购物车、订单管理、库存管理
二、基本数据字典
说明:现在只构建一个最基本的数据字典,后面可以根据需要,进行调整
客户管理:uuid、customerId、pwd、showName、trueName、registerTime
商品管理:uuid、name、imgPath、description
购物车:uuid、customerUuid、goodsUuid、buyNum
订单管理——主订单:uuid、customerUuid、orderTime、totalMoney、saveMoney 、state
订单管理——子订单:uuid、orderUuid、goodsUuid、orderNum、price、money、saveMoney
库存管理:uuid、goodsUuid、storeNum
CREATE DATABASE arch1 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; drop table if exists tbl_customer;
create table tbl_customer
(
uuid int not null auto_increment,
customerId varchar(20),
pwd varchar(20),
showName varchar(100),
trueName varchar(100),
registerTime varchar(100),
primary key (uuid)
) charset=utf8 ENGINE=InnoDB; drop table if exists tbl_goods;
create table tbl_goods
(
uuid int not null auto_increment,
name varchar(200),
imgPath varchar(500),
description varchar(2000),
primary key (uuid)
) charset=utf8 ENGINE=InnoDB; drop table if exists tbl_cart;
create table tbl_cart
(
uuid int not null auto_increment,
customerUuid int,
goodsUuid int,
buyNum int,
primary key (uuid)
) charset=utf8 ENGINE=InnoDB; drop table if exists tbl_order;
create table tbl_order
(
uuid int not null auto_increment,
customerUuid int,
orderTime varchar(100),
totalMoney float,
saveMoney float,
state smallint,
primary key (uuid)
) charset=utf8 ENGINE=InnoDB; drop table if exists tbl_orderDetail;
create table tbl_orderDetail
(
uuid int not null auto_increment,
orderUuid int,
goodsUuid int,
orderNum int,
price float,
money float,
saveMoney float,
primary key (uuid)
) charset=utf8 ENGINE=InnoDB; drop table if exists tbl_store;
create table tbl_store
(
uuid int not null auto_increment,
goodsUuid int,
storeNum int,
primary key (uuid)
) charset=utf8 ENGINE=InnoDB; drop table if exists tbl_file;
create table tbl_file
(
uuid int not null auto_increment,
fileName varchar(1000),
remotePaths varchar(1000),
primary key (uuid)
) charset=utf8 ENGINE=InnoDB;
三、开发环境搭建
3.1、整体环境
1:使用idea开发
2:数据库用Mysql,为了开发测试方便,先部署在本地,开发好了再部署到Linux服务器上
3:基本的技术:Maven+Spring mvc+spring+mybatis
4:前端使用最基本的:jQuery+html+css
5:版本管理:Github
6:后面再加入ehcache来缓存mybatis的查询结果
7:等一个模块开发好了过后,加入X-gen来进行代码生成,以生成其余模块的基础部分
3.2、使用maven搭建项目
搭建基本模块。将公共的包依赖放在父项目的 dependencies 中,properties 是本地变量
子模块就不需要重复配置
程序中,不推荐使用baseDAO,mysql使用xml是mybatis精华
四、customermgr具体开发实现
4.1、分页
方式一、自己开发
参看代码:com.github.bjlhx15.architecture.common.pageutil
以及:resources\MybatisConf.xml
还需要代码配合后缀Page,查询模型增加Page类
方式二、使用PageHelper【推荐】
4.2、BaseDAO基本结构
方式一、自己开发
参看项目中:com.github.bjlhx15.architecture.common.dao.BaseDAO
后续继承即可,扩展在继承的接口中增加
方式二、使用mybatis逆向工程【推荐】
使用逆向工程,生成至auto中,自定义写在外面定义成ext的
4.3、BaseService结构
代码地址:https://github.com/bjlhx15/java_architecture dev02-baseproject分支
其中com.github.bjlhx15.architecture.customermgr.Client2 、com.github.bjlhx15.architecture.customermgr.Client3是通过services测试dao的demo
4.4、web基本结构
代码地址:https://github.com/bjlhx15/java_architecture dev03-baseproject-web分支
五、xgen使用
5.1、xgen简介
代码生成,通过模板方式生成dao,mapper,service,controller,web界面等代码
pom地址
<dependency>
<groupId>com.github.bjlhx15.xgen</groupId>
<artifactId>xgen</artifactId>
<version>1.0.3</version>
</dependency>
github源码的地址:https://github.com/bjlhx15/xgen.git
5.2、通过xgen生成其他模块代码【快捷方式为了便于后续的开发】
代码地址:https://github.com/bjlhx15/java_architecture dev04-xgen 分支
根据customermgr 模块。
1、编写模板:arch1xgen下的 com.github.bjlhx15.arch1xgen.themes.smvclhx 自定义
内部的template 就是 要生成的类的模板
2、Xgen 生成对应的Vistor
3、Xgen 生成需要的Action
4、ThemeConf.xml 要生成的action和模板绑定
002-demo业务说明的更多相关文章
- spring定时任务之quartz
在Spring中,使用JDK的Timer类库来做任务调度功能不是很方便,关键它不可以象cron服务那样可以指定具体年.月.日.时和分的时间.你只能将时间通过换算成微秒后传给它.如任务是每天执行一次,则 ...
- memcached缓存机制+微软缓存机制使用详解
1. why Memcached 1.1 一台web服务器上,iis接收的请求数是有限的,当访问量超大的时候,网站访问就会遇到瓶颈了,处理方式就是运用多了服务器把请求数分流(集群),对外公布的就一 ...
- 项目开发笔记-传单下发 名片替换 文件复制上传/html静态内容替换/json解析/html解析
//////////////////////////// 注意: 此博客是个人工作笔记 非独立demo////////////////////////////////// .............. ...
- JDK1.8 动态代理机制及源码解析
动态代理 a) jdk 动态代理 Proxy, 核心思想:通过实现被代理类的所有接口,生成一个字节码文件后构造一个代理对象,通过持有反射构造被代理类的一个实例,再通过invoke反射调用被代理类实例的 ...
- redis订阅发布简单实现
适用场景 业务流程遇到大量异步操作,并且业务不是很复杂 业务的健壮型要求不高 对即时场景要求不高 原理介绍 redis官网文档:https://redis.io/topics/notification ...
- Web自动化框架之五一套完整demo的点点滴滴(excel功能案例参数化+业务功能分层设计+mysql数据存储封装+截图+日志+测试报告+对接缺陷管理系统+自动编译部署环境+自动验证false、error案例)
标题很大,想说的很多,不知道从那开始~~直接步入正题吧 个人也是由于公司的人员的现状和项目的特殊情况,今年年中后开始折腾web自动化这块:整这个原因很简单,就是想能让自己偷点懒.也让减轻一点同事的苦力 ...
- Spring Web Flow 入门demo(三)嵌套流程与业务结合 附源代码
上篇博客我们说Spring web Flow与业务结合的方式主要有三种,以下我们主要介绍一下第三种的应用方式 3,运行到<action-state> 元素 SpringWeb Flow 中 ...
- Spring Web Flow 入门demo(二)与业务结合 附源代码
第一部分demo仅仅介绍了简单的页面跳转,接下来我们要实现与业务逻辑相关的功能. 业务的逻辑涉及到数据的获取.传递.保存.相关的业务功能函数的调用等内容,这些功能的实现都可用Java 代码来完毕,但定 ...
- 【智能合约】编写复杂业务场景下的智能合约——可升级的智能合约设计模式(附Demo)
智能合约的现状 以太坊在区块链上实现了智能合约的概念,用于:同质化通证发行(ERC-20).众筹.投票.存证取证等等,共同点是:合约逻辑简单,只是业务流程中的关键节点,而非整个业务流程.而智能合约想解 ...
- Python 2.7.9 Demo - 001.print_hello_world - 002.print_chinese
001.print_hello_world #!/usr/bin/python print "hello, world..."; 002.print_chinese #coding ...
随机推荐
- Python语言程序设计:Lab4
Programming 1.Analysing a Text File Look at the file xian_info.txt which is like this: Xi'an China 8 ...
- 二进制部署kubernetes集群(上篇)
1.实验架构 1.1.硬件环境 准备5台2c/2g/50g虚拟机,使用10.4.7.0/24 网络 .//因后期要直接向k8s交付java服务,因此运算节点需要4c8g.不交付服务,全部2c2g足够. ...
- 关于strlen和sizeof的使用
在学习C语言中发现strlen和sizeof的关系不是很明确,今天来总结一下这两个的区别: sizeof 是运算符,用来计算字节数,在计算字符串数组大小时包含(\0) 在编译时计算大小,参数可以是数组 ...
- OpenLayer3入门——[一]
一.OpenLayer3下载 首先下载OpenLayer3开发包,步骤如下: 下载地址https://github.com/openlayers/openlayers/releases/tag/v3. ...
- django.db.models.fields.related_descriptors.RelatedObjectDoesNotExist
Enrollment has no customer.
- 转,异常好的sql 基础知识整理
转载自:http://blog.csdn.net/u011001084/article/details/51318434 最近从图书馆借了本介绍SQL的书,打算复习一下基本语法,记录一下笔记,整理一下 ...
- Python2.7学习
网上很多代码都不适用于python3版本,所以还是转回版本2来学习了 install 安装模块特别简单 E:\01_SOFT\Python27\python -m easy_install sunb ...
- a problem
给出两个长度为 $n$ 的数组 $a, b$对于任意的 $a_i + b_j$, 求第 $k$ 大 不妨设 $a_i < a_{i + 1}, b_i < b_{i + 1}$ 对于任意的 ...
- luogu 3380
树状数组套权值线段树 #include <iostream> #include <cstdio> #include <algorithm> #include < ...
- XFTP 乱码