1
0
mirror of https://gitee.com/coder-xiaomo/flashsale synced 2025-01-10 19:58:14 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
flashsale/README.md
2022-03-01 18:32:59 +08:00

47 lines
3.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 电商基础秒杀项目
项目简介基于SpringBoot数据库使用MySQL
开发工具IntelliJ IDEA 2021.3.2 (Ultimate Edition)
数据库版本MySQL 5.7
项目数据库文件:[点击打开](./Others/sql/flashsale.sql)
### 默认用户
> 用户名密码均为 `admin`
### 本次修改通过以下方式查看👇
> http://localhost:8090/user/get?id=2
预期效果:
```json
{"data":{"errCode":10002,"errMsg":"未知错误"},"status":"fail"}
```
### 层次结构以User为例自上向下
| | 目录 | Java对象类型 | 说明 | 举例 |
| ----------------------------- | --------------------- | ----------------- | ---------------------------------------- | ---------------------------- |
| **<nobr>Controller层</nobr>** | | | | |
| Controller | controller | 类 class | | controller.UserController |
| View Object | controller/viewobject | 类 class | 将用户Model转化为可供UI使用的View Object | controller.UserController |
| | | | | |
| **<nobr>Service层</nobr>** | 转换成业务模型 | | | |
| Service | service | 接口 interface | | service.UserService |
| ServiceImpl | service/impl | Service接口实现类 | 将DataObject组装成Model | service.impl.UserServiceImpl |
| Model | service/model | 类 class | 用户模型Model | service.model.UserModel |
| | | | | |
| **<nobr>Dao层</nobr>** | 对数据库的映射 | | | |
| Mapper | dao | 接口 interface | | dao.UserDOMapper |
| Mapping | resources/mapping | Mapper接口实现类 | xml格式SQL语句 | mapping/UserDOMapper.xml |
| Data Object | dataobject | 类 class | | dataobject.UserDO |
**Tips:** Model与Data Object并非完全一一对应例如UserModel是由ServiceImpl将UserDO和UserPasswordDO组装而成的。
response: 用于处理HTTP请求返回
error: 用于返回错误信息