# CurriculumProjectDemo **Repository Path**: jusen/CurriculumProjectDemo ## Basic Information - **Project Name**: CurriculumProjectDemo - **Description**: 基于AppGallery Connect云数据库的项目。 - **Primary Language**: JavaScript - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2025-01-03 - **Last Updated**: 2025-01-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # CurriculumProjectDemo(课程表) #### 介绍 通过本项目,您将建立一个基于AppGallery Connect云数据库的课程表应用程序,学习如何对课程表进行增、删、改。 #### 软件要求 DevEco Studio版本:DevEco Studio NEXT Developer Beta1及以上。 HarmonyOS SDK版本:HarmonyOS NEXT Developer Beta1 SDK及以上。 #### 硬件要求 设备类型:华为平板。(可以用虚拟机平板) HarmonyOS系统:HarmonyOS NEXT Developer Beta1及以上。 #### 软件架构 软件架构说明 ![img.png](picture/1.png) #### 配置云数据库步骤 * 教程:https://developer.huawei.com/consumer/cn/doc/AppGallery-connect-Guides/agc-clouddb-sdk-integration-harmonyosts-0000001626112738 1. 确认应用包名和AGC云平台的包名一致 ![img.png](picture/2.png) ![img.png](picture/3.png) 2. “存储区名称”为“test”。 ![img.png](picture/4.png) 3. 添加YunCourseSchedules对象类型
| 字段名称 | 类型 | 主键 | 非空 | 加密 | 默认值 | 字段说明 | |----------------|------------------|----|----|----|---------|-----------| | id | IntAutoIncrement | √ | √ | - | - | 唯一 | | className | String | - | - | - | - | 课程名字 | | courseDuration | Integer | - | - | - | - | 该课程上几节 | | teacher | String | - | - | - | - | 课程老师 | | classroom | String | - | - | - | - | 教室位置 | | people | Integer | - | - | - | - | 人数 | | week | String | - | - | - | - | 星期几上 | | color | String | - | - | - | #000000 | 课程颜色 | | courseLessons | Integer | - | - | - | - | 该课程第几节开始上 | | introduction | String | - | - | - | - | 课程介绍 | | classroomtype | Integer | - | - | - | - | 教室类型 | 4. 并且按照要求设置权限
| 角色 | query | upsert | delete | |-------|-------|--------|--------| | 所有人 | √ | √ | √ | | 认证用户 | √ | √ | √ | | 数据创建者 | √ | √ | √ | | 管理员 | √ | √ | √ | 注:日常开发中不推荐对所有人授予upsert和delete权限,此处仅用于跳过认证登录步骤演示云数据库添加和删除数据,将所有人均授予upsert和delete权限。
5. 下载app-schema.json、YunCourseSchedules.js和agconnect-services.json文件
![img.png](picture/5.png) ![img.png](picture/6.png) ![img.png](picture/7.png) 6. 把刚刚下载的文件放到对应的位置
![img.png](picture/8.png)
![img.png](picture/9.png)
![img.png](picture/10.png)
7. 其余步骤可按照教程实现 * 注:确保你的存储区和对象类型与你在AGC云平台上面创建的存储区和对象类型保持一致 ![img.png](picture/11.png)
#### 使用说明 1. 确保完成”配置云数据库步骤” 2. 在entry下的module.json5中添加网络权限
![img.png](picture/12.png)
3. 在entry下的oh-package.json5中下载相关的依赖
![img.png](picture/13.png)
4. 配置自动签名,并且应用
![img.png](picture/14.png)
5. 没有真机可以下载和使用虚拟机
![img.png](picture/16.png)
![img.png](picture/17.png)
6. 完成上述一系列操作后点击运行。 #### 效果展示 * 主页面 ![img.png](picture/15.png)
* 添加(先点击你要添加的地方) ![img.png](picture/18.png)
* 修改(先选中你要修改的课程) ![img.png](picture/19.png)
* 删除(先选中你要删除的课程) ![img.png](picture/20.png)
* 预约界面 ![img.png](picture/21.png)