# newsApp-springBoot **Repository Path**: simows/newsApp-springBoot ## Basic Information - **Project Name**: newsApp-springBoot - **Description**: newsApp 的后端,使用springboot - **Primary Language**: Java - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 4 - **Forks**: 0 - **Created**: 2020-06-23 - **Last Updated**: 2021-07-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # newsApp-springBoot ## 介绍 <<<<<<< HEAD newsApp 的后端,使用springboot ## 后端todo ### ~~数据库设计~~ + 用户表(user) + 分类表(tab) + 文章表(news) + 资源表(res) + 评论表(eva) #### 用户表~~user~~ > 注:chars 泛指在数据库的字符串类型 | 字段 | 类型 | 取值 | 注释 | | ---------------- | -------- | --------------------------------------- | ------------------ | | user_id | int | | 主键 | | user_name | chars | "这是一个用户名" | | | user_avatar | chars | "http://doc.cms.7yue.pro/left-logo.png" | 用户头像 | | user_sex | int | 0、1 | 0 男、1 女 | | user_password | chars | "密码" | | | user_phone | int | 13720367476 | 电话号码 | | user_mail | chars | "1394260116@qq.com" | 邮箱 | | user_create_date | dateTime | "2020-3-3 12:30:56" | 账号创建时间 | | user_modify_date | dateTime | "2020-3-3 12:30:56" | 账号修改时间 | | user_role | int | | 用户角色id(预留) | | user_status | int | 0 、1 | 0 不可用、1 可用 | #### 分类表tab | 字段 | 类型 | 取值 | 注释 | | ------------- | ----- | ------ | ------------------------- | | tab_id | int | | 主键 | | tab_name | chars | "java" | 分类名称 | | tab_top | int | 0、1 | 0 不是顶级目录、1顶级目录 | | tab_father_id | int | | 父级目录id | | tab_status | int | 0 、1 | 1 可用, 0 否 | #### 文章表news | 字段 | 类型 | 取值 | 注释 | | ---------------- | -------- | ------------------- | ---------------------- | | news_id | int | | 主键 | | news_title | chars | "这是一个文章标题" | | | news_author | int | 1 | 作者id | | news_create_date | dateTime | "2020-3-3 12:30:56" | 创建时间 | | news_modify_date | dateTime | "2020-3-3 12:30:56" | 修改时间 | | news_type_id | int | 1,2,3, | 对于前端文章列表样式 | | news_video | int | 0 、1 | 1 是vidoe 0 否 | | news_video_url | chars | | video 链接(**todo**) | | news_images | chars | **to do** | 图片url 列表 | | news_content | chars | "" | 富文本 | | news_private | int | 0 、1 | 1 仅作者可见 0 | | news_status | int | 0 、1 | 1 可用, 0 否 | | news_zan | int | | 点赞数目 | #### 资源表res | 字段 | 类型 | 取值 | 注释 | | --------------- | -------- | --------------------------------------- | ---------------- | | res_id | int | | 主键 | | res_url | chars | "http://doc.cms.7yue.pro/left-logo.png" | 资源url | | res_create_date | dateTime | "2020-3-3 12:30:56" | 创建时间 | | res_modify_date | dateTime | "2020-3-3 12:30:56" | 修改时间 | | res_type | int | | 资源类型(预留) | | res_status | int | 0 、1 | 1 可用, 0 否 | #### 评论表eva | 字段 | 类型 | 取值 | 注释 | | ----------------- | -------- | ------------------- | ------------- | | eva_id | int | | 主键 | | eva_news_id | int | | 文章id | | eva_content | chars | "这是一条文章评论" | | | eva_create_date | dateTime | "2020-3-3 12:30:56" | 创建时间 | | eva_modify_date | dateTime | "2020-3-3 12:30:56" | 修改时间 | | eva_author | int | | 作者id | | eva_status | int | 0 、1 | 1 可用, 0 否 | | eva_author_name | chars | " 小明" | 用户名 | | eva_author_avatar | chars | | 用户头像 | ### 搭建springBoot 开发环境 #### 技术选型 #### 接口设计 | 名称 | url | 参数 | 返回 | | ------- | -------- | :--: | ------------------------------------------------------------ | | tabList | /tabList | 无 | `{ "status": "ture", "code": 200, "tabList": [ { "name": "关注", "id": "1" }, { "name": "推荐", "id": "2" }, { "name": "体育", "id": "3" }, { "name": "热点", "id": "4" }, { "name": "财经", "id": "5" }, { "name": "娱乐", "id": "6" }, { "name": "军事", "id": "7" }, { "name": "历史", "id": "8" }, { "name": "本地", "id": "9" }, { "name": "国外", "id": "10" } ] }` | | | | | | ### 代码实现TO + ~~封装 response ,添加状态码,和状态描述~~ + json 序列化配置 + json ~~数据前后统一~~ + ~~接口对接~~ + 添加事物处理,支持回滚 + 权限管理 + @validate ### 后台管理系统TO #### 技术架构选型 + 页面渲染 thymeleaf + springboot + API 文档框架 swagger + 权限管理架构shiro ======= newsApp 的后端,使用springboot ## 后端todo ### ~~数据库设计~~ + 用户表(user) + 分类表(tab) + 文章表(news) + 资源表(res) + 评论表(eva) #### 用户表~~user~~ > 注:chars 泛指在数据库的字符串类型 | 字段 | 类型 | 取值 | 注释 | | ---------------- | -------- | --------------------------------------- | ------------------ | | user_id | int | | 主键 | | user_name | chars | "这是一个用户名" | | | user_avatar | chars | "http://doc.cms.7yue.pro/left-logo.png" | 用户头像 | | user_sex | int | 0、1 | 0 男、1 女 | | user_password | chars | "密码" | | | user_phone | int | 13720367476 | 电话号码 | | user_mail | chars | "1394260116@qq.com" | 邮箱 | | user_create_date | dateTime | "2020-3-3 12:30:56" | 账号创建时间 | | user_modify_date | dateTime | "2020-3-3 12:30:56" | 账号修改时间 | | user_role | int | | 用户角色id(预留) | | user_status | int | 0 、1 | 0 不可用、1 可用 | #### 分类表tab | 字段 | 类型 | 取值 | 注释 | | ------------- | ----- | ------ | ------------------------- | | tab_id | int | | 主键 | | tab_name | chars | "java" | 分类名称 | | tab_top | int | 0、1 | 0 不是顶级目录、1顶级目录 | | tab_father_id | int | | 父级目录id | | tab_status | int | 0 、1 | 1 可用, 0 否 | #### 文章表news | 字段 | 类型 | 取值 | 注释 | | ---------------- | -------- | ------------------- | ---------------------- | | news_id | int | | 主键 | | news_title | chars | "这是一个文章标题" | | | news_author | int | 1 | 作者id | | news_create_date | dateTime | "2020-3-3 12:30:56" | 创建时间 | | news_modify_date | dateTime | "2020-3-3 12:30:56" | 修改时间 | | news_type_id | int | 1,2,3, | 对于前端文章列表样式 | | news_video | int | 0 、1 | 1 是vidoe 0 否 | | news_video_url | chars | | video 链接(**todo**) | | news_images | chars | **to do** | 图片url 列表 | | news_content | chars | "" | 富文本 | | news_private | int | 0 、1 | 1 仅作者可见 0 | | news_status | int | 0 、1 | 1 可用, 0 否 | | news_zan | int | | 点赞数目 | #### 资源表res | 字段 | 类型 | 取值 | 注释 | | --------------- | -------- | --------------------------------------- | ---------------- | | res_id | int | | 主键 | | res_url | chars | "http://doc.cms.7yue.pro/left-logo.png" | 资源url | | res_create_date | dateTime | "2020-3-3 12:30:56" | 创建时间 | | res_modify_date | dateTime | "2020-3-3 12:30:56" | 修改时间 | | res_type | int | | 资源类型(预留) | | res_status | int | 0 、1 | 1 可用, 0 否 | #### 评论表eva | 字段 | 类型 | 取值 | 注释 | | ----------------- | -------- | ------------------- | ------------- | | eva_id | int | | 主键 | | eva_news_id | int | | 文章id | | eva_content | chars | "这是一条文章评论" | | | eva_create_date | dateTime | "2020-3-3 12:30:56" | 创建时间 | | eva_modify_date | dateTime | "2020-3-3 12:30:56" | 修改时间 | | eva_author | int | | 作者id | | eva_status | int | 0 、1 | 1 可用, 0 否 | | eva_author_name | chars | " 小明" | 用户名 | | eva_author_avatar | chars | | 用户头像 | ### 搭建springBoot 开发环境 #### 技术选型 #### 接口设计 | 名称 | url | 参数 | 返回 | | ------- | -------- | :--: | ------------------------------------------------------------ | | tabList | /tabList | 无 | `{ "status": "ture", "code": 200, "tabList": [ { "name": "关注", "id": "1" }, { "name": "推荐", "id": "2" }, { "name": "体育", "id": "3" }, { "name": "热点", "id": "4" }, { "name": "财经", "id": "5" }, { "name": "娱乐", "id": "6" }, { "name": "军事", "id": "7" }, { "name": "历史", "id": "8" }, { "name": "本地", "id": "9" }, { "name": "国外", "id": "10" } ] }` | | | | | | ### 代码实现TO + ~~封装 response ,添加状态码,和状态描述~~ + json 序列化配置 + json ~~数据前后统一~~ + ~~接口对接~~ + 添加事物处理,支持回滚 + 权限管理 + @validate ### 后台管理系统TO #### 技术架构选型 + 页面渲染 thymeleaf + springboot + API 文档框架 swagger + 权限管理架构shiro >>>>>>> 8099b7d14dd22e291fbc8b9dac3a0c046b24ab41 #### 可选架构方案 + 二开lincms + 基于element-admin 设计 + 从头开始,vue初始项目+bootstrap后台模板 + **二开meethere** #### 目前遇到的问题 1. 选用哪种开发方案 **二开meethere** 2. 管理系统的后端是否和前台后端合并,不合并意味着工作量,和前后适配的问题,如用户表 **合并开发** #### 开发 ##### 登录 + ~~整合shrio~~ + ~~登录页面~~ + ~~调试接口~~ ##### 后台欢迎页面 + 路由调整 ##### 文章列表页面 + ~~分页 查询实现~~ + 页面结构调整 + 修改 删除 查询 添加 按钮 ##### 修改/添加页面 + ~~整合 Tymice~~ + ~~文章类型选择~~ + 页面渲染 ##### 个人信息页面 + 修改 ##### 已发现的问题 + ~~image url 返回时要使用绝对地址~~ 通过在前端加上 serverUrl 解决 ##### ## 发展与重构 结合课程,转化为在线教育app ## 安装教程 1. xxxx 2. xxxx 3. xxxx ## 使用说明 1. xxxx 2. xxxx 3. xxxx ## 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request <<<<<<< HEAD 6. https://gitee.com/gitee-stars/) ======= 5. https://gitee.com/gitee-stars/) >>>>>>> 8099b7d14dd22e291fbc8b9dac3a0c046b24ab41