~aleteoryx/muditaos

ref: 22d9134476faadbdb0f0f45e2bd796f9d4b754ae muditaos/module-db/queries/messages/sms/QuerySMSGetByThreadID.hpp -rw-r--r-- 1.6 KiB
22d91344 — Lefucjusz [MOS-1052] Change VoLTE label from 'beta' to 'experimental' 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include <Tables/ThreadsTable.hpp>
#include <Common/Query.hpp>
#include <string>
#include "Interface/SMSRecord.hpp"

namespace db::query
{

    class SMSGetByThreadID : public Query
    {
      public:
        unsigned int threadId;
        unsigned int limit;
        unsigned int offset;

        explicit SMSGetByThreadID(unsigned int id, unsigned int limit = 0, unsigned int offset = 0);
        [[nodiscard]] auto debugInfo() const -> std::string override;
    };

    class SMSGetByThreadIDWithTotalCount : public SMSGetByThreadID
    {
      public:
        SMSGetByThreadIDWithTotalCount(unsigned int threadId, std::size_t limit, std::size_t offset);
        [[nodiscard]] auto debugInfo() const -> std::string override;
    };

    class SMSGetByThreadIDResult : public QueryResult
    {
        std::vector<SMSRecord> result;

      public:
        SMSGetByThreadIDResult(std::vector<SMSRecord> result);
        [[nodiscard]] auto getResults() const -> std::vector<SMSRecord>;
        [[nodiscard]] auto debugInfo() const -> std::string override;
    };

    class SMSGetByThreadIDResultWithTotalCount : public SMSGetByThreadIDResult
    {
      public:
        SMSGetByThreadIDResultWithTotalCount(std::vector<SMSRecord> records, std::size_t totalCount);
        [[nodiscard]] auto debugInfo() const -> std::string override;
        auto getTotalCount() const -> std::size_t;

      private:
        std::size_t totalCount;
    };

} // namespace db::query