entity

package
v0.0.0-...-7c35eaa Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompanySizeType

type CompanySizeType int
const (
	STARTUP CompanySizeType = iota // 스타트업
	SMALL                          // 중소기업
	MEDIUM                         // 중견기업
	LARGE                          // 대기업
	FOREIGN                        // 외국계
)

type Feed

type Feed struct {
	ID          uint            `gorm:"column:id;primarykey"`
	Name        string          `gorm:"column:name;type:varchar;not null"`
	Title       string          `gorm:"column:title;type:varchar;not null"`
	Description string          `gorm:"column:description;type:varchar;not null"`
	Link        string          `gorm:"column:link;type:varchar;not null;unique"`
	Updated     time.Time       `gorm:"column:updated;type:timestamp;not null"`
	Copyright   string          `gorm:"column:copyright;type:varchar;not null"`
	CompanySize CompanySizeType `gorm:"column:company_size;type:int2;not null"`
	RssID       uint            `gorm:"column:rss_id;type:int8;not null"`
	Items       []Item          `gorm:"foreignKey:FeedID"`
}

type FeedRepo

type FeedRepo interface {
	FindAll(keyword *string) ([]Feed, error)
}

type Item

type Item struct {
	ID          uint       `gorm:"column:id;primarykey"`
	Title       string     `gorm:"column:title;type:varchar;not null"`
	Description string     `gorm:"column:description;type:varchar;not null"`
	Link        string     `gorm:"column:link;type:varchar;not null"`
	Thumbnail   *string    `gorm:"column:thumbnail;type:varchar"`
	Published   time.Time  `gorm:"column:published;type:timestamp;not null"`
	GUID        string     `gorm:"column:guid;type:varchar;not null"`
	Summary     string     `gorm:"column:summary;type:varchar"`
	Views       uint       `gorm:"column:views;type:int8;not null;default:0"`
	Likes       uint       `gorm:"column:likes;type:int8;not null;default:0"`
	FeedID      uint       `gorm:"column:feed_id;type:int8;not null"`
	JobTags     []JobTag   `gorm:"many2many:item_job_tags;"`
	SkillTags   []SkillTag `gorm:"many2many:item_skill_tags;"`
}

type ItemRepo

type ItemRepo interface {
	CountView(company *string, companySizes *[]CompanySizeType, jobTags, skillTags *[]int64) (int64, error)
	FindAllView(company *string, companySizes *[]CompanySizeType, jobTags, skillTags *[]int64, perPage, page int) ([]ItemView, error)
	Exist(id int64) (bool, error)
	IncreaseViewCount(id int64) (int64, error)
	IncreaseLikeCount(id int64) (int64, error)
	FindAllViewByExcludedIds(ids []int64, perPage int32) ([]ItemView, error)
}

type ItemView

type ItemView struct {
	ItemID          uint            `gorm:"column:item_id;type:int8"`
	ItemTitle       string          `gorm:"column:item_title;type:varchar"`
	ItemDescription string          `gorm:"column:item_description;type:varchar"`
	ItemLink        string          `gorm:"column:item_link;type:varchar"`
	ItemThumbnail   *string         `gorm:"column:item_thumbnail;type:varchar"`
	ItemPublished   time.Time       `gorm:"column:item_published;type:timestamp"`
	ItemSummary     *string         `gorm:"column:item_summary;type:varchar"`
	ItemViews       uint            `gorm:"column:item_views;type:int8"`
	ItemLikes       uint            `gorm:"column:item_likes;type:int8"`
	FeedName        string          `gorm:"column:feed_name;type:varchar"`
	FeedTitle       string          `gorm:"column:feed_title;type:varchar"`
	FeedLink        string          `gorm:"column:feed_link;type:varchar"`
	CompanySize     CompanySizeType `gorm:"column:company_size;type:int2"`
	JobTagIDArr     pq.Int64Array   `gorm:"column:job_tags_id_arr;type:int8[]"`
	SkillTagIDArr   pq.Int64Array   `gorm:"column:skill_tags_id_arr;type:int8[]"`
}

func (ItemView) TableName

func (ItemView) TableName() string

type JobTag

type JobTag struct {
	ID      uint           `gorm:"column:id;primarykey"`
	Name    string         `gorm:"column:name;type:varchar;not null"`
	Keyword pq.StringArray `gorm:"column:keyword;type:text[];not null"`
}

type JobTagRepo

type JobTagRepo interface {
	FindAll() ([]JobTag, error)
}

type Rss

type Rss struct {
	ID      uint      `gorm:"column:id;primarykey"`
	Name    string    `gorm:"column:name;type:varchar;not null;unique"`
	Link    string    `gorm:"column:link;type:varchar;not null;unique"`
	Updated time.Time `gorm:"column:updated;type:timestamp"`
	Ok      bool      `gorm:"column:ok;type:bool"`
	Error   string    `gorm:"column:error;type:varchar"`
	Feed    Feed      `gorm:"foreignKey:RssID"`
}

type SkillTag

type SkillTag struct {
	ID      uint           `gorm:"column:id;primarykey"`
	Name    string         `gorm:"column:name;type:varchar;not null"`
	Keyword pq.StringArray `gorm:"column:keyword;type:text[];not null"`
}

type SkillTagRepo

type SkillTagRepo interface {
	FindAll() ([]SkillTag, error)
}

type Subscription

type Subscription struct {
	ID                      uint          `gorm:"column:id;primarykey" json:"id"`
	Email                   string        `gorm:"column:email;type:varchar;not null;unique" json:"email"`
	Name                    *string       `gorm:"column:name;type:varchar" json:"name"`
	Division                *string       `gorm:"column:division;type:varchar" json:"division"`
	PreferredCompanyArr     pq.Int64Array `gorm:"column:preferred_company_arr;type:int8[];not null" json:"preferred_company_arr"`
	PreferredCompanySizeArr pq.Int64Array `gorm:"column:preferred_company_size_arr;type:int8[];not null" json:"preferred_company_size_arr"`
	PreferredJobArr         pq.Int64Array `gorm:"column:preferred_job_arr;type:int8[];not null" json:"preferred_job_arr"`
	PreferredSkillArr       pq.Int64Array `gorm:"column:preferred_skill_arr;type:int8[];not null" json:"preferred_skill_arr"`
	Published               time.Time     `gorm:"column:published;type:timestamp;not null" json:"published"`
}

type SubscriptionRepo

type SubscriptionRepo interface {
	ExistEmail(email string) (*int64, error)
	Create(subscription Subscription) (*Subscription, error)
	Update(id int64, subscription Subscription) (*Subscription, error)
	Delete(id int64) (*Subscription, error)
}

Jump to

Keyboard shortcuts

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