сервис техподдержки, многократно унаследованный. Херувим - ангел, а сотрудникам ТП нужно ангельское терпение
Go to file
skeris 656c9216fe
All checks were successful
Deploy / CreateImage (push) Successful in 1m27s
Deploy / DeployService (push) Successful in 34s
ci: change inter service communication to domain routing
2025-01-12 01:52:01 +03:00
.gitea/workflows return state 2025-01-09 14:40:12 +03:00
cmd return state 2025-01-09 14:40:12 +03:00
deployments ci: change inter service communication to domain routing 2025-01-12 01:52:01 +03:00
internal added filter and add test with head common 2024-12-11 00:21:42 +03:00
k8s lil commit 2022-02-27 18:27:44 +03:00
ops deployStaging 2022-10-31 14:00:20 +03:00
pkg/closer save account srv 2024-09-25 17:22:57 +03:00
script merge commit 811783e1c489895683f4e9fcbd8a907d12b7a32d 2024-11-27 12:05:29 +03:00
test added filter and add test with head common 2024-12-11 00:21:42 +03:00
version replace all themakers/hlog to penaside/hlog because themakers deleted one 2024-11-26 02:11:24 +03:00
.gitignore add new build executable to gitignore 2024-11-28 00:49:09 +03:00
compose.test.yml fix: partially rewrite readme for api 2022-12-13 13:07:15 +03:00
compose.yml feat: compose.yml for gitlab registry 2022-12-21 14:33:01 +03:00
Dockerfile add delve as debugger and expose it 2024-12-09 02:02:25 +03:00
DockerfileStaging Update file DockerfileStaging 2023-06-21 17:27:05 +00:00
go.mod temporarily add fiber send method to excludes of errcheck 2024-11-28 01:24:50 +03:00
go.sum added filter and add test with head common 2024-12-11 00:21:42 +03:00
openapi.yaml added system varible to create ticket and added filter for get messages 2024-12-09 13:48:06 +00:00
prod.crt lil commit 2022-02-27 18:27:44 +03:00
prod.key lil commit 2022-02-27 18:27:44 +03:00
README.md fix: readme 2022-12-14 21:26:21 +03:00
server.crt lil commit 2022-02-27 18:27:44 +03:00
server.key lil commit 2022-02-27 18:27:44 +03:00
Taskfile.dist.yml remove .git from taskfile 2024-11-26 17:14:58 +03:00

Heruvym

/create - метод для создания тикета. пример запроса

POST http://localhost:8000/support/create

Тело запроса

{
  "Title":"test ticket title",
  "Message":"test ticket message"
}

тело ответа

{
  "Ticket":"c2fekjcobibtq7akknog"
}

/subscribe - sse метод для подписывания на изменения по всех тикетах доступных пользователю.

пример запроса http://localhost:8000/support/subscribe?Authorization=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJJRCI6ImMxdmNrZWtvYmlicmFmYWU2bjYwIiwiU2Vzc2lvbiI6ImMxdmNrZWtvYmlicmFmYWU2bjZnIiwiVXNlciI6ImMxdXAxY2tvYmliaXVpNDVxNGYwIiwiVGFyaWZmIjowLCJDcmVhdGVkIjoxNjE4OTIyMDQyMDQ3LCJMYXN0U2VlbiI6MTYxODkyMjA5OTg5MH0.INLy790JP-o6DDZcXfSEXUDg7lE1_83Ns2vDJVrUFuQ

тело ответа

Ticket: {
    ID         string `bson:"_id"`
    UserID     string `bson:"UserID"`
    SessionID  string `bson:"SessionID"`
    AnswererID string `bson:"AnswererID"`
    State      string  `bson:"State"`
    TopMessage: {
                    ID        string `bson:"_id" json:"id"`
                    TicketID  string `bson:"TicketID" json:"ticket_id"`
                    UserID    string `bson:"UserID" json:"user_id"`
                    SessionID string `bson:"SessionID" json:"session_id"`
                    Message string         `bson:"Message" json:"message"`
                    Files   []string       `bson:"Files" json:"files"`
                    Shown   map[string]int `bson:"Shown" json:"shown"`
                    CreatedAt time.Time `bson:"CreatedAt" json:"created_at"`
                }
    Title string `bson:"Title"`
    CreatedAt time.Time `bson:"CreatedAt"`
    UpdatedAt time.Time `bson:"UpdatedAt"`
    Rate int `bson:"Rate"`
}

/ticket - sse метод для подписки на сообщения из одного тикета.

пример запроса http://localhost:8000/support/ticket?ticket=c2fekjcobibtq7akknog&Authorization=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJJRCI6ImMxdmNrZWtvYmlicmFmYWU2bjYwIiwiU2Vzc2lvbiI6ImMxdmNrZWtvYmlicmFmYWU2bjZnIiwiVXNlciI6ImMxdXAxY2tvYmliaXVpNDVxNGYwIiwiVGFyaWZmIjowLCJDcmVhdGVkIjoxNjE4OTIyMDQyMDQ3LCJMYXN0U2VlbiI6MTYxODkyMjA5OTg5MH0.INLy790JP-o6DDZcXfSEXUDg7lE1_83Ns2vDJVrUFuQ

тело ответа

{
    ID        string `bson:"_id" json:"id"`
    TicketID  string `bson:"TicketID" json:"ticket_id"`
    UserID    string `bson:"UserID" json:"user_id"`
    SessionID string `bson:"SessionID" json:"session_id"`
    Message string         `bson:"Message" json:"message"`
    Files   []string       `bson:"Files" json:"files"`
    Shown   map[string]int `bson:"Shown" json:"shown"`
    CreatedAt time.Time `bson:"CreatedAt" json:"created_at"`
}

/send - метод для отправки сообщения в тикета

пример запроса POST http://localhost:8000/support/send

Тело запроса

{
  "message":"test ticket message",
  "TicketID":"c2fekjcobibtq7akknog", 
  "lang":"ru",
  "files": ["idoffile"]
}

Ответ null

/getTickets - метод для получения тикетов с пагинацией

пример запроса POST http://localhost:8000/support/getTickets

Тело запроса:

{
  "amt":10,
  "page":1,
  "srch":"test",
  "status":"open"
}

Ответ:

[{
  ID         string `bson:"_id"`
  UserID     string `bson:"UserID"`
  SessionID  string `bson:"SessionID"`
  AnswererID string `bson:"AnswererID"`
  State      string  `bson:"State"`
  TopMessage: {
      ID        string `bson:"_id" json:"id"`
      TicketID  string `bson:"TicketID" json:"ticket_id"`
      UserID    string `bson:"UserID" json:"user_id"`
      SessionID string `bson:"SessionID" json:"session_id"`
      Message string         `bson:"Message" json:"message"`
      Files   []string       `bson:"Files" json:"files"`
      Shown   map[string]int `bson:"Shown" json:"shown"`
      CreatedAt time.Time `bson:"CreatedAt" json:"created_at"`
  }
  Title string `bson:"Title"`
  CreatedAt time.Time `bson:"CreatedAt"`
  UpdatedAt time.Time `bson:"UpdatedAt"`
  Rate int `bson:"Rate"`
}]

/getMessages - метод для получения сообщений конкретного тикета с пагинацией

пример запроса POST http://localhost:8000/support/getMessages

Тело запроса:

{
  "amt":10,
  "page":1,
  "srch":"test",
  "ticket":"c2fekjcobibtq7akknog"
}

Ответ:

[{
   ID        string `bson:"_id" json:"id"`
   TicketID  string `bson:"TicketID" json:"ticket_id"`
   UserID    string `bson:"UserID" json:"user_id"`
   SessionID string `bson:"SessionID" json:"session_id"`

   Message string         `bson:"Message" json:"message"`
   Files   []string       `bson:"Files" json:"files"`
   Shown   map[string]int `bson:"Shown" json:"shown"`

   CreatedAt time.Time `bson:"CreatedAt" json:"created_at"`
}]

/pick - подхватывание сотрудником диалога

пример запроса POST http://localhost:8000/support/pick

Тело запроса:

{"ticket":"c2fekjcobibtq7akknog"}

Ответ: null

/delegate - передача тикета другому сотруднику

пример запроса POST http://localhost:8000/support/delegate

Тело запроса:

{
  "ticket":"c2fekjcobibtq7akknog",
  "answerer":"c2fekjcobibtq7akknog"
}

Ответ: null

/vote - метод для оценки полезности ответа

пример запроса POST http://localhost:8000/support/delegate

Тело запроса:

{
  "ticket":"c2fekjcobibtq7akknog",
  "rate":5
}

Ответ: null

/close - метод для закрытия тикета

пример запроса POST http://localhost:8000/support/close

Тело запроса:

{
  "ticket":"c2fekjcobibtq7akknog"
}

Ответ: null

/support/sendFiles - метод для отправки файлов