diff --git a/IntentsKitNewsUpdate/Application/oh-package-lock.json5 b/IntentsKitNewsUpdate/Application/oh-package-lock.json5 index 6c2400b20303214fd620c18130a90d4dfae61279..c6f99f5c73b06c5fdef7ec6f491b74b7befebe2e 100644 --- a/IntentsKitNewsUpdate/Application/oh-package-lock.json5 +++ b/IntentsKitNewsUpdate/Application/oh-package-lock.json5 @@ -5,18 +5,10 @@ "lockfileVersion": 3, "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", "specifiers": { - "@hw-agconnect/auth@^1.0.4": "@hw-agconnect/auth@1.0.4", "@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0", "@ohos/hypium@1.0.21": "@ohos/hypium@1.0.21" }, "packages": { - "@hw-agconnect/auth@1.0.4": { - "name": "@hw-agconnect/auth", - "version": "1.0.4", - "integrity": "sha512-LavuqjXEWjJTGCYy3eK03F980/4wRaIX70fEcWzxlXhXeacyQflkR4W3lq69tcCvEDZAX/heu1SZFsetYvRRGA==", - "resolved": "https://repo.harmonyos.com/ohpm/@hw-agconnect/auth/-/auth-1.0.4.har", - "registryType": "ohpm" - }, "@ohos/hamock@1.0.0": { "name": "@ohos/hamock", "version": "1.0.0", diff --git a/IntentsKitNewsUpdate/Application/oh-package.json5 b/IntentsKitNewsUpdate/Application/oh-package.json5 index 803c38c4ad1b12d8241f164dfa126ba1ee471b4c..9c374d1e67122fe1fc7a0e6632ad1c5c2903088c 100644 --- a/IntentsKitNewsUpdate/Application/oh-package.json5 +++ b/IntentsKitNewsUpdate/Application/oh-package.json5 @@ -1,9 +1,7 @@ { "modelVersion": "5.0.5", "description": "Please describe the basic information.", - "dependencies": { - "@hw-agconnect/auth": "^1.0.4" - }, + "dependencies": {}, "devDependencies": { "@ohos/hypium": "1.0.21", "@ohos/hamock": "1.0.0" diff --git a/News.ts b/News.ts deleted file mode 100644 index 024a447c440d35789b586f207f4e25f332e39577..0000000000000000000000000000000000000000 --- a/News.ts +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) Huawei Technologies Co., Ltd. 2020-2023. All rights reserved. - * Generated by the CloudDB ObjectType compiler. DO NOT EDIT! - */ - -class News { - newsId: number; - title: string = ''; - content: string = ''; - newsType: string = '图文'; - pubUserName: string; - pubUserAvatar: string; - pubDate: Date; - viewCount: number; - - constructor() { - } - - getFieldTypeMap(): Map { - let fieldTypeMap = new Map(); - fieldTypeMap.set('newsId', 'LongAutoIncrement'); - fieldTypeMap.set('title', 'String'); - fieldTypeMap.set('content', 'Text'); - fieldTypeMap.set('newsType', 'String'); - fieldTypeMap.set('pubUserName', 'String'); - fieldTypeMap.set('pubUserAvatar', 'String'); - fieldTypeMap.set('pubDate', 'Date'); - fieldTypeMap.set('viewCount', 'Integer'); - return fieldTypeMap; - } - - getClassName(): string { - return 'News'; - } - - getPrimaryKeyList(): string[] { - let primaryKeyList: string[] = []; - primaryKeyList.push('newsId'); - return primaryKeyList; - } - - getIndexList(): string[] { - let indexList: string[] = []; - indexList.push('viewCount'); - indexList.push('newsId'); - indexList.push('pubDate'); - return indexList; - } - - getEncryptedFieldList(): string[] { - let encryptedFieldList: string[] = []; - return encryptedFieldList; - } - - setNewsId(newsId: number): void { - this.newsId = newsId; - } - - getNewsId(): number { - return this.newsId; - } - - setTitle(title: string): void { - this.title = title; - } - - getTitle(): string { - return this.title; - } - - setContent(content: string): void { - this.content = content; - } - - getContent(): string { - return this.content; - } - - setNewsType(newsType: string): void { - this.newsType = newsType; - } - - getNewsType(): string { - return this.newsType; - } - - setPubUserName(pubUserName: string): void { - this.pubUserName = pubUserName; - } - - getPubUserName(): string { - return this.pubUserName; - } - - setPubUserAvatar(pubUserAvatar: string): void { - this.pubUserAvatar = pubUserAvatar; - } - - getPubUserAvatar(): string { - return this.pubUserAvatar; - } - - setPubDate(pubDate: Date): void { - this.pubDate = pubDate; - } - - getPubDate(): Date { - return this.pubDate; - } - - setViewCount(viewCount: number): void { - this.viewCount = viewCount; - } - - getViewCount(): number { - return this.viewCount; - } - - static parseFrom(inputObject: any): News { - let result = new News(); - if (!inputObject) { - return result; - } - if (inputObject.newsId) { - result.newsId = inputObject.newsId; - } - if (inputObject.title) { - result.title = inputObject.title; - } - if (inputObject.content) { - result.content = inputObject.content; - } - if (inputObject.newsType) { - result.newsType = inputObject.newsType; - } - if (inputObject.pubUserName) { - result.pubUserName = inputObject.pubUserName; - } - if (inputObject.pubUserAvatar) { - result.pubUserAvatar = inputObject.pubUserAvatar; - } - if (inputObject.pubDate) { - result.pubDate = new Date(inputObject.pubDate); - } - if (inputObject.viewCount) { - result.viewCount = inputObject.viewCount; - } - return result; - } -} - -export { News }; \ No newline at end of file diff --git a/README.md b/README.md index aa48d1703bed197202200db4d30d09d4e3571543..afa9f3a9782454ed0ff57b6ec59f550c163e8ad4 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ 本示例基于意图框架,使用@kit.IntentsKit实现意图共享,使用@kit.AbilityKit的InsightIntentExecutor实现意图调用。配合端云一体化提供的云函数,云数据库实现云端数据访问。意图框架根据端侧意图共享的参数实现云测意图调用,完成端云结合的习惯推荐实现新闻推新功能。 ## 效果预览 -| 新闻首页 | 新闻详情页 | 小艺卡片展示共享意图 | 点击意图卡片实现复访 | +| 新闻首页 | 新闻详情页 | 小艺卡片展示共享意图 | 点击意图卡片实现推新 | |-------------------------------------------------------|-----------------------------------------------------|----------------------------------------------------------------|---------------------------------------------------------------------| | ![新闻首页](screenshots/device/screenshot_001.png "新闻首页") | ![新闻详情页](screenshots/device/screenshot_002.png "新闻详情页") | ![小艺卡片展示共享意图](screenshots/device/screenshot_003.png "小艺卡片展示共享意图") | ![点击意图卡片实现复访](screenshots/device/screenshot_004.png "点击意图卡片实现复访") | diff --git a/SETUP.md b/SETUP.md index 97ba373a54b787410218092804da1466b41ab88e..c05bd26c9566b5a4527a0fa2b3a4ddace3d427b6 100644 --- a/SETUP.md +++ b/SETUP.md @@ -12,7 +12,7 @@ 2. 项目打开 - 使用[DevEco Studio](https://developer.huawei.com/consumer/cn/deveco-studio/),选择File > Open,选择“IntentsKitNewsRecommend”,点击“OK”打开项目。请注意,IntentsKitNewsRecommend目录下客户端工程(Application文件)可以作为单独项目打开,但是会编译失败;服务端工程(CloudProgram文件)仅可以通过打开IntentsKitNewsRecommend 整个项目打开。建议您直接选择打开“IntentsKitNewsRecommend”文件,同时打开客户端工程(Application文件)和服务端工程(CloudProgram文件),而不是只打开客户端工程(Application文件)。 + 选择[DevEco Studio](https://developer.huawei.com/consumer/cn/deveco-studio/),选择File > Open,选择“IntentsKitNewsUpdate”,点击“OK”打开项目。请注意,IntentsKitNewsUpdate目录下客户端工程(Application)可以作为单独项目打开,在低版本(低于当前工程使用版本 5.0.5)的DevEco Studio可能会编译失败或无法识别服务端工程(CloudProgram);服务端工程(CloudProgram)仅可以通过打开IntentsKitNewsUpdate整个项目打开。建议您直接选择打开“IntentsKitNewsUpdate”目录,保证可以同时打开客户端工程(Application)和服务端工程(CloudProgram),而不是只打开客户端工程(Application)。 ![image](screenshots/client/open_objects.PNG) diff --git a/screenshots/client/open_objects.PNG b/screenshots/client/open_objects.PNG index 6715e29929873aa1a0d247868153f3d84ff3aeea..47e3cb9dfab9b5f9adb717e78f98a38a632ccedc 100644 Binary files a/screenshots/client/open_objects.PNG and b/screenshots/client/open_objects.PNG differ