No Description

ilfey a85b4bf924 Update test.yml 1 year ago
.github a85b4bf924 Update test.yml 1 year ago
cmd 5c35a2565e add user tests 1 year ago
internal 5c35a2565e add user tests 1 year ago
web 720dcf9532 initial commit 1 year ago
.env.example e2be90ff6d add port 1 year ago
.gitignore 3bf8f7ca01 move from air to Task 1 year ago
README.md 5c35a2565e add user tests 1 year ago
Taskfile.yml 5c35a2565e add user tests 1 year ago
go.mod 5c35a2565e add user tests 1 year ago
go.sum 5c35a2565e add user tests 1 year ago
scheme.sql 86f6d1848d add links and contacts 1 year ago

README.md

devback

Бекэнд написанный на фреймворке gin


endpoints

  • / GET
  • api/v1/ping GET
  • /api/v1/messages GET
  • /api/v1/contacts GET
  • /api/v1/contacts/:id GET
  • /api/v1/user/login POST
  • /api/v1/user/register POST
  • /api/v1/user/delete POST
  • /api/v1/user/message POST
  • /api/v1/user/message/:id PATCH, DELETE
  • /api/v1/<admin path>/users/messages/:id PATCH, DELETE
  • /api/v1/<admin path>/users/messages/:id/permanently DELETE
  • /api/v1/<admin path>/users/messages/:id/restore POST
  • /api/v1/<admin path>/users/:username DELETE
  • /api/v1/<admin path>/users/:username/permanently DELETE
  • /api/v1/<admin path>/users/:username/restore POST
  • /api/v1/<admin path>/links GET, POST
  • /api/v1/<admin path>/links/:id GET, DELETE
  • /api/v1/<admin path>/links/:id/permanently DELETE
  • /api/v1/<admin path>/links/:id/restore POST
  • /api/v1/<admin path>/contacts POST

Текущая схема бд

---
title: "devpage database scheme"
---

erDiagram
    users {
        varchar(16) username PK
        varchar(64) password
        boolean is_deleted
        timestamp created_at
    }

    messages {
        bigint id PK
        varchar(2000) content
        varchar(16) userId FK
        bigint reply FK
        boolean is_deleted
        timestamp modified_at
        timestamp created_at
    }

    links {
        bigint id PK
        varchar description
        varchar url
        boolean is_deleted
        timestamp modified_at
        timestamp created_at
    }

    contacts {
        bigint id PK
        varchar title
        bigint linkId FK
        boolean is_deleted
        timestamp modified_at
        timestamp created_at
    }

    
    links only one to zero or many contacts : ""
    users only one to zero or many messages : ""

Запланированная схема бд

---
title: "devpage database scheme"
---

erDiagram
    users {
        varchar(16) username PK
        varchar(64) password
        bigint profile FK
        boolean is_deleted
        timestamp created_at
    }

    messages {
        bigint id PK
        varchar(2000) content
        varchar(16) userId FK
        bigint reply FK
        boolean is_deleted
        timestamp modified_at
        timestamp created_at
    }

    attachments {
        bigint messageId PK, FK
        bigint url PK, FK
    }

    projects {
        bigint id PK
        varchar title
        text description
        bigint source FK
        bigint url FK
        varchar language
        timestamp updatedAt
        timestamp createdAt
    }

    links {
        bigint id PK
        varchar description
        varchar url
    }

    contacts {
        bigint id PK
        varchar title
        bigint linkId FK
        bool isPrimary
    }

    users only one to only one links : ""
    users only one to zero or many messages : ""
    messages only one to zero or many attachments : ""
    links only one to zero or many attachments : ""
    links only one to zero or many projects : ""
    links only one to zero or many contacts : ""

Todo

  • добавить PATCH для links
  • добавить в find для юзера modified_at и мигрировать
  • добавить остальные методы для contacts
  • добавить уведомления по e-mail, хотя бы для админа
    • добавить возможность смены пароля пользователям
  • добавить сущности user новый атрибут profile FK links(id)