1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #include "create_asset_dto.h" 17 18 namespace OHOS::Media { 19 CreateAssetDto(const CreateAssetReqBody & reqBody)20CreateAssetDto::CreateAssetDto(const CreateAssetReqBody &reqBody) 21 { 22 this->mediaType = reqBody.mediaType; 23 this->photoSubtype = reqBody.photoSubtype; 24 this->title = reqBody.title; 25 this->extension = reqBody.extension; 26 this->displayName = reqBody.displayName; 27 this->cameraShotKey = reqBody.cameraShotKey; 28 } 29 CreateAssetDto(const CreateAssetForAppReqBody & reqBody)30CreateAssetDto::CreateAssetDto(const CreateAssetForAppReqBody &reqBody) 31 { 32 this->tokenId = reqBody.tokenId; 33 this->mediaType = reqBody.mediaType; 34 this->photoSubtype = reqBody.photoSubtype; 35 this->title = reqBody.title; 36 this->extension = reqBody.extension; 37 this->bundleName = reqBody.bundleName; 38 this->packageName = reqBody.packageName; 39 this->appId = reqBody.appId; 40 this->ownerAlbumId = reqBody.ownerAlbumId; 41 } 42 GetRespBody()43CreateAssetRespBody CreateAssetDto::GetRespBody() 44 { 45 CreateAssetRespBody respBody; 46 respBody.fileId = this->fileId; 47 respBody.outUri = this->outUri; 48 return respBody; 49 } 50 } // namespace OHOS::Media 51