未验证 提交 0d18286a 编写于 作者: N Nicky 提交者: GitHub

Merge pull request #20 from u014427391/1.0.0

1.0.0
package com.muses.taoshop.order;
import org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
*
* <pre>
* SpringBoot启动配置类
* </pre>
* @author nicky
* @version 1.00.00
* <pre>
* 修改记录
* 修改后版本: 修改人: 修改日期: 修改内容:
* </pre>
*/
@Controller
@EnableScheduling//开启对计划任务的支持
@EnableTransactionManagement//开启对事务管理配置的支持
@EnableCaching
@EnableAsync//开启对异步方法的支持
@EnableAutoConfiguration
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class,
MybatisAutoConfiguration.class,
DataSourceTransactionManagerAutoConfiguration.class})
public class OrderApplication {
public static void main(String[] args) throws Exception{
SpringApplication.run(OrderApplication.class, args);
}
}
package com.muses.taoshop.order.web.controller;
import org.apache.log4j.Logger;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
/**
* <pre>
* 基础控制类
* </pre>
*
* @author nicky
* @version 1.00.00
* <pre>
* 修改记录
* 修改后版本: 修改人: 修改日期: 2018.06.18 00:12 修改内容:
* </pre>
*/
public class BaseController {
public Logger log = Logger.getLogger(getClass());
public void debug(String message , Exception e){
log.debug(message , e);
}
public void info(String message,Exception e){
log.info(message , e);
}
public void error(String message,Exception e){
log.error(message , e);
}
/***
* 获取request值
* @return
*/
public HttpServletRequest getRequest() {
return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
}
/**
* 得到ModelAndView
*/
public ModelAndView getModelAndView(){
return new ModelAndView();
}
}
package com.muses.taoshop.order.web.controller;
import org.springframework.stereotype.Controller;
/**
* <pre>
* 订单控制类
* </pre>
*
* @author nicky
* @version 1.00.00
* <pre>
* 修改记录
* 修改后版本: 修改人: 修改日期: 2018.10.22 23:50 修改内容:
* </pre>
*/
@Controller
public class OrderController {
}
server:
port: 8082
#logging:
# config: classpath:logback_spring.xml
# level:
# com.muses.taoshop: debug
# path: /data/logs
spring:
datasource:
# 主数据源
shop:
url: jdbc:mysql://127.0.0.1:3306/taoshop?autoReconnect=true&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false
username: root
password: root
driver-class-name: com.mysql.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
# 连接池设置
druid:
initial-size: 5
min-idle: 5
max-active: 20
# 配置获取连接等待超时的时间
max-wait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
time-between-eviction-runs-millis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
min-evictable-idle-time-millis: 300000
# Oracle请使用select 1 from dual
validation-query: SELECT 'x'
test-while-idle: true
test-on-borrow: false
test-on-return: false
# 打开PSCache,并且指定每个连接上PSCache的大小
pool-prepared-statements: true
max-pool-prepared-statement-per-connection-size: 20
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
filters: stat,wall,slf4j
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
# 合并多个DruidDataSource的监控数据
use-global-data-source-stat: true
# jpa:
# database: mysql
# hibernate:
# show_sql: true
# format_sql: true
# ddl-auto: none
# naming:
# physical-strategy: org.hibernate.boot.entity.naming.PhysicalNamingStrategyStandardImpl
# mvc:
# view:
# prefix: /WEB-INF/jsp/
# suffix: .jsp
#添加Thymeleaf配置
thymeleaf:
cache: false
prefix: classpath:/templates/
suffix: .html
mode: HTML5
encoding: UTF-8
content-type: text/html
#Jedis配置
# jedis :
# pool :
# host : 127.0.0.1
# port : 6379
# password : redispassword
# timeout : 0
# config :
# maxTotal : 100
# maxIdle : 10
# maxWaitMillis : 100000
......@@ -61,7 +61,7 @@ public class LoginController extends BaseController{
String username = logindata[0];
String password = logindata[1];
String code = logindata[2];
//TODO 先不要验证码校验
//先不要验证码校验
//if(!code.equalsIgnoreCase(codeSession)){//验证码校验
// flag = "codeError";
//}else{ //账号密码校验
......
......@@ -41,8 +41,6 @@ public class IndexController extends BaseController{
@Autowired
IItemCategoryService iItemCategoryService;
//@RequestMapping(value = "/toIndex" ,method = RequestMethod.GET)
/**
* 跳转到门户网站
* @return
......
package com.muses.taoshop.web.controller.portal;
import com.muses.taoshop.web.controller.BaseController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
/**
* <pre>
* 商品类别控制类
* </pre>
*
* @author nicky
* @version 1.00.00
* <pre>
* 修改记录
* 修改后版本: 修改人: 修改日期: 2018.10.27 11:53 修改内容:
* </pre>
*/
@Controller
@RequestMapping(value = "/portal/category")
public class ItemCategoryController extends BaseController{
@RequestMapping(value = "/toCategoryList")
public ModelAndView toCategoryList() {
ModelAndView mv = this.getModelAndView();
mv.setViewName("item/item_category");
return mv;
}
}
server:
port: 8081
logging:
config: classpath:logback_spring.xml
level:
com.muses.taoshop: debug
path: /data/logs
#logging:
# config: classpath:logback_spring.xml
# level:
# com.muses.taoshop: debug
# path: /data/logs
spring:
datasource:
......
......@@ -12,9 +12,9 @@
<div class="close">x</div>
<div class="subitem" th:each="s: ${c.subCategorys}">
<dl class="fore1">
<dt th:text="${s.categoryName}"><a href="#"></a></dt>
<dt th:text="${s.categoryName}"><a th:href="@{/portal/category/toCategoryList.do}"></a></dt>
<dd>
<em th:each="ss : ${s.subCategorys} "><a href="#" th:text="${ss.categoryName}"></a></em>
<em th:each="ss : ${s.subCategorys} "><a th:href="@{/portal/category/toCategoryList.do}" th:text="${ss.categoryName}"></a></em>
</dd>
</dl>
</div>
......
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8" />
<title>无标题文档</title>
<link th:href="@{/static/css/public.css}" rel="stylesheet" type="text/css" />
<link th:href="@{/static/css/category.css}" rel="stylesheet" type="text/css" />
<script type="text/javascript" th:src="@{/static/js/jquery-1.3.2.min.js}"></script>
<script type="text/javascript" th:src="@{/static/js/html5.js}"></script>
<script type="text/javascript" th:src="@{/static/js/jqzoom.js}"></script>
</head>
<body>
<!--header-->
<header class="header">
<!--topBar-->
<div class="topBar" th:replace="/top_bar :: .topBar"></div>
<!--//topBar-->
<!--headerMain-->
<div class="headerMain layout clearfix" th:replace="/header_main :: .headerMain"></div>
<!--//headerMain-->
<!--headerNav-->
<div class="headerNav" th:replace="/header_nav :: .headerNav"></div>
<!--//headerNav-->
</header>
<!--//header-->
<!--container-->
<div class="container">
<div class="layout">
<h2 class="phoneSearch-title">手机汇</h2>
<!--搜索条件-->
<div class="phoneSearch-filter" id="phoneSearch_filter">
<div class="ft">
<a href="javascript:;" class="wrapper-tgr-click">
更多<span class="more-expand"></span>
</a>
</div>
<div class="phoneSearch-filter-item">
<h3>品牌:</h3>
<p id="brand">
<a href="#" class="selected">全部</a>
<a href="#">Apple</a>
<a href="#">三星</a>
<a href="#">HTC</a>
<a href="#">华为</a>
<a href="#">中兴</a>
<a href="#">联想</a>
</p>
</div>
<div class="phoneSearch-filter-item">
<h3>价格:</h3>
<p>
<a href="#">全部</a>
<a href="#">0-400</a>
<a href="#">400-800</a>
<a href="#">800-1500</a>
<a href="#">1500-3000</a>
<a href="#">3000-4500</a>
<a href="#">4500以上</a>
</p>
</div>
<div class="phoneSearch-filter-item" style="display:none;">
<h3>外观:</h3>
<p>
<a href="#">全部</a>
<a href="#">直板</a>
<a href="#">翻盖</a>
</p>
</div>
<div class="phoneSearch-filter-item" style="display:none;">
<h3>特色:</h3>
<p>
<a href="#">全部</a>
<a href="#">多核手机</a>
<a href="#">老人儿童</a>
<a href="#">千元大屏</a>
<a href="#">双网双待</a>
<a href="#">尾货清仓</a>
</p>
</div>
<div class="phoneSearch-filter-item" style="display:none;">
<h3>尺寸:</h3>
<p>
<a href="#">全部</a>
<a href="#">2.0英寸以下</a>
<a href="#">2.-3.5英寸</a>
<a href="#">3.6-4.5英寸</a>
<a href="#">4.5以上</a>
</p>
</div>
<div class="phoneSearch-filter-item" style="display:none;">
<h3>CPU:</h3>
<p>
<a href="#">全部</a>
<a href="#">单核</a>
<a href="#">双核</a>
<a href="#">四核</a>
<a href="#">八核</a>
<a href="#">五核</a>
</p>
</div>
<div class="phoneSearch-filter-item" style="display:none;">
<h3>像素:</h3>
<p>
<a href="#">全部</a>
<a href="#">300万及以下</a>
<a href="#">301-500万</a>
<a href="#">501-800万</a>
<a href="#">800万以上摄像头</a>
</p>
</div>
</div>
<script>
$(function(){
var o = $("#phoneSearch_filter");
o.find(".ft").toggle(function(){
$('#phoneSearch_filter .phoneSearch-filter-item:gt(1)').show();
$(this).find(".more-expand").css("background-position","0 -7px");
},function(){
$('#phoneSearch_filter .phoneSearch-filter-item:gt(1)').hide();
$(this).find(".more-expand").css("background-position","0 0");
});
});
</script>
<!--//搜索条件-->
<!--排序-->
<div class="reorder clearfix m10-b">
<div class="reorder-wrapper">
<a class="selected">最新</a>
<a>价格从高到低</a>
<a>价格从低到高</a>
</div>
<div class="reorder-styles">
<label><input type="checkbox" /> 仅显示有库存的机型</label>
</div>
</div>
<!--//排序-->
<!--商品列表-->
<div class="phoneList clearfix m10-b">
<div class="phoneList-wrap">
<div class="phoneListItem">
<p class="item-img">
<a href="#"><img th:src="@{/static/picture/img_phoneList_240x240.jpg}" /></a>
</p>
<p class="item-name">
<a href="#">苹果(APPLE)iPhone 4S 8G版</a>
</p>
<p class="item-info">北京电信购机</p>
<p class="item-price"><em>2098</em></p>
<p class="item-btn">
<a href="#" class="btn btn-gray">加入购物车</a>
<a href="#" class="btn btn-red">立即购买</a>
</p>
</div>
<div class="phoneListItem">
<p class="item-img">
<a href="#"><img th:src="@{/static/picture/img_phoneList_240x240.jpg}" /></a>
</p>
<p class="item-name">
<a href="#">苹果(APPLE)iPhone 4S 8G版</a>
</p>
<p class="item-info">北京电信购机</p>
<p class="item-price"><em>2098</em></p>
<p class="item-btn">
<a href="#" class="btn btn-gray">加入购物车</a>
<a href="#" class="btn btn-red">立即购买</a>
</p>
</div>
<div class="phoneListItem">
<p class="item-img">
<a href="#"><img th:src="@{/static/picture/img_phoneList_240x240.jpg}" /></a>
</p>
<p class="item-name">
<a href="#">苹果(APPLE)iPhone 4S 8G版</a>
</p>
<p class="item-info">北京电信购机</p>
<p class="item-price"><em>2098</em></p>
<p class="item-btn">
<a href="#" class="btn btn-gray">加入购物车</a>
<a href="#" class="btn btn-red">立即购买</a>
</p>
</div>
<div class="phoneListItem">
<p class="item-img">
<a href="#"><img th:src="@{/static/picture/img_phoneList_240x240.jpg}" /></a>
</p>
<p class="item-name">
<a href="#">苹果(APPLE)iPhone 4S 8G版</a>
</p>
<p class="item-info">北京电信购机</p>
<p class="item-price"><em>2098</em></p>
<p class="item-btn">
<a href="#" class="btn btn-gray">加入购物车</a>
<a href="#" class="btn btn-red">立即购买</a>
</p>
</div>
<div class="phoneListItem">
<p class="item-img">
<a href="#"><img th:src="@{/static/picture/img_phoneList_240x240.jpg}" /></a>
</p>
<p class="item-name">
<a href="#">苹果(APPLE)iPhone 4S 8G版</a>
</p>
<p class="item-info">北京电信购机</p>
<p class="item-price"><em>2098</em></p>
<p class="item-btn">
<a href="#" class="btn btn-gray">加入购物车</a>
<a href="#" class="btn btn-red">立即购买</a>
</p>
</div>
<div class="phoneListItem">
<p class="item-img">
<a href="#"><img th:src="@{/static/picture/img_phoneList_240x240.jpg}" /></a>
</p>
<p class="item-name">
<a href="#">苹果(APPLE)iPhone 4S 8G版</a>
</p>
<p class="item-info">北京电信购机</p>
<p class="item-price"><em>2098</em></p>
<p class="item-btn">
<a href="#" class="btn btn-gray">加入购物车</a>
<a href="#" class="btn btn-red">立即购买</a>
</p>
</div>
<div class="phoneListItem">
<p class="item-img">
<a href="#"><img th:src="@{/static/picture/img_phoneList_240x240.jpg}" /></a>
</p>
<p class="item-name">
<a href="#">苹果(APPLE)iPhone 4S 8G版</a>
</p>
<p class="item-info">北京电信购机</p>
<p class="item-price"><em>2098</em></p>
<p class="item-btn">
<a href="#" class="btn btn-gray">加入购物车</a>
<a href="#" class="btn btn-red">立即购买</a>
</p>
</div>
<div class="phoneListItem">
<p class="item-img">
<a href="#"><img th:src="@{/static/picture/img_phoneList_240x240.jpg}" /></a>
</p>
<p class="item-name">
<a href="#">苹果(APPLE)iPhone 4S 8G版</a>
</p>
<p class="item-info">北京电信购机</p>
<p class="item-price"><em>2098</em></p>
<p class="item-btn">
<a href="#" class="btn btn-gray">加入购物车</a>
<a href="#" class="btn btn-red">立即购买</a>
</p>
</div>
</div>
</div>
<!--//商品列表-->
<!--翻页-->
<div class="pages m20-b">
<a class="page-action page-prev-unable" href="javascript:;"><span><b class="arrow"></b>上一页</span></a>
<a class="page-num selected" href="javascript:;"><span>1</span></a>
<a class="page-num" href="javascript:;"><span>2</span></a>
<a class="page-num" href="javascript:;"><span>3</span></a>
...
<a class="page-num" href="javascript:;"><span>66</span></a>
<a class="page-action page-next" href="javascript:;"><span><b class="arrow"></b>下一页</span></a>
</div>
<!--//翻页-->
</div>
</div>
<!--//container-->
<!--footer-->
<footer class="footer" th:replace="/footer :: .footer"></footer>
<!--//footer-->
</body>
</html>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册