endpoint

package
v0.0.0-...-de92fe2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetStatusLabel = map[int64]map[string]string{
	-1: {"en": "status deleted", "id": "Dihapus"},
	0:  {"en": "Not Active", "id": "Tidak Aktif"},
	10: {"en": "Active", "id": "Aktif"},
}

GetStatusLabel ...

Functions

func MakeAddPhonebook

func MakeAddPhonebook(ctx context.Context, usecase usecase.Provider) endpoint.Endpoint

MakeAddPhonebook ...

func MakeCheckHealthy

func MakeCheckHealthy(ctx context.Context) endpoint.Endpoint

func MakeCheckReadiness

func MakeCheckReadiness(ctx context.Context, usecase usecase.Provider) endpoint.Endpoint

func MakeDeletePhonebook

func MakeDeletePhonebook(ctx context.Context, usecase usecase.Provider) endpoint.Endpoint

MakeDeletePhonebook ...

func MakeGetDetail

func MakeGetDetail(ctx context.Context, usecase usecase.Provider) endpoint.Endpoint

MakeGetDetail ...

func MakeGetList

func MakeGetList(ctx context.Context, usecase usecase.Provider) endpoint.Endpoint

MakeGetList ...

func MakeIsExistPhoneNumber

func MakeIsExistPhoneNumber(ctx context.Context, usecase usecase.Provider) endpoint.Endpoint

MakeIsExistPhoneNumber ...

func MakeUpdatePhonebook

func MakeUpdatePhonebook(ctx context.Context, usecase usecase.Provider) endpoint.Endpoint

MakeUpdatePhonebook ...

Types

type AddPhonebookRequest

type AddPhonebookRequest struct {
	Name           string         `json:"name"`
	Description    *string        `json:"description"`
	PhoneNumbers   []*PhoneNumber `json:"phone_numbers"`
	RegencyID      *int64         `json:"kabkota_id"`
	DistrictID     *int64         `json:"kec_id"`
	VillageID      *int64         `json:"kel_id"`
	Status         *int64         `json:"status"`
	Latitude       *string        `json:"latitude"`
	Longitude      *string        `json:"longitude"`
	CategoryID     *int64         `json:"category_id"`
	CoverImagePath *string        `json:"cover_image_path"`
	Address        *string        `json:"address"`
	Sequence       *int64         `json:"seq"`
}

AddPhonebookRequest ...

type GetDetailRequest

type GetDetailRequest struct {
	ID int64 `httpparams:"id"`
}

GetDetailRequest ...

type GetListRequest

type GetListRequest struct {
	Search      string `httpquery:"search"`
	Name        string `httpquery:"name"`
	PhoneNumber string `httpquery:"phone"`
	RegencyID   int64  `httpquery:"kabkota_id"`
	DistrictID  int64  `httpquery:"kec_id"`
	VillageID   int64  `httpquery:"kel_id"`
	Status      *int64 `httpquery:"status"`
	Latitude    string `httpquery:"latitude"`
	Longitude   string `httpquery:"longitude"`
	Limit       int64  `httpquery:"limit"`
	Page        int64  `httpquery:"page"`
	SortBy      string `httpquery:"sort_by"`
	OrderBy     string `httpquery:"sort_order"`
}

GetListRequest ...

type IsExistPhoneNumber

type IsExistPhoneNumber struct {
	PhoneNumber string `httpquery:"phone_number"`
}

IsExistPhoneNumber ...

type Metadata

type Metadata struct {
	TotalCount  int64   `json:"totalCount"`
	PageCount   float64 `json:"pageCount"`
	CurrentPage int64   `json:"currentPage"`
	PerPage     int64   `json:"perPage"`
}

Metadata ...

type PhoneBookWithMeta

type PhoneBookWithMeta struct {
	Data *PhonebookWithMeta `json:"data"`
}

PhoneBookWithMeta ...

type PhoneNumber

type PhoneNumber struct {
	PhoneNumber string `json:"phone_number"`
	Type        string `json:"type"`
}

PhoneNumber ...

type Phonebook

type Phonebook struct {
	ID            interface{}     `json:"id"`
	PhoneNumbers  []*PhoneNumber  `json:"phone_numbers"`
	Description   *string         `json:"description"`
	Name          *string         `json:"name"`
	Address       *string         `json:"address"`
	Latitude      *string         `json:"latitude"`
	Longitude     *string         `json:"longitude"`
	Status        int64           `json:"status"`
	StatusLabel   string          `json:"status_label"`
	CoverImageURL *string         `json:"cover_image_url"`
	CategoryID    *int64          `json:"category_id"`
	Category      interface{}     `json:"category"`
	Sequence      int64           `json:"seq"`
	Distance      interface{}     `json:"distance,omitempty"`
	RegencyID     *int64          `json:"kabkota_id"`
	Regency       *model.Location `json:"kabkota"`
	DistrictID    *int64          `json:"kec_id"`
	District      *model.Location `json:"kecamatan"`
	VillageID     *int64          `json:"kel_id"`
	Village       *model.Location `json:"kelurahan"`
	CreatedAt     int64           `json:"created_at"`
	UpdatedAt     int64           `json:"updated_at"`
}

Phonebook ...

func EncodePhonebook

func EncodePhonebook(data []*model.Phonebook) []*Phonebook

EncodePhonebook ...

type PhonebookDetail

type PhonebookDetail struct {
	ID             interface{}     `json:"id"`
	Name           string          `json:"name"`
	CategoryID     int64           `json:"category_id"`
	Category       interface{}     `json:"category"`
	Address        string          `json:"address"`
	Description    string          `json:"description"`
	PhoneNumbers   []*PhoneNumber  `json:"phone_numbers"`
	RegencyID      *int64          `json:"kabkota_id"`
	Regency        *model.Location `json:"kabkota"`
	DistrictID     *int64          `json:"kec_id"`
	District       *model.Location `json:"kecamatan"`
	VillageID      *int64          `json:"kel_id"`
	Village        *model.Location `json:"kelurahan"`
	Latitude       string          `json:"latitude"`
	Longitude      string          `json:"longitude"`
	Sequence       int64           `json:"seq"`
	CoverImagePath *string         `json:"cover_image_url"`
	Status         int64           `json:"status"`
	StatusLabel    string          `json:"status_label"`
	CreatedAt      int64           `json:"created_at"`
	UpdatedAt      int64           `json:"updated_at"`
}

PhonebookDetail ...

type PhonebookWithMeta

type PhonebookWithMeta struct {
	Phonebooks []*Phonebook `json:"items"`
	Meta       *Metadata    `json:"_meta"`
}

PhonebookWithMeta ...

type StatusResponse

type StatusResponse struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

StatusResponse ...

type UpdatePhonebookRequest

type UpdatePhonebookRequest struct {
	ID             int64          `json:"id"`
	Name           string         `json:"name"`
	Description    *string        `json:"description"`
	PhoneNumbers   []*PhoneNumber `json:"phone_numbers"`
	RegencyID      *int64         `json:"kabkota_id"`
	DistrictID     *int64         `json:"kec_id"`
	VillageID      *int64         `json:"kel_id"`
	Status         *int64         `json:"status"`
	Latitude       *string        `json:"latitude"`
	Longitude      *string        `json:"longitude"`
	CategoryID     *int64         `json:"category_id"`
	CoverImagePath *string        `json:"cover_image_path"`
	Address        *string        `json:"address"`
	Sequence       *int64         `json:"seq,omitempty"`
}

UpdatePhonebookRequest ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL