Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
huanghj96 committed Jun 25, 2024
2 parents a652d06 + 2b51d70 commit 22c8ec6
Show file tree
Hide file tree
Showing 22 changed files with 294 additions and 260 deletions.
31 changes: 22 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

![frontend](https://img.shields.io/badge/Front_End-Vue-green)
![backend](https://img.shields.io/badge/Back_End-Springboot-yellow)
![version](https://img.shields.io/badge/Version-0.3.2-blue)
![version](https://img.shields.io/badge/Version-0.4.1-blue)
![license](https://img.shields.io/github/license/wi1sonh/cloudmall?color=FF5531)

"云端商城" 是一个创新驱动的电子商务平台,致力于提供全面的在线销售和购物服务。通过集成前沿技术,"云端商城" 旨在创建一个动态、互动和智能化的购物环境,满足现代消费者的需求并助力商家扩展业务。
~~你说得对,但是~~云端商城”是一个诞生于 SYSU 软件工程课程的小型电子商务平台,致力于提供全面的在线销售和购物服务。通过集成前沿的前后端框架技术,"云端商城" 旨在创建一个动态、互动和体验优秀的购物环境,满足现代消费者的需求并助力商家扩展业务。

---

Expand All @@ -21,9 +21,18 @@
6. **后台管理系统**:为商家提供商品和订单管理,数据统计等后台功能。
7. **数据分析与报告**:提供销售数据和用户行为分析,辅助商家决策。

运行截图:
| 登录页 ![login](images/login.png) | 商家控制台页 ![control](images/control_board.png) |
| --------------------------------- | ------------------------------------------------- |
商家管理端运行截图:

| 登录页![login](images/login.png) | 商家控制台页![control](images/control_board.png) |
| ------------------------------ | ---------------------------------------------- |

| 订单管理![login](images/s1.png) | 商品管理![login](images/s2.png) | 数据统计![login](images/s3.png) |
| - | - | - |

客户小程序运行截图:

| ![mp1](images/mp1.jpg) | ![mp2](images/mp2.jpg) | ![mp3](images/mp3.jpg) | ![mp4](images/mp4.jpg) | ![mp5](images/mp5.jpg) |
| - | - | - | - | - |

## 技术选型

Expand Down Expand Up @@ -63,20 +72,24 @@ npm run dev

**启动后端:**

首先导入数据库,在mysql命令行输入`source /path/to/cloudmall_database.sql`即可
首先导入数据库,在mysql命令行输入 `source /path/to/cloudmall_database.sql`即可

在 IDEA 单独打开后端子项目 cloudmall-springboot3,并手动连接数据库(参考网上教程,最好使用**IDEA专业版****注意**需要修改`cloudmall-springboot3\server\src\main\resources\application-dev.yml`第6行为本地mysql设置的密码;若要启动小程序,还需要在底下修改redis密码,以及appid和secret, 且`cloudmall-uniapp\src\manifest.json`的appid也需要修改)
在 IDEA 单独打开后端子项目 cloudmall-springboot3,并手动连接数据库(参考网上教程,最好使用**IDEA专业版****注意**需要修改 `cloudmall-springboot3\server\src\main\resources\application-dev.yml`第6行为本地mysql设置的密码;若要启动小程序,还需要在底下修改redis密码,以及appid和secret, 且 `cloudmall-uniapp\src\manifest.json`的appid也需要修改)

在 IDEA 右侧边栏的 `Maven -> cloudmall -> Lifecycle -> compile` 编译 root 目录,然后即可运行 `ServerApplication` 主函数

**启动小程序端:**

进入 cloudmall-uniapp 目录执行 `npm i` 进行包安装,接着执行`npm run dev:mp-weixin`进行编译,之后修改uniapp的内容时,微信开发者工具里编译好的内容也会相应作出修改(有时不会生效,需要重启微信开发者工具才行)
进入 cloudmall-uniapp 目录执行 `npm i` 进行包安装,接着执行 `npm run dev:mp-weixin`进行编译,之后修改uniapp的内容时,微信开发者工具里编译好的内容也会相应作出修改(有时不会生效,需要重启微信开发者工具才行)

下载[微信开发者工具](https://developers.weixin.qq.com/miniprogram/dev/devtools/stable.html)申请正式app id,导入`cloudmall-uniapp/dist/mp-weixin` 这部分内容即可
下载[微信开发者工具](https://developers.weixin.qq.com/miniprogram/dev/devtools/stable.html)申请正式 app id,并使用 secret,导入 `cloudmall-uniapp/dist/mp-weixin` 这部分内容即可

小程序端还需要启动本地 redis 数据库,连接过程和 mysql 差不多(但 redis 连接时不需要输入 username)

## 云服务器部署步骤

详见[云服务器部署文档](doc/云服务器部署文档.md)

## 前端代码说明

### vue3网页代码结构
Expand Down
51 changes: 43 additions & 8 deletions cloudmall-springboot3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,48 @@
</dependency>
</dependencies>

<!-- <build>-->
<!-- <plugins>-->
<!-- <plugin>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
<!-- </plugin>-->
<!-- </plugins>-->
<!-- </build>-->
<build>
<plugins>
<!-- <plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin> -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
<configuration>
<dataFile>server/target/jacoco.exec</dataFile>
<outputDirectory>server/target/jacoco-ut</outputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>

</plugins>
</build>

</project>
10 changes: 5 additions & 5 deletions cloudmall-springboot3/server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,7 @@
<version>2.9.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

<build>
Expand All @@ -164,6 +160,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ cloudmall:
password: 123456 # 根据本地redis设的密码自行修改
database: 1
wechat:
appid: wxd735f433d50fa46a # 根据你申请的appid自行修改
secret: 2595ecdf6dde8e32762596c0652d1687 # 根据你申请的appid密钥自行修改
appid: wx943527871f8bad46 # 根据你申请的appid自行修改
secret: 10b6efd9743d66b671f70ec19b1fe696 # 根据你申请的appid密钥自行修改
# 别人的文件,由于没企业商户号,这里只是摆设
mchid: 1561414331
mchSerialNo: 4B3B3DC35414AD50B1B755BAF8DE9CC7CF407606
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,23 @@

import com.jayway.jsonpath.JsonPath;
import fun.cmgraph.constant.StatusConstant;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.*;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.transaction.annotation.Transactional;

import fun.cmgraph.utils.HttpClientUtil;

import java.math.BigDecimal;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.*;

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@AutoConfigureMockMvc
@ActiveProfiles("test")
@Transactional
public class UserOperationTests {
public class UserServerIntegrationTests {

@Autowired
private MockMvc mockMvc;
Expand All @@ -51,8 +46,14 @@ public class UserOperationTests {
private int bundleId;
private int addressId;

@BeforeEach
public void setUp() {
@BeforeAll
static public void setUp() {
Mockito.mockStatic(HttpClientUtil.class);
}

@AfterAll
static public void tearDown() {
Mockito.clearAllCaches();
}

@Test
Expand All @@ -77,7 +78,6 @@ public void userOperationTest() throws Exception {

public void userLogin() throws Exception {
// test login
mockStatic(HttpClientUtil.class);
when(HttpClientUtil.doGet(anyString(), anyMap())).thenReturn("{\"openid\":\"test-openid\"}");
String loginUrl = "/user/user/login";
String loginRequestBody = "{\"code\":\"test-code\"}";
Expand Down
Loading

0 comments on commit 22c8ec6

Please sign in to comment.