domain

package
v0.0.0-...-3d1b5a8 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReplyService

type ReplyService interface {
	ReplyForecast(*Tweet) (*SnowResort, error)
}

func NewReplyServiceImpl

func NewReplyServiceImpl(searcher searcher.Searchr, twitterApiClient twitter.IApiClient, snowforecastApiClient snowforecast.IApiClient) ReplyService

type ReplyServiceImpl

type ReplyServiceImpl struct {
	// ドメイン層は他の層にも依存しない
	SnowResortSearcher    searcher.Searchr
	TwitterApiClient      twitter.IApiClient
	SnowforecastApiClient snowforecast.IApiClient
}

func (ReplyServiceImpl) ReplyForecast

func (r ReplyServiceImpl) ReplyForecast(tweet *Tweet) (*SnowResort, error)

検索すること自体がビジネスロジックであるため、ドメイン層に含める

type SnowResort

type SnowResort struct {
	Name      string `db:"name" json:"name"`
	SearchKey string `db:"search_key" json:"search_key"`
}

type SnowResortRepository

type SnowResortRepository interface {
	FindAll() ([]*SnowResort, error)
}

type Tweet

type Tweet struct {
	ID             string
	UserScreenName string
	Text           string
}

Jump to

Keyboard shortcuts

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