Skip to main content

Tài liệu tích hợp CRM_IOT

TàTài liệu títích hợp RalliSmart CRM V2

A. Phần dàdành cho Back_end

Trong quáquá trìtrình sử dụng ứng dụng RalliSmart, người dùdùng cócó thể cócó cácác khiếu nại hoặc yêyêu cầu về hệ thống, do đóó họ muốn cócó một chức năng phùphù hợp với việc gửi cácác khiếu nại nànày.

CRM làlà phần mềm quản lýlý vàvà chăm sósóc khákhách hàhàng, đâây sẽ làlà nơi tiếp nhận cácác yêyêu cầu của RalliSmart.

Việc títích hợp tàtài khoản/ người dùdùng của RalliSmart vàvà CRM từ đóó trở nênên cần thiết, phục vụ cho việc gửi, xử lýlý cácác yêyêu cầu cũng như gửi cácác thôthông bábáo cho người dùdùng.

Với mỗi người dùdùng/ tàtài khoản đăng nhập trêtrên RalliSmart, CRM sẽ cócó một khákhách hàhàng lẻ tương ứng, đâây sẽ làlà đối tượng tham gia vàvào cácác vấn đề pháphát sinh.

Lưu ýý: Với hiện thống hiện tại của CRM, chỉ cho phéphép tạo khákhách hàhàng lẻ khi cung cấp sdt, do đóó chỉ những tàtài khoản chứa thôthông tin sdt trêtrên RalliSmart mới cócó thể sử dụng títính năng nànày

Kiến trútrúc hệ thống

IOT_EBE
CRM_IOT
CRM_IOT DB
CRM
CRM DB

1. Lấy token để call API tới CRM-IOT

STT Trường dữ liệu Dạng Ghi chúchú
rpc/portal/service-profile/login POST    
1 Code String TêTên tàtài khoản: PORTAL_CODE
2 Password String Mật khẩu: PORTAL_PASSWORD
3 AliasUserId Long UserId: 1 ( sẽ cập nhật lại khi BA tạo tàtài khoản dùdùng để títích hợp)
4 AliasTypeId Long TypeId: 1
5 Token String Response trả về Token để call API
  • ThôThông tin tàtài khoản ServiceUser được cung cấp bởi đội pháphát triển Portal vàvà được lưu trong appsettings
  "ExternalServices": {
    "CRMAccount": {
      "Code" : "{PORTAL_CODE}",
      "Password" : "{PORTAL_PASSWORD}",
      "AliasUserId": "{ALIAS_USER_ID}",
      "AliasUserType": "{ALIAS_USER_TYPE_ID}"
    },
    "CRMSecret" : "{CRM_SECRET}"
  }
TàTài khoản Mật khẩu
PORTAL_CODE PORTAL_PASSWORD

Sample Request

{
  "code": "{PORTAL_CODE}",
  "aliasTypeId": {ALIAS_USER_ID},
  "aliasUserId": {ALIAS_USER_TYPE_ID},
  "password": "{PORTAL_PASSWORD}"
}

Sample Response

{
  "code": "{PORTAL_CODE}",
  "aliasTypeId": {ALIAS_USER_ID},
  "aliasUserId": {ALIAS_USER_TYPE_ID},
  "password": null,
  "token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1laWRlbnRpZmllciI6IjQzMTkwIiwiaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvd3MvMjAwNS8wNS9pZGVudGl0eS9jbGFpbXMvbmFtZSI6IlJhbGxpU21hcnQiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3ByaW1hcnlzaWQiOiI5OTE2ZGMzMi01YmM0LTQ4NzAtYjU1MS04YjQyZGNiNDM3ZWYiLCJVc2VyVHlwZSI6IjEiLCJuYmYiOjE2ODcyNDU2ODgsImV4cCI6MTY4NzI4ODg4OH0.odIXaIu5pdkseBQgt7oKK5_6lL_9F2_J1LNV2pt6im7OHJ_gahSRhv45ZoLb6iwLZa7R6snkKnPgu_4Z_NAjLT0cghTFW2eu41fp3q-YbL72-8y5wmMzD2vYzQAVG1cNR3YNoqjCoItT9V3FxLK6jh7xoM77mrBTeWS4LeYd31oyUNEmMe_0B_43OKbflcJRc2r0TYTyJmUzrTiAdKiJm0lD-8jYrY3U_n_57ECZWsamLJh4qNxkIWGLfUM-Uzwc_1Oo9UUAFjS1jfM_wp4eD3hHIc11Qpd2Psd0stm_GUW9NhaJg-5bbMcPD2mJDZAbr3T8VRFN-oL2jSoJBki0Dw",
  "expiredTime": "2023-06-20T19:21:28.789Z",
  "informations": null,
  "warnings": null,
  "errors": null,
  "disabled": null,
  "generalInformations": [],
  "generalWarnings": [],
  "generalErrors": []
}

2. Đồng bộ khákhách hàhàng:

  • Mỗi tàtài khoản sử dụng RalliSmart được xem làlà một KháKhách hàhàng lẻ của hệ thống CRM. Một hoặc nhiều tàtài khoản RalliSmart sẽ được gágán với 1 KháKhách hàhàng lẻ trêtrên CRM, phục vụ việc chăm sósóc khákhách hàhàng.
RalliSmartIOT.EBECRM-IOTCRMThông tin tài khoản Rallialt[Trùng Sdt][Không][Không]alt[Có]alt[RS_Id đã map với KH][RS_ID chưa map với KH]Tạo mới/ cập nhật tài khoản1Lấy Token2Token3Tích hợp tài khoản4Kiểm tra RS_Id5Thêm sdt,email vào KH nếu thiếu6Sync KH7Tạo mới/ cập nhật thành công8Account RS có Sdt9So sách Sdt với KH lẻ đã có10Map RS với KH11Tạo mới/ cập nhật thành công12Tạo KH mới với thông tin sdt,email của RS13Map RS_ID với KH mới14Tạo mới/ cập nhật thành công15Thông báo tài khoản RS chưa có sdt16RalliSmartIOT.EBECRM-IOTCRM

API :

rpc/crm-iot/customer/sync

Phương thức : POST

Header :

Content-Type: application/json

Cookie: Token = {token} (token lấy được từ bước 1)

Request

STT Trường dữ liệu Dạng Ghi chúchú
1 Id long Id của KháKhách hàhàng Ralli
2 Name String TêTên khákhách hàhàng
3 Phone String Số điện thoại
4 Email string Email khákhách hàhàng
5 StatusId Int 1: Hoạt động, 0: KhôKhông hoạt động

Response

3. Gửi yêyêu cầu, khiếu nại

3.1. Lấy thôthông tin loại vấn đề

RalliSmart gọi api của crm-iot để lấy thôthông tin cácác loại vấn đề đang cócó, khi đóó ralliSmart cócó thể tùtùy chọn hoặc lưu lại trêtrên db hoặc khôkhông ( việc update cácác loại vấn đề trêtrên crm chưa cócó luồng cập nhật sang ralliSmart)

API :

rpc/crm-iot/issue-type/count
rpc/crm-iot/issue-type/list

Phương thức : POST

Header :

Content-Type: application/json

Cookie: Token = {token} (token lấy được từ bước 1)

3.2. Tạo vấn đề

Chỉ ááp dụng với cácác tàtài khoản cócó sdt

Khi người dùdùng tạo mới một vấn đề, IOT.EBE sẽ bắn sang CRM_IOT để tạo một vấn đề mới, sau đóó đồng bộ vấn đề mới nànày về CRM.

RalliSmartIOT.EBECRM-IOTCRMVấn đềVấn đềTạo/ cập nhật vấn đề1Lấy token2Token3Tạo/cập nhật vấn đề4Tạo/cập nhật vấn đề5Tạo/cập nhật vấn đề6Thông tin vấn đề7Thông tin vấn đề8RalliSmartIOT.EBECRM-IOTCRM

API :

rpc/crm-iot/issue/create

Phương thức : POST

Header :

Content-Type: application/json

Cookie: Token = {token} (token lấy được từ bước 1)
STT Trường dữ liệu Dạng Ghi chúchú
1 Id Int Id của vấn đề
2 Description String Nội dung vấn đề
3 Title String TiêTiêu đề vấn đề
4 IssueStatusId int Trạng tháthái của vấn đề
5 RalliId Int Id của tàtài khoản Ralli tạo vấn đề
6 CreatedAt Date NgàNgày tạo vấn đề
7 UpdatedAt Date NgàNgày cập nhật lần cuối
8 DeletedAt Date NgàNgày xóxóa vấn đề
9 IssueFileMappings List<IssueFileMapping> Danh sásách tệp đíính kèkèm
10 ResolveContent string Nội dung giải quyết vấn đề
11 IssueTypeId int (nullable) Id loại vấn đề

IssueStatus

STT Trường dữ liệu Dạng Ghi chúchú
1 Id Int Id của trạng tháthái
2 Code String MãMã trạng tháthái
3 Name String TêTên trạng tháthái
ID Code Name
1 WAITING Chờ xử lýlý
2 PROCESSING Đang xử lýlý
3 DONE HoàHoàn thàthành

IssueType

STT Trường dữ liệu Dạng Ghi chúchú
1 Id Int Id của loại vấn đề
2 Code String MãMã loại vấn đề
3 Name String TêTên loại vấn đề

IssueFileMapping

STT Trường dữ liệu Dạng Ghi chúchú
1 Id Int Id của mapping
2 IssueId Int Id vấn đề
3 FileId Int Id file
4 File File entity file

File

STT Trường dữ liệu Dạng Ghi chúchú
1 Id Int Id của mapping
2 IssueId Int Id vấn đề
3 FileId Int Id file
4 File File entity file

File

STT Trường dữ liệu Dạng Ghi chúchú
1 Id Int Id ảnh
2 Name string TêTên file
3 Path string url download của ảnh

CáCác mẫu thôthông bábáo ThôThông bábáo thay đổi trạng tháthái đang xử lýlý

Vấn đề {Issue.Title} đãã được chuyển sang trạng tháthái đang xử lýlý

ThôThông bábáo thay đổi trạng tháthái hoàhoàn thàthành

Vấn đề {Issue.Title} đãã được chuyển sang trạng tháthái hoàhoàn thàthành

4. Chăm sósóc khákhách hàhàng của CRM chuyển trạng tháthái đang xử lýlý vấn đề

Sau khi vấn đề được tạo mới sẽ được hiển thị trêtrên CRM, khi đóó người quản lýlý chăm sósóc khákhách hàhàng sẽ cócó thể chuyển vấn đề nànày sang trạng tháthái Đang xử lýlý.

Trạng tháthái đang xử lýlý sẽ được đồng bộ trêtrên CRM-IOT, sau đóó CRM-IOT sẽ bắn một thôthông bábáo thay đổi trạng tháthái cho người tạo vấn đề.

RalliSmartIOT.EBECRM-IOTCRMVấn đềMessageChuyển trạng thái đang xử lý1Cập nhật vấn đề2Webhook thông báo3Gửi thông báo4RalliSmartIOT.EBECRM-IOTCRM

5. Chăm sósóc khákhách hàhàng phản hồi trêtrên CRM

Sau khi một vấn đề được tạo ra trêtrên CRM từ vấn đề Ralli, đội ngũ chăm sósóc khákhách hàhàng của CRM sẽ cócó thể vàvào phản hồi để giải quyết vấn đề. Khi đóó phản hồi sẽ được lưu tại CRM, sau đóó đồng bộ về CRM-IOT vàvà từ đóó gửi thôthông bábáo chăm sósóc khákhách hàhàng phàphàn hồi cho người dùdùng.

RalliSmartIOT.EBECRM-IOTCRMMessagephản hồi1Gửi phản hồi2Lưu phản hồi3Webhook thông báo phản hồi4Gửi thông báo5RalliSmartIOT.EBECRM-IOTCRM

ThôThông bábáo phản hồi ở mục 8

6. Người tạo vấn đề phản hồi trêtrên app RalliSmart

Tương tự, người tạo vấn đề cócó thể phản hồi vàvào vấn đề mìmình đãã tạo để trao đổi với phíphía Quản trị viêviên. phản hồi sẽ được lưu về CRM-IOT. Tiếp theo, CRM-IOT sẽ gửi phản hồi để lưu về CRM.

API :

rpc/crm-iot/discussion/create

Phương thức : POST

Header :

Content-Type: application/json

Cookie: Token = {token} (token lấy được từ ServiceUser)

Comment

STT Trường dữ liệu Dạng Ghi chúchú
1 Id Int Id của phản hồi
2 DiscussionId Guid = RowId của vấn đề
3 IsOwner bool = true nếu người dùdùng hiện tại tạo phản hồi
4 Content string Nội dung phản hồi
5 EndUserId Int Id của tàtài khoản Ralli tạo phản hồi
6 Url string  
7 CreatorId long Id người phản hồi
8 CreatedAt Date NgàNgày tạo phản hồi
9 UpdatedAt Date NgàNgày cập nhật lần cuối
10 DeletedAt Date NgàNgày xóxóa phản hồi
11 CommentAttachments List<CommentAttachment> Danh sásách đíính kèkèm

CommentAttachment

STT Trường dữ liệu Dạng Ghi chúchú
1 Id Int Id của phản hồi
2 CommentId int Id của bìbình luận
3 AttachmentTypeId int Id của loại đíính kèkèm
4 Url string Url ảnh
5 BaseUrl string BaseUrl của folder ảnh
6 Size string ?
7 Name string TêTên đíính kèkèm
8 Checksum string  
9 Type string  
10 Thumbnail string  

AttachmentType

ID Code Name
1 Image Image
2 Sticker Sticker
3 File File
4 Url Url
RalliSmartIOT.EBECRM-IOTCRMPhản hồi1Lấy token2Token3Gửi phản hồi4Gửi phản hồi5Tạo phản hồi6Gửi lại phản hồi7Lưu phản hồi8Thông báo phản hồi thành công9Thông báo phản hồi thành công10RalliSmartIOT.EBECRM-IOTCRM

7.CRM_IOT bắn thôthông bábáo cho app RalliSmart khi cócó thay đổi trạng tháthái vấn đề

Sử dụng Webhook, Base URL vàvà Secret sẽ được lưu trong appsettings,:

  "ExternalServices": {
    "IOT_EBE": "{IOT_EBE_URL}",
    "IOT_EBE_SECRET": "{IOT_EBE_SECRET}"
  }

IOT_EBE nhận thôthông bábáo vàvà check secret trước khi thôthông bábáo cho người dùdùng

  "ExternalServices": {
    "CRMSecret" : "{CRM_SECRET}"
  }

Cấu trútrúc JSON thôthông bábáo:

{
  "Id": "int",
  "Title": "string",
  "Content": "string",
  "DeviceId": "Guid?",
  "DeviceAttributeId": "long?",
  "DormitoryId": "long?",
  "HomeControllerId": "long?",
  "Unread": "bool",
  "SenderId": "int",
  "RecipientId": "long?",
  "Link": "string",
  "Time": "datetime"
}

ThôThông bábáo mẫu:

{
  "Id": "1",
  "Title": "Thay đổi trạng tháthái vấn đề",
  "Content": "Vấn đề 'App lỗi đăng xuất' đãã được chuyển sang trạng tháthái đang xử lýlý",
  "DeviceId": null,
  "DeviceAttributeId": null,
  "DormitoryId": null,
  "HomeControllerId": null,
  "Unread": true,
  "SenderId": null,
  "RecipientId": 193209747938213888,
  "Link": "rpc/iot-ebe/issue/get/12",
  "Time": "2023-02-07T02:18:13.483Z"
}

B. Phần dàdành cho Mobile

1. MàMàn hìhình Danh sásách vấn đề

Khi vàvào chức năng vấn đề, call 2 api count/list để lấy ra danh sásách vấn đề người dùdùng đãã tạo

API Count :

rpc/iot-ebe/issue/count

Cấu trútrúc body:

{}

Response Mẫu:

2

API List :

rpc/iot-ebe/issue/list

Cấu trútrúc body:

{
  "skip": "int",
  "take": "int"
}

Response mẫu

[
  {
    "id": 72,
    "title": "Chim gap bac chao mao chao bac",
    "issueStatusId": 2,
    "description": "Chim gap co son ca chao co",
    "endUserId": 249442343927676928,
    "customerId": 622797,
    "rowId": "e08347c4-42f3-4199-973f-4f401b1fdcec",
    "createdAt": "2023-06-22T08:08:34.203Z",
    "updatedAt": "2023-06-22T08:26:23.330Z",
    "completedAt": null,
    "issueTypeId": 1,
    "issueStatus": {
      "id": 2,
      "code": "PROCESSING",
      "name": "Đang xử lýlý",
      "informations": null,
      "warnings": null,
      "errors": null,
      "disabled": null,
      "generalInformations": [],
      "generalWarnings": [],
      "generalErrors": []
    },
    "issueType": {
      "id": 1,
      "code": "Test",
      "name": "Test",
      "informations": null,
      "warnings": null,
      "errors": null,
      "disabled": null,
      "generalInformations": [],
      "generalWarnings": [],
      "generalErrors": []
    },
    "endUser": null,
    "issueFileMappings": [
      {
        "id": 0,
        "issueId": 72,
        "fileId": 861401,
        "issue": null,
        "file": null,
        "informations": null,
        "warnings": null,
        "errors": null,
        "disabled": null,
        "generalInformations": [],
        "generalWarnings": [],
        "generalErrors": []
      }
    ],
    "informations": null,
    "warnings": null,
    "errors": null,
    "disabled": null,
    "generalInformations": [],
    "generalWarnings": [],
    "generalErrors": []
  },
  {
    "id": 64,
    "title": "Anh khong di len tu duoi day",
    "issueStatusId": 1,
    "description": "5y34sge",
    "endUserId": 249442343927676928,
    "customerId": 227542,
    "rowId": "00000000-0000-0000-0000-000000000000",
    "createdAt": "2023-06-22T07:49:56.000Z",
    "updatedAt": "2023-06-22T07:50:05.577Z",
    "completedAt": null,
    "issueStatus": {
      "id": 1,
      "code": "WAITING",
      "name": "Chờ xử lýlý",
      "informations": null,
      "warnings": null,
      "errors": null,
      "disabled": null,
      "generalInformations": [],
      "generalWarnings": [],
      "generalErrors": []
    },
    "endUser": null,
    "issueFileMappings": [
      {
        "id": 0,
        "issueId": 64,
        "fileId": 861401,
        "issue": null,
        "file": null,
        "informations": null,
        "warnings": null,
        "errors": null,
        "disabled": null,
        "generalInformations": [],
        "generalWarnings": [],
        "generalErrors": []
      }
    ],
    "informations": null,
    "warnings": null,
    "errors": null,
    "disabled": null,
    "generalInformations": [],
    "generalWarnings": [],
    "generalErrors": []
  }
]

2. MàMàn hìhình chi tiết vấn đề

Khi bấm vàvào 1 vấn đề trong danh sásách, gọi api get để lấy dữ liệu vấn đề

API :

rpc/iot-ebe/issue/get

Cấu trútrúc body:

{
  "id": "int"
}

Response Mẫu:

{
  "id": 72,
  "title": "Loi chao cao hon mam co",
  "issueStatusId": 1,
  "description": "Em di thua ve trinh",
  "resolveContent": null,
  "endUserId": 0,
  "customerId": 622797,
  "rowId": "e08347c4-42f3-4199-973f-4f401b1fdcec",
  "createdAt": "2023-06-22T08:08:34.203Z",
  "updatedAt": "2023-06-22T08:08:34.203Z",
  "completedAt": null,
  "issueTypeId": 1,
  "issueStatus": {
    "id": 1,
    "code": "WAITING",
    "name": "Chờ xử lýlý",
    "informations": null,
    "warnings": null,
    "errors": null,
    "disabled": null,
    "generalInformations": [],
    "generalWarnings": [],
    "generalErrors": []
  },
  "issueType": {
    "id": 1,
    "code": "Test",
    "name": "test",
    "informations": null,
    "warnings": null,
    "errors": null,
    "disabled": null,
    "generalInformations": [],
    "generalWarnings": [],
    "generalErrors": []
  },
  "endUser": null,
  "issueFileMappings": [
    {
      "id": 0,
      "issueId": 72,
      "fileId": 861401,
      "issue": null,
      "file": {
        "id": 861401,
        "name": "9a680e45-6dc4-46e0-91a3-e4a5cdc05285.jpg",
        "mimeType": "image/jpeg",
        "isFile": false,
        "path": "http://localhost:5031/rpc/utils/file/download/issue/20230622/9a680e45-6dc4-46e0-91a3-e4a5cdc05285.jpg",
        "level": 0,
        "content": null,
        "endUser": null,
        "informations": null,
        "warnings": null,
        "errors": null,
        "disabled": null,
        "generalInformations": [],
        "generalWarnings": [],
        "generalErrors": []
      },
      "informations": null,
      "warnings": null,
      "errors": null,
      "disabled": null,
      "generalInformations": [],
      "generalWarnings": [],
      "generalErrors": []
    }
  ],
  "informations": null,
  "warnings": null,
  "errors": null,
  "disabled": null,
  "generalInformations": [],
  "generalWarnings": [],
  "generalErrors": []
}

API Upload cácác ảnh lêlên hệ thống

  Method: POST
  Header: files

  URL: {BASE_URL}/rpc/iot-ebe/issue/multi-upload

Response mẫu

[
  {
    "id": 861415,
    "name": "fe408661-82f8-4fdc-be3c-945d016a1a55.png",
    "mimeType": "image/png",
    "isFile": false,
    "path": "http://localhost:5031/rpc/utils/file/download/issue/20230622/fe408661-82f8-4fdc-be3c-945d016a1a55.png",
    "level": 0,
    "content": null,
    "endUser": null,
    "informations": null,
    "warnings": null,
    "errors": null,
    "disabled": null,
    "generalInformations": [],
    "generalWarnings": [],
    "generalErrors": []
  },
  {
    "id": 861416,
    "name": "2a885dd7-c035-4055-9b86-fe33d39bfb7f.jpg",
    "mimeType": "image/jpeg",
    "isFile": false,
    "path": "http://localhost:5031/rpc/utils/file/download/issue/20230622/2a885dd7-c035-4055-9b86-fe33d39bfb7f.jpg",
    "level": 0,
    "content": null,
    "endUser": null,
    "informations": null,
    "warnings": null,
    "errors": null,
    "disabled": null,
    "generalInformations": [],
    "generalWarnings": [],
    "generalErrors": []
  }
]

API tạo vấn đề:

  Method : POST

  URL : {BASE_URL}/rpc/iot-ebe/issue/create

Payload mẫu

{
  "Title": "Loi chao cao hon mam co",
  "Description": "Em di thua ve trinh",
  "IssueTypeId": 1,
  "IssueFileMappings": [
    {
      "FileId": 861401
    }
  ]
}

Response mẫu:

{
  "id": 72,
  "title": "Loi chao cao hon mam co",
  "issueStatusId": 1,
  "description": "Em di thua ve trinh",
  "resolveContent": null,
  "endUserId": 0,
  "customerId": 622797,
  "rowId": "e08347c4-42f3-4199-973f-4f401b1fdcec",
  "createdAt": "2023-06-22T08:08:34.203Z",
  "updatedAt": "2023-06-22T08:08:34.203Z",
  "completedAt": null,
  "issueTypeId": 1,
  "issueStatus": {
    "id": 1,
    "code": "WAITING",
    "name": "Chờ xử lýlý",
    "informations": null,
    "warnings": null,
    "errors": null,
    "disabled": null,
    "generalInformations": [],
    "generalWarnings": [],
    "generalErrors": []
  },
  "endUser": null,
  "issueFileMappings": [
    {
      "id": 0,
      "issueId": 72,
      "fileId": 861401,
      "issue": null,
      "file": {
        "id": 861401,
        "name": "9a680e45-6dc4-46e0-91a3-e4a5cdc05285.jpg",
        "mimeType": "image/jpeg",
        "isFile": false,
        "path": "http://localhost:5031/rpc/utils/file/download/issue/20230622/9a680e45-6dc4-46e0-91a3-e4a5cdc05285.jpg",
        "level": 0,
        "content": null,
        "endUser": null,
        "informations": null,
        "warnings": null,
        "errors": null,
        "disabled": null,
        "generalInformations": [],
        "generalWarnings": [],
        "generalErrors": []
      },
      "informations": null,
      "warnings": null,
      "errors": null,
      "disabled": null,
      "generalInformations": [],
      "generalWarnings": [],
      "generalErrors": []
    }
  ],
  "informations": null,
  "warnings": null,
  "errors": null,
  "disabled": null,
  "generalInformations": [],
  "generalWarnings": [],
  "generalErrors": []
}

API đóóng vấn đề :

Trong màmàn hìhình chi tiết vấn đề, cócó núnút Đóóng vấn đề khi người dùdùng thấy vấn đề đãã được giải quyết

rpc/iot-ebe/issue/close

Cấu trútrúc body:

{
  "id": "int"
}

Response Mẫu:

2

Hoặc núnút Cập nhật khi người dùdùng muốn sửa chi tiết vấn đề

API :

rpc/iot-ebe/issue/update

Cấu trútrúc body:

{
  "id": "long",
  "title": "string",
  "issueStatusId": "long",
  "description": "string"
}

Request mẫu:

{
  "id": 72,
  "code": 72,
  "title": "Chim gap bac chao mao chao bac",
  "issueStatusId": 1,
  "description": "Chim gap co son ca chao co",
  "resolveContent": null,
  "issueTypeId": 1,
  "customerId": 622797,
  "rowId": "e08347c4-42f3-4199-973f-4f401b1fdcec",
  "createdAt": "2023-06-22T08:08:34.203Z",
  "updatedAt": "2023-06-22T08:08:34.203Z",
  "completedAt": null,
  "issueStatus": {
    "id": 1,
    "code": "WAITING",
    "name": "Chờ xử lýlý"
  },
  "endUser": null,
  "issueFileMappings": [
    {
      "id": 0,
      "issueId": 72,
      "fileId": 861401,
      "issue": null,
      "file": {
        "id": 861401,
        "name": "9a680e45-6dc4-46e0-91a3-e4a5cdc05285.jpg",
        "mimeType": "image/jpeg",
        "isFile": false,
        "path": "http://localhost:5031/rpc/utils/file/download/issue/20230622/9a680e45-6dc4-46e0-91a3-e4a5cdc05285.jpg",
        "level": 0,
        "content": null,
        "endUser": null
      }
    }
  ]
}

Response Mẫu:

{
  "id": 72,
  "title": "Chim gap bac chao mao chao bac",
  "issueStatusId": 1,
  "description": "Chim gap co son ca chao co",
  "resolveContent": null,
  "endUserId": 0,
  "customerId": 622797,
  "rowId": "e08347c4-42f3-4199-973f-4f401b1fdcec",
  "createdAt": "2023-06-22T08:08:34.203Z",
  "updatedAt": "2023-06-22T08:17:17.190Z",
  "completedAt": null,
  "issueStatus": {
    "id": 1,
    "code": "WAITING",
    "name": "Chờ xử lýlý",
    "informations": null,
    "warnings": null,
    "errors": null,
    "disabled": null,
    "generalInformations": [],
    "generalWarnings": [],
    "generalErrors": []
  },
  "endUser": null,
  "issueFileMappings": [
    {
      "id": 0,
      "issueId": 72,
      "fileId": 861401,
      "issue": null,
      "file": {
        "id": 861401,
        "name": "9a680e45-6dc4-46e0-91a3-e4a5cdc05285.jpg",
        "mimeType": "image/jpeg",
        "isFile": false,
        "path": "http://localhost:5031/rpc/utils/file/download/issue/20230622/9a680e45-6dc4-46e0-91a3-e4a5cdc05285.jpg",
        "level": 0,
        "content": null,
        "endUser": null,
        "informations": null,
        "warnings": null,
        "errors": null,
        "disabled": null,
        "generalInformations": [],
        "generalWarnings": [],
        "generalErrors": []
      },
      "informations": null,
      "warnings": null,
      "errors": null,
      "disabled": null,
      "generalInformations": [],
      "generalWarnings": [],
      "generalErrors": []
    }
  ],
  "informations": null,
  "warnings": null,
  "errors": null,
  "disabled": null,
  "generalInformations": [],
  "generalWarnings": [],
  "generalErrors": []
}

Khi gọi api get để lấy dữ liệu vấn đề, đồng thời gọi api count/list của phản hồi

API Count :

rpc/iot-ebe/discussion/count

Cấu trútrúc body:

{
  "discussionId": {
    "equal": "9f04bacc-b6b1-4ae2-8d2f-86cb9929a42d"
  }
}

Response Mẫu:

2

API List :

rpc/iot-ebe/discussion/list

Cấu trútrúc body:

{
  "discussionId": {
    "equal": "e08347c4-42f3-4199-973f-4f401b1fdcec"
  }
}

Response Mẫu:

[
  {
    "id": 10146,
    "isOwner": false,
    "discussionId": "e08347c4-42f3-4199-973f-4f401b1fdcec",
    "content": "Co con chim vanh khuyen nho",
    "url": null,
    "creatorId": 3892,
    "endUserId": null,
    "createdAt": "2023-06-22T08:54:01.337Z",
    "updatedAt": "2023-06-22T08:54:01.387Z",
    "deletedAt": null,
    "creator": {
      "id": null,
      "username": null,
      "displayName": "Hệ thống chăm sósóc khákhách hàhàng",
      "password": null,
      "newPassword": null,
      "phoneNumber": null,
      "email": null,
      "token": null,
      "refreshToken": null,
      "deviceName": null,
      "ownedProfileId": "0",
      "sexId": null,
      "verificationTypeId": 0,
      "verificationStatusId": null,
      "uid": null,
      "tuyaUid": null,
      "tuyaUsername": null,
      "tuyaUsernameTypeId": null,
      "tuyaPassword": null,
      "ownedProfile": null,
      "sex": null,
      "verificationType": null,
      "endUserProfiles": null,
      "birthday": null,
      "createdAt": "0001-01-01T00:00:00.000Z",
      "updatedAt": "0001-01-01T00:00:00.000Z",
      "informations": null,
      "warnings": null,
      "errors": null,
      "disabled": null,
      "generalInformations": [],
      "generalWarnings": [],
      "generalErrors": []
    },
    "commentAttachments": null,
    "informations": null,
    "warnings": null,
    "errors": null,
    "disabled": null,
    "generalInformations": [],
    "generalWarnings": [],
    "generalErrors": []
  },
  {
    "id": 10145,
    "isOwner": false,
    "discussionId": "e08347c4-42f3-4199-973f-4f401b1fdcec",
    "content": "chim gap trung bestie hi keo",
    "url": null,
    "creatorId": 3892,
    "endUserId": null,
    "createdAt": "2023-06-22T08:45:48.117Z",
    "updatedAt": "2023-06-22T08:50:10.230Z",
    "deletedAt": null,
    "creator": {
      "id": null,
      "username": null,
      "displayName": "Hệ thống chăm sósóc khákhách hàhàng",
      "password": null,
      "newPassword": null,
      "phoneNumber": null,
      "email": null,
      "token": null,
      "refreshToken": null,
      "deviceName": null,
      "ownedProfileId": "0",
      "sexId": null,
      "verificationTypeId": 0,
      "verificationStatusId": null,
      "uid": null,
      "tuyaUid": null,
      "tuyaUsername": null,
      "tuyaUsernameTypeId": null,
      "tuyaPassword": null,
      "ownedProfile": null,
      "sex": null,
      "verificationType": null,
      "endUserProfiles": null,
      "birthday": null,
      "createdAt": "0001-01-01T00:00:00.000Z",
      "updatedAt": "0001-01-01T00:00:00.000Z",
      "informations": null,
      "warnings": null,
      "errors": null,
      "disabled": null,
      "generalInformations": [],
      "generalWarnings": [],
      "generalErrors": []
    },
    "commentAttachments": null,
    "informations": null,
    "warnings": null,
    "errors": null,
    "disabled": null,
    "generalInformations": [],
    "generalWarnings": [],
    "generalErrors": []
  }
]

Hoặc tạo phản hồi cho người dùdùng

API Create :

rpc/iot-ebe/discussion/create

Cấu trútrúc body:

{
  "discussionId": "Guid",
  "content": "string"
}

Request mẫu

{
  "discussionId": "e08347c4-42f3-4199-973f-4f401b1fdcec",
  "content": "Chim gap anh chich choe chao anh",
  "commentAttachments": [
    {
      "attachmentTypeId": 1,
      "url": "https://gandalf.truesight.asia/rpc/utils/file/download/discussion/20230717/3db0d5cf-2ce4-4342-8775-508d329fa648/cainit.jpg",
      "name": "3018885b-d0e9-4f3b-be91-02536f6c1db0.png"
    }
  ]
}

Response Mẫu:

{
  "id": 10143,
  "isOwner": true,
  "discussionId": "e08347c4-42f3-4199-973f-4f401b1fdcec",
  "content": "Chim gap anh chich choe chao anh",
  "url": null,
  "creatorId": 4603,
  "endUserId": 249442343927676928,
  "createdAt": "2023-06-22T08:28:31.057Z",
  "updatedAt": "2023-06-22T08:28:31.057Z",
  "deletedAt": null,
  "creator": {
    "id": "249442343927676928",
    "username": "summertime",
    "displayName": "Jonas Brother",
    "password": null,
    "newPassword": null,
    "phoneNumber": "+84354246220",
    "email": null,
    "token": null,
    "refreshToken": null,
    "deviceName": null,
    "ownedProfileId": "0",
    "sexId": null,
    "verificationTypeId": 6,
    "verificationStatusId": 1,
    "uid": null,
    "tuyaUid": null,
    "tuyaUsername": null,
    "tuyaUsernameTypeId": null,
    "tuyaPassword": null,
    "ownedProfile": null,
    "sex": null,
    "verificationType": null,
    "endUserProfiles": null,
    "birthday": null,
    "createdAt": "2023-06-20T07:54:49.207Z",
    "updatedAt": "2023-06-20T07:54:49.433Z"
  },
  "commentAttachments": [
    {
      "id": 1,
      "commentId": 10245,
      "attachmentTypeId": 1,
      "url": "https://gandalf.truesight.asia/rpc/utils/file/download/discussion/20230717/3db0d5cf-2ce4-4342-8775-508d329fa648/cainit.jpg",
      "thumbnail": null,
      "size": null,
      "name": "3018885b-d0e9-4f3b-be91-02536f6c1db0.png",
      "checksum": null,
      "type": null,
      "attachmentType": {
        "id": 1,
        "code": "Image",
        "name": "Image",
        "informations": null,
        "warnings": null,
        "errors": null,
        "disabled": null,
        "generalInformations": [],
        "generalWarnings": [],
        "generalErrors": []
      },
      "informations": null,
      "warnings": null,
      "errors": null,
      "disabled": null,
      "generalInformations": [],
      "generalWarnings": [],
      "generalErrors": []
    }
  ],
  "informations": null,
  "warnings": null,
  "errors": null,
  "disabled": null,
  "generalInformations": [],
  "generalWarnings": [],
  "generalErrors": []
}

Upload ở bìbình luận

File upload trong phần bìbình luận sẽ dùdùng api sau (1 file) :

  Method: HttpPost
  Header: Token
  Body: file

  Url: {BASE_URL}/rpc/iot-ebe/discussion/save-file

Response

{
  "id": 861415,
  "name": "fe408661-82f8-4fdc-be3c-945d016a1a55.png",
  "mimeType": "image/png",
  "isFile": false,
  "path": "https://gandalf.truesight.asia/rpc/utils/file/download/issue/20230622/fe408661-82f8-4fdc-be3c-945d016a1a55.png",
  "level": 0,
  "content": null,
  "endUser": null,
  "informations": null,
  "warnings": null,
  "errors": null,
  "disabled": null,
  "generalInformations": [],
  "generalWarnings": [],
  "generalErrors": []
}