浏览代码

login -init

chao 4 年之前
父节点
当前提交
e68a198be4

+ 42 - 0
src/main/java/com/caimei/www/controller/authorized/AccountController.java

@@ -0,0 +1,42 @@
+package com.caimei.www.controller.authorized;
+
+import com.caimei.www.service.AccountService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+
+/**
+ * Description
+ *
+ * @author : Charles
+ * @date : 2020/7/24
+ */
+@Controller
+public class AccountController {
+
+	private static final String LOGIN_PATH = "account/login";
+	private static final String SIGN_UP_PATH = "account/sign-up";
+
+    private AccountService accountService;
+    @Autowired
+    public void setAccountService(AccountService accountService) {
+        this.accountService = accountService;
+    }
+
+    /**
+     * 登录页
+     */
+    @GetMapping("/login.html")
+    public String login() {
+        return LOGIN_PATH;
+    }
+
+    /**
+     * 注册页
+     */
+    @GetMapping("/sign-up.html")
+    public String signUp() {
+        return SIGN_UP_PATH;
+    }
+
+}

+ 0 - 24
src/main/java/com/caimei/www/controller/authorized/UserController.java

@@ -1,24 +0,0 @@
-package com.caimei.www.controller.authorized;
-
-import com.caimei.www.service.UserService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-
-/**
- * Description
- *
- * @author : Charles
- * @date : 2020/7/24
- */
-@Controller
-public class UserController {
-
-    private UserService userService;
-    @Autowired
-    public void setUserService(UserService userService) {
-        this.userService = userService;
-    }
-
-
-
-}

+ 1 - 1
src/main/java/com/caimei/www/mapper/UserDao.java → src/main/java/com/caimei/www/mapper/AccountDao.java

@@ -10,7 +10,7 @@ import org.apache.ibatis.annotations.Mapper;
  * @date : 2020/7/24
  * @date : 2020/7/24
  */
  */
 @Mapper
 @Mapper
-public interface UserDao {
+public interface AccountDao {
     /**
     /**
      * 根据Id查找用户
      * 根据Id查找用户
      * @param userId
      * @param userId

+ 1 - 1
src/main/java/com/caimei/www/service/UserService.java → src/main/java/com/caimei/www/service/AccountService.java

@@ -6,5 +6,5 @@ package com.caimei.www.service;
  * @author : Charles
  * @author : Charles
  * @date : 2020/7/24
  * @date : 2020/7/24
  */
  */
-public interface UserService {
+public interface AccountService {
 }
 }

+ 0 - 2
src/main/java/com/caimei/www/service/CommonServiceUtil.java

@@ -1,11 +1,9 @@
 package com.caimei.www.service;
 package com.caimei.www.service;
 
 
 import com.caimei.www.mapper.CommonDao;
 import com.caimei.www.mapper.CommonDao;
-import com.caimei.www.mapper.ShoppingDao;
 import com.caimei.www.pojo.order.ActivityPrice;
 import com.caimei.www.pojo.order.ActivityPrice;
 import com.caimei.www.pojo.order.CartItem;
 import com.caimei.www.pojo.order.CartItem;
 import com.caimei.www.pojo.order.LadderPrice;
 import com.caimei.www.pojo.order.LadderPrice;
-import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.CollectionUtils;
 
 

+ 4 - 4
src/main/java/com/caimei/www/service/impl/UserServiceImpl.java → src/main/java/com/caimei/www/service/impl/AccountServiceImpl.java

@@ -1,7 +1,7 @@
 package com.caimei.www.service.impl;
 package com.caimei.www.service.impl;
 
 
-import com.caimei.www.mapper.UserDao;
-import com.caimei.www.service.UserService;
+import com.caimei.www.mapper.AccountDao;
+import com.caimei.www.service.AccountService;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
@@ -13,7 +13,7 @@ import javax.annotation.Resource;
  * @date : 2020/7/24
  * @date : 2020/7/24
  */
  */
 @Service
 @Service
-public class UserServiceImpl implements UserService {
+public class AccountServiceImpl implements AccountService {
     @Resource
     @Resource
-    private UserDao userDao;
+    private AccountDao accountDao;
 }
 }

+ 0 - 4
src/main/java/com/caimei/www/service/impl/ProductServiceImpl.java

@@ -31,10 +31,6 @@ public class ProductServiceImpl implements ProductService {
     private ProductDao productDao;
     private ProductDao productDao;
     @Resource
     @Resource
     private CommonServiceUtil commonServiceUtil;
     private CommonServiceUtil commonServiceUtil;
-    /*@Autowired
-    public void setCommonServiceUtil(CommonServiceUtil commonServiceUtil) {
-        this.commonServiceUtil = commonServiceUtil;
-    }*/
     /**
     /**
      * 根据商品Id获取详情
      * 根据商品Id获取详情
      *
      *

+ 3 - 7
src/main/java/com/caimei/www/service/impl/ShoppingServiceImpl.java

@@ -1,7 +1,7 @@
 package com.caimei.www.service.impl;
 package com.caimei.www.service.impl;
 
 
 import com.caimei.www.mapper.ShoppingDao;
 import com.caimei.www.mapper.ShoppingDao;
-import com.caimei.www.mapper.UserDao;
+import com.caimei.www.mapper.AccountDao;
 import com.caimei.www.pojo.JsonModel;
 import com.caimei.www.pojo.JsonModel;
 import com.caimei.www.pojo.order.CartItem;
 import com.caimei.www.pojo.order.CartItem;
 import com.caimei.www.pojo.order.CartSupplier;
 import com.caimei.www.pojo.order.CartSupplier;
@@ -31,13 +31,9 @@ public class ShoppingServiceImpl implements ShoppingService {
     @Resource
     @Resource
     private ShoppingDao shoppingDao;
     private ShoppingDao shoppingDao;
     @Resource
     @Resource
-    private UserDao userDao;
+    private AccountDao accountDao;
     @Resource
     @Resource
     private CommonServiceUtil commonServiceUtil;
     private CommonServiceUtil commonServiceUtil;
-    /*@Autowired
-    public void setCommonServiceUtil(CommonServiceUtil commonServiceUtil) {
-        this.commonServiceUtil = commonServiceUtil;
-    }*/
     /**
     /**
      * 顶部购物车数据
      * 顶部购物车数据
      *
      *
@@ -62,7 +58,7 @@ public class ShoppingServiceImpl implements ShoppingService {
         if (userId == null || userId == 0) { return JsonModel.error("参数异常", null);}
         if (userId == null || userId == 0) { return JsonModel.error("参数异常", null);}
         List<CartSupplier> cartSuppliers = shoppingDao.getCartSuppliers(userId);
         List<CartSupplier> cartSuppliers = shoppingDao.getCartSuppliers(userId);
         List<CartItem> invalidCarts = new ArrayList<>();
         List<CartItem> invalidCarts = new ArrayList<>();
-        Account account = userDao.getUserById(userId);
+        Account account = accountDao.getUserById(userId);
         cartSuppliers.forEach(supplier -> {
         cartSuppliers.forEach(supplier -> {
             List<CartItem> cartItems = shoppingDao.getShoppingCartBySupplierId(supplier.getId(), userId);
             List<CartItem> cartItems = shoppingDao.getShoppingCartBySupplierId(supplier.getId(), userId);
             AtomicReference<Double> supplierPrice = new AtomicReference<>(0d);
             AtomicReference<Double> supplierPrice = new AtomicReference<>(0d);

+ 1 - 1
src/main/resources/mapper/UserMapper.xml → src/main/resources/mapper/AccountDao.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.caimei.www.mapper.UserDao">
+<mapper namespace="com.caimei.www.mapper.AccountDao">
 	<select id="getUserById" resultType="com.caimei.www.pojo.account.Account">
 	<select id="getUserById" resultType="com.caimei.www.pojo.account.Account">
         select  userID as id,
         select  userID as id,
         		bindMobile as mobile,
         		bindMobile as mobile,

+ 16 - 0
src/main/resources/static/css/account/login.css

@@ -0,0 +1,16 @@
+@charset "utf-8";
+li{list-style:none}
+/**
+ * PC端
+ */
+@media screen and (min-width:768px){
+
+
+}
+
+/**
+* 移动端
+*/
+@media screen and (max-width:768px){
+
+}

+ 0 - 0
src/main/resources/static/css/account/sign-up.css


+ 19 - 0
src/main/resources/static/js/account/login.js

@@ -0,0 +1,19 @@
+var loginPage = new Vue({
+    el: "#loginPage",
+    data: {
+
+    },
+    computed: {
+
+    },
+    methods: {
+
+
+    },
+    created: function () {
+
+    },
+    mounted: function () {
+        var _self = this;
+    }
+});

+ 19 - 0
src/main/resources/static/js/account/sign-up.js

@@ -0,0 +1,19 @@
+var signPage = new Vue({
+    el: "#signPage",
+    data: {
+
+    },
+    computed: {
+
+    },
+    methods: {
+
+
+    },
+    created: function () {
+
+    },
+    mounted: function () {
+        var _self = this;
+    }
+});

+ 23 - 0
src/main/resources/templates/account/login.html

@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="zh-CN" xmlns:th="https://www.thymeleaf.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="https://www.thymeleaf.org ">
+<head>
+    <title>采美365网-中国美业全方位线上交易服务互动平台,做美业,上采美</title>
+    <template th:replace="components/headLink"></template>
+    <link th:href="@{/css/account/login.css(v=${version})}" rel="stylesheet" type="text/css">
+</head>
+<body>
+<!-- 引用头部 -->
+<template th:replace="components/header"></template>
+
+<!-- 二级页面 -->
+<div id="loginPage">
+
+</div>
+
+<!-- 引入底部 -->
+<template th:replace="components/footer"></template>
+<template th:replace="components/footLink"></template>
+<script charset="utf-8" type="text/javascript" th:src="@{/js/account/login.js(v=${version})}"></script>
+</body>
+</html>

+ 23 - 0
src/main/resources/templates/account/sign-up.html

@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="zh-CN" xmlns:th="https://www.thymeleaf.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="https://www.thymeleaf.org ">
+<head>
+    <title>采美365网-中国美业全方位线上交易服务互动平台,做美业,上采美</title>
+    <template th:replace="components/headLink"></template>
+    <link th:href="@{/css/account/sign-up.css(v=${version})}" rel="stylesheet" type="text/css">
+</head>
+<body>
+<!-- 引用头部 -->
+<template th:replace="components/header"></template>
+
+<!-- 二级页面 -->
+<div id="signPage">
+
+</div>
+
+<!-- 引入底部 -->
+<template th:replace="components/footer"></template>
+<template th:replace="components/footLink"></template>
+<script charset="utf-8" type="text/javascript" th:src="@{/js/account/sign-up.js(v=${version})}"></script>
+</body>
+</html>