Skip to content

Latest commit

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Ozon Marketplace Project

schema

Дальше везде используются placeholder-ы:

  • {domain},{Domain}
  • {subdomain},{Subdomain}

Например, для поддомена package из домена logistic значение placeholder-ов будет:

  • {domain},{Domain} = logistic,Logistic
  • {subdomain},{Subdomain} = package,Package
  • {domain}/{subdomain} = logistic/package

Задание 1

  1. Сделать форк ozonmp/omp-bot репозитория в свой профиль
  2. Запросить у своего тьютора свой домен/поддомен: {domain}/{subdomain}
  3. Добавить в ветку feature/task-1 своего форка поддержку следующих команд:
/help__{domain}__{subdomain} — print list of commands
/get__{domain}__{subdomain} — get a entity
/list__{domain}__{subdomain} — get a list of your entity (💎: with pagination via telegram keyboard)
/delete__{domain}__{subdomain} — delete an existing entity
/new__{domain}__{subdomain} — create a new entity // not implemented (💎: implement list fields via arguments)
/edit__{domain}__{subdomain} — edit a entity // not implemented
  1. Сделать PR из ветки feature/task-1 своего форка в ветку master своего форка
  2. Отправить ссылку на PR личным сообщением своему тьютору до конда дедлайна сдачи (см. таблицу прогресса)

Для добавления поддержки команд в рамках своего поддомена:

  1. Написать структуру {Subdomain} с методом String()
  2. Написать интерфейс {Subdomain}Service и dummy имплементацию
  3. Написать интерфейс {Subdomain}Commander по обработке команд

  1. Реализовать {Subdomain}Service в internal/service/{domain}/{subdomain}/
package {domain}
import"github.com/ozonmp/omp-bot/internal/model/{domain}"type {Subdomain}Serviceinterface {
Describe({subdomain}_iduint64) (*{domain}.{Subdomain}, error)
List(cursoruint64, limituint64) ([])
Create({domain}.{Subdomain}) (uint64, error)
Update({subdomain}_iduint64, {subdomain} {domain}.{Subdomain}) errorRemove({subdomain}_iduint64) (bool, error)
}
typeDummy{Subdomain}Servicestruct {}
funcNewDummy{Subdomain}Service() Dummy{Subdomain}Service {
return&Dummy{Subdomain}Service{}
}
// ...

  1. Реализовать {Subdomain}Commander по обработке команд в internal/app/commands/{domain}/{subdomain}/
package {subdomain}
import (
model "github.com/ozonmp/omp-bot/internal/model/{domain}"
service "github.com/ozonmp/omp-bot/internal/service/{domain}/{subdomain}"
)
type {Subdomain}Commanderinterface {
Help(inputMsg*tgbotapi.Message)
Get(inputMsg*tgbotapi.Message)
List(inputMsg*tgbotapi.Message)
Delete(inputMsg*tgbotapi.Message)
New(inputMsg*tgbotapi.Message) // return error not implementedEdit(inputMsg*tgbotapi.Message) // return error not implemented
}
funcNew{Subdomain}Commander(bot*tgbotapi.BotAPI, serviceservice.{Subdomain}Service) {Subdomain}Commander {
// ...
}

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors