1
0
mirror of https://gitee.com/coder-xiaomo/flashsale synced 2025-09-12 06:51:38 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

README.md添加MVC项目结构表;数据库变动。可正常显示UserModel

This commit is contained in:
2022-03-01 17:17:29 +08:00
parent 25cc33f5bf
commit b7c3b87c3b
20 changed files with 1074 additions and 36 deletions

View File

@@ -6,4 +6,32 @@
数据库版本MySQL 5.7
项目数据库文件:[点击打开](./Others/sql/flashsale.sql)
项目数据库文件:[点击打开](./Others/sql/flashsale.sql)
### 默认用户
> 用户名密码均为 `admin`
### 本次修改通过以下方式查看👇
> http://localhost:8090/user/get?id=1
### 层次结构以User为例自上向下
| | 目录 | Java对象类型 | 说明 | 举例 |
| ----------------------------- |-----------------------| ----------------- | ----------------------- | -------------------------------- |
| **<nobr>Controller层</nobr>** | | | | |
| Controller | controller | 类 class | | controller.UserController |
| Controller | controller/viewobject | 类 class | | 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.UserDataObjectMapper |
| Mapping | resources/mapping | Mapper接口实现类 | xml格式SQL语句 | mapping/UserDataObjectMapper.xml |
| Data Object | dataobject | 类 class | | dataobject.UserDataObject |
**Tips:** Model与Data Object并非完全一一对应例如UserModel是由ServiceImpl将UserDataObject和UserPasswordDataObject组装而成的。