diff --git a/board.md b/board.md new file mode 100644 index 0000000000000000000000000000000000000000..1ccc85cfb89545d823b4eb461348e7ac8ec315ad --- /dev/null +++ b/board.md @@ -0,0 +1,69 @@ +## 需求编号 + 27611790 +###需求描述 + 设备管理-BOX单板管理页提供接口支持以下功能:导入单板,编辑单板,删除单板,新增单板,单板列表,单板搜索 +###需求实现 +1. 单板管理新增 + - url: post /ci-portal/environment/equipment/v1/board + - params : BoardModel in body +2. 单板管理编辑 + - url: put /ci-portal/environment/equipment/v1/board + - params : BoardModel in body +3. 单板管理(搜索|列表) + - url: get /ci-portal/environment/equipment/v1/board + - params : QueryModel in query +4. 单板管理删除 + - url: delete /ci-portal/environment/equipment/v1/board/{boardId} + - params : String boardId in path +5. 单板管理导入 + - url: post /ci-portal/environment/equipment/v1/board/excel/upload + - params : MultipartFile in body +###业务流程 +#### 编辑单板,删除单板,新增单板,单板列表,单板搜索 + 1. 校验参数 + 失败 -> 400 failed 提示信息 + 2. 操作数据库 + 3. 返回结果 + 成功 -> 200 (success|result) +#### 单板管理导入 + 1. 读取excel数据 + 失败 -> 400 failed 提示信息 + 2. 校验数据 + 失败 -> 400 failed 提示信息 + 3. 数据入库 + 4. 返回结果 + 成功 -> 200 success +###涉及java类 +#### board 单板信息表 +| 字段 | 数据类型 | 描述 | +| --- | --- | --- | +| id | String | 单板信息的唯一标识 | +| type | String | 单板类型 | +| name | String | 单板名称 | +| sn | String | SN编号 | +| version | String | 版本 | +| level | String | 单板级别(L0、L1、L2) | +| box | Object | 管理box | +| ip | String | 管理IP | +| status | int | 状态(0:正常、1:空闲、2:故障) | +| location | String | 物理位置 | +| port | int | 端口(box的物理接口0~7) | +| userName | String | 使用人名称 | +| createUser | String | 创建人 | +| createTime | String | 创建时间 | +| updateUser | String | 更新人 | +| updateTime | String | 更新时间 | +| isDelete | String | 逻辑删除(1:逻辑删除) | + + +#### queryBoardModel 单板信息表 +| 字段 | 数据类型 | 描述 | +| --- | --- | --- | +| pageNum | int | 查询的页数 | +| pageSize | int | 每页显示的行数 | +| type | String | 单板类型 | +| level | String | 单板级别(L0、L1、L2) | +| status | int | 状态(0:正常、1:空闲、2:故障) | +| content | String | 查询的内容(适配name、sn、box、ip、userName) | + + diff --git a/ci_events-10-prod.xlsx b/ci_events-10-prod.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..fe7c576447af6ff120488210581cd7c96c7eddb4 Binary files /dev/null and b/ci_events-10-prod.xlsx differ diff --git a/ci_events-11-prod.xlsx b/ci_events-11-prod.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..ade77ecd1315544c8635ac8d5fa76fe3870a3816 Binary files /dev/null and b/ci_events-11-prod.xlsx differ diff --git a/ci_events-3.xlsx b/ci_events-3.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..c6278ebb0d9d3d8c387a6dd6dd0a38e92521859d Binary files /dev/null and b/ci_events-3.xlsx differ diff --git a/ci_events-4.xlsx b/ci_events-4.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..b793a4d99ba7d92f6eda0b52d037fb94b887a8cc Binary files /dev/null and b/ci_events-4.xlsx differ diff --git a/ci_events-5.xlsx b/ci_events-5.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..1cb73a482749c3a7f8851da6b0d1e01b6c611613 Binary files /dev/null and b/ci_events-5.xlsx differ diff --git a/ci_events-6.xlsx b/ci_events-6.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..b1dfb66f9f4b895bc40de0ea6cd4dcb5bb03db4a Binary files /dev/null and b/ci_events-6.xlsx differ diff --git a/ci_events-7.xlsx b/ci_events-7.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..b72d265271e9248cc60ce76246f68e7c560cde5b Binary files /dev/null and b/ci_events-7.xlsx differ diff --git a/ci_events-8-prod.xlsx b/ci_events-8-prod.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..59c0b30a62f2bd2f7f2e5472f018e27abc773e65 Binary files /dev/null and b/ci_events-8-prod.xlsx differ diff --git a/ci_events-9-prod.xlsx b/ci_events-9-prod.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..a23a7f3978085c863bb1c6ca64048083bf1100c3 Binary files /dev/null and b/ci_events-9-prod.xlsx differ diff --git a/ci_events.xlsx b/ci_events.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..8a778a4f350d44d8e8195c07817da9b56dc37146 Binary files /dev/null and b/ci_events.xlsx differ diff --git a/frameworks/ability_lite/src/ability.cpp b/frameworks/ability_lite/src/ability.cpp index 2d17c4dc8a076c33c4815df899e945a2aa3e9841..188dfa1fcce12e6d4a253b441d2a5d5b5e040f32 100755 --- a/frameworks/ability_lite/src/ability.cpp +++ b/frameworks/ability_lite/src/ability.cpp @@ -74,6 +74,12 @@ void Ability::OnActive(const Want &want) if ((abilityWindow_ != nullptr) && (abilityState_ == STATE_BACKGROUND)) { abilityWindow_->OnPostAbilityActive(); } + if ((abilityWindow_ != nullptr) && (abilityState_ == STATE_BACKGROUND)) { + abilityWindow_->OnPostAbilityActive(); + } + if ((abilityWindow_ != nullptr) && (abilityState_ == STATE_BACKGROUND)) { + abilityWindow_->OnPostAbilityActive(); + } #endif abilityState_ = STATE_ACTIVE; } diff --git a/services/abilitymgr_lite/src/test.cpp b/services/abilitymgr_lite/src/test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..065aaaee2490a6a99f62e058060f8e6582cd2d34 --- /dev/null +++ b/services/abilitymgr_lite/src/test.cpp @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2020 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ability_connect_mission.h" + +#include + +#include "util/abilityms_log.h" + +namespace OHOS { +AbilityConnectMission::~AbilityConnectMission() +{ + for (auto iterator = serviceRecords_.begin(); iterator != serviceRecords_.end(); ++iterator) { + auto record = *iterator; + delete record; + } + serviceRecords_.clear(); + PRINTD("AbilityConnectMission", "Constructor"); +} + +void AbilityConnectMission::PushServiceRecord(PageAbilityRecord &abilityRecord) +{ + serviceRecords_.emplace_back(&abilityRecord); +} + +PageAbilityRecord *AbilityConnectMission::FindServiceRecord(uint64_t token) const +{ + for (const auto record : serviceRecords_) { + if (record != nullptr && record->GetToken() == token) { + return record; + } + } + return nullptr; +} + +PageAbilityRecord *AbilityConnectMission::FindServiceRecord(const char *bundleName, const char *abilityName) const +{ + CHECK_NULLPTR_RETURN_PTR(bundleName, "AbilityConnectMission", "invalid argument"); + CHECK_NULLPTR_RETURN_PTR(abilityName, "AbilityConnectMission", "invalid argument"); + for (const auto record : serviceRecords_) { + if (record != nullptr) { + const char *recordBundleName = record->GetAbilityInfo().bundleName; + const char *recordAbilityName = record->GetAbilityInfo().name; + if (recordBundleName == nullptr || recordAbilityName == nullptr) { + continue; + } + if (strcmp(recordBundleName, bundleName) == 0 && strcmp(recordAbilityName, abilityName) == 0) { + return record; + } + } + } + return nullptr; +} + +PageAbilityRecord *AbilityConnectMission::FindServiceRecord(const SvcIdentity &connectSid, uint64_t abilityToken) const +{ + for (const auto record : serviceRecords_) { + if (record != nullptr && record->GetConnectRecord(connectSid, abilityToken) != nullptr) { + return record; + } + } + return nullptr; +} + +void AbilityConnectMission::RemoveServiceRecord(uint64_t token) +{ + for (auto iterator = serviceRecords_.begin(); iterator != serviceRecords_.end();) { + auto record = *iterator; + if (record != nullptr && record->GetToken() == token) { + iterator = serviceRecords_.erase(iterator); + delete record; + } else { + ++iterator; + } + } +} + +void AbilityConnectMission::RemoveServiceRecord(const char *bundleName) +{ + CHECK_NULLPTR_RETURN(bundleName, "AbilityConnectMission", "invalid argument"); + for (auto iterator = serviceRecords_.begin(); iterator != serviceRecords_.end();) { + auto record = *iterator; + if (record != nullptr && record->IsSamePageAbility(bundleName)) { + AbilityMsStatus status = record->StopAbilityDone(); + if (!status.IsOk()) { + PRINTW("RemoveServiceRecord", "service disconnectDoneTransaction failed"); + } + iterator = serviceRecords_.erase(iterator); + delete record; + } else { + ++iterator; + } + } +} + +int32_t AbilityConnectMission::CountServiceInApp(const char *bundleName) +{ + if (bundleName == nullptr) { + return 0; + } + int32_t retVal = 0; + for (const auto record : serviceRecords_) { + if (record == nullptr) { + continue; + } + if (record->GetAbilityInfo().bundleName != nullptr && + strcmp(record->GetAbilityInfo().bundleName, bundleName) == 0) { + retVal++; + } + } + return retVal; +} + +#ifdef OHOS_DEBUG +AbilityMsStatus AbilityConnectMission::DumpConnectMission() const +{ + if (serviceRecords_.empty()) { + return AbilityMsStatus::DumpStatus(""); + } + std::string connectInfo = "ConnectMission: \n"; + AbilityMsStatus result = AbilityMsStatus::DumpStatus(connectInfo.c_str()); + for (const auto target : serviceRecords_) { + if (target != nullptr) { + result.DumpAppend(target->DumpAbilityRecord()); + } + } + return result; +} +#endif + +void AbilityConnectMission::RemoveConnectRecordByPageToken(uint64_t token, const char *bundleName) +{ + CHECK_NULLPTR_RETURN(bundleName, "AbilityConnectMission", "invalid argument"); + for (auto iterator = serviceRecords_.begin(); iterator != serviceRecords_.end(); ++iterator) { + auto record = *iterator; + if (record != nullptr && record->GetAbilityInfo().bundleName != nullptr && + strcmp(record->GetAbilityInfo().bundleName, bundleName) != 0) { + record->RemoveConnectRecordByPageToken(token); + } + } +} +} // namespace OHOS diff --git a/test.cpp b/test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5da5bc9d0a6a08b2747b06b802aa7006df186745 --- /dev/null +++ b/test.cpp @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2020 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *trggrdgsdgdfgsdfgsf + * http://www.apache.org/licenses/LICENSE-2.0 + *gergerger + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License.gfhfghsdfhgddf + */ +/\\\fgdgdffsdfsd +#include "ability_connect_mission.h" +\\\\\\\\\\\\\ +#include +\\\\\\\\\\ +#include "util/abilityms_log.h" +\\\\\\\\\\\\ +namespace OHOS { +AbilityConnectMission::~AbilityConnectMission() +{ + for (auto iterator = serviceRecords_.begin(); iterator != serviceRecords_.end(); ++iterator) { + auto record = *iterator; + delete record; + } + serviceRecords_.clear(); + PRINTD("AbilityConnectMission", "Constructor"); +}\\\\\\ +\\\\\\\\\\\\\\\\\\\\\ +void AbilityConnectMission::PushServiceRecord(PageAbilityRecord &abilityRecord) +{\\\\\\\\\\\\ + serviceRecords_.emplace_back(&abilityRecord); +} + +PageAbilityRecord *AbilityConnectMission::FindServiceRecord(uint64_t token) const +{ + for (const auto record : serviceRecords_) { + if (record != nullptr && record->GetToken() == token) { + return record; + } + } + return nullptr; +} + +PageAbilityRecord *AbilityConnectMission::FindServiceRecord(const char *bundleName, const char *abilityName) const +{ + CHECK_NULLPTR_RETURN_PTR(bundleName, "AbilityConnectMission", "invalid argument"); + CHECK_NULLPTR_RETURN_PTR(abilityName, "AbilityConnectMission", "invalid argument"); + for (const auto record : serviceRecords_) { + if (record != nullptr) { + const char *recordBundleName = record->GetAbilityInfo().bundleName; + const char *recordAbilityName = record->GetAbilityInfo().name; + if (recordBundleName == nullptr || recordAbilityName == nullptr) { + continue; + } + if (strcmp(recordBundleName, bundleName) == 0 && strcmp(recordAbilityName, abilityName) == 0) { + return record; + } + } + } + return nullptr; +} +\\\\\\\\\\\\\\\\\\\\\ +PageAbilityRecord *AbilityConnectMission::FindServiceRecord(const SvcIdentity &connectSid, uint64_t abilityToken) const +{ + for (const auto record : serviceRecords_) { + if (record != nullptr && record->GetConnectRecord(connectSid, abilityToken) != nullptr) { + return record; + } + } + for (const auto record : serviceRecords_) { + if (true) { + return record; + } + } + return nullptr; +} + +void AbilityConnectMission::RemoveServiceRecord(uint64_t token) +{ + for (auto iterator = serviceRecords_.begin(); iterator != serviceRecords_.end();) { + auto record = *iterator; + if (record != nullptr && record->GetToken() == token) { + iterator = serviceRecords_.erase(iterator); + delete record; + } else { + ++iterator; + } + } +} + +void AbilityConnectMission::RemoveServiceRecord(const char *bundleName) +{ + CHECK_NULLPTR_RETURN(bundleName, "AbilityConnectMission", "invalid argument"); + for (auto iterator = serviceRecords_.begin(); iterator != serviceRecords_.end();) { + auto record = *iterator; + if (record != nullptr && record->IsSamePageAbility(bundleName)) { + AbilityMsStatus status = record->StopAbilityDone(); + if (!status.IsOk()) { + PRINTW("RemoveServiceRecord", "service disconnectDoneTransaction failed"); + } + iterator = serviceRecords_.erase(iterator); + delete record; + } else { + ++iterator; + } + } +} + +int32_t AbilityConnectMission::CountServiceInApp(const char *bundleName) +{ + if (bundleName == nullptr) { + return 0; + } + int32_t retVal = 0; + for (const auto record : serviceRecords_) { + if (record == nullptr) { + continue; + } + if (record->GetAbilityInfo().bundleName != nullptr && + strcmp(record->GetAbilityInfo().bundleName, bundleName) == 0) { + retVal++; + } + } + return retVal; +} + +#ifdef OHOS_DEBUG +AbilityMsStatus AbilityConnectMission::DumpConnectMission() const +{ + if (serviceRecords_.empty()) { + return AbilityMsStatus::DumpStatus(""); + } + std::string connectInfo = "ConnectMission: \n"; + AbilityMsStatus result = AbilityMsStatus::DumpStatus(connectInfo.c_str()); + for (const auto target : serviceRecords_) { + if (target != nullptr) { + result.DumpAppend(target->DumpAbilityRecord()); + } + } + return result; +} +#endif + +void AbilityConnectMission::RemoveConnectRecordByPageToken(uint64_t token, const char *bundleName) +{ + CHECK_NULLPTR_RETURN(bundleName, "AbilityConnectMission", "invalid argument"); + for (auto iterator = serviceRecords_.begin(); iterator != serviceRecords_.end(); ++iterator) { + auto record = *iterator; + if (record != nullptr && record->GetAbilityInfo().bundleName != nullptr && + strcmp(record->GetAbilityInfo().bundleName, bundleName) != 0) { + record->RemoveConnectRecordByPageToken(token); + } + } +} +} // namespace OHOS