user

package
v0.0.0-...-cc1fd88 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GenderMap = map[Gender]string{
		GenderMale:           "男性",
		GenderFemale:         "女性",
		GenderOther:          "その他",
		GenderPreferNotToSay: "回答しない",
	}
)
View Source
var (
	OccupationMap = map[Occupation]string{
		OccupationFullTimeEmployee: "正社員",
		OccupationContractEmployee: "契約社員",
		OccupationPublicServant:    "公務員",
		OccupationSelfEmployed:     "自営業",
		OccupationExecutive:        "会社役員",
		OccupationPartTimeEmployee: "パート・アルバイト",
		OccupationHomemaker:        "家事従事者",
		OccupationStudent:          "学生",
		OccupationUnemployed:       "無職",
		OccupationOther:            "回答しない",
	}
)

Functions

This section is empty.

Types

type City

type City string

func NewCity

func NewCity(city *string) *City

func (City) String

func (m City) String() string

type Gender

type Gender int
const (
	GenderMale Gender = iota + 1
	GenderFemale
	GenderOther
	GenderPreferNotToSay
)

func NewGender

func NewGender(s *string) Gender

func (Gender) String

func (g Gender) String() string

type HouseholdSize

type HouseholdSize int

func NewHouseholdSize

func NewHouseholdSize(size *int) *HouseholdSize

type Occupation

type Occupation int
const (
	OccupationFullTimeEmployee Occupation = iota + 1 // 正社員
	OccupationContractEmployee                       // 契約社員
	OccupationPublicServant                          // 公務員
	OccupationSelfEmployed                           // 自営業
	OccupationExecutive                              // 会社役員
	OccupationPartTimeEmployee                       // パート・アルバイト
	OccupationHomemaker                              // 専業主婦
	OccupationStudent                                // 学生
	OccupationUnemployed                             // 無職
	OccupationOther                                  // 回答しない
)

func NewOccupation

func NewOccupation(occupation *string) *Occupation

func (Occupation) String

func (o Occupation) String() string

type ProfileIcon

type ProfileIcon struct {
	// contains filtered or unexported fields
}

func NewProfileIcon

func NewProfileIcon(
	url *string,
) *ProfileIcon

func (*ProfileIcon) ImageInfo

func (p *ProfileIcon) ImageInfo() *image.ImageInfo

func (*ProfileIcon) SetProfileIconImage

func (p *ProfileIcon) SetProfileIconImage(
	ctx context.Context,
	file *multipart.FileHeader,
	user User,
) error

func (*ProfileIcon) URL

func (p *ProfileIcon) URL() *string

type User

type User struct {
	// contains filtered or unexported fields
}

func NewUser

func NewUser(
	userID shared.UUID[User],
	displayID *string,
	displayName *string,
	subject string,
	provider oauth.AuthProviderName,
	profileIcon *ProfileIcon,
) User

func (*User) ChangeName

func (u *User) ChangeName(name string)

func (*User) DeleteIcon

func (u *User) DeleteIcon()

func (*User) Demographics

func (u *User) Demographics() *UserDemographics

func (*User) DisplayID

func (u *User) DisplayID() *string

func (*User) DisplayName

func (u *User) DisplayName() *string

func (*User) IsIconUpdateRequired

func (u *User) IsIconUpdateRequired() bool

func (*User) ProfileIcon

func (u *User) ProfileIcon() *ProfileIcon

func (*User) ProfileIconURL

func (u *User) ProfileIconURL() *string

func (*User) Provider

func (u *User) Provider() oauth.AuthProviderName

func (*User) SetDemographics

func (u *User) SetDemographics(demographics UserDemographics)

func (*User) SetDisplayID

func (u *User) SetDisplayID(id string) error

func (*User) SetDisplayName

func (u *User) SetDisplayName(name string)

func (*User) SetIconFile

func (u *User) SetIconFile(ctx context.Context, file *multipart.FileHeader) error

func (*User) Subject

func (u *User) Subject() string

func (*User) UserID

func (u *User) UserID() shared.UUID[User]

func (*User) Verify

func (u *User) Verify() bool

type UserDemographics

type UserDemographics struct {
	// contains filtered or unexported fields
}

func NewUserDemographics

func NewUserDemographics(
	userDemographicsID shared.UUID[UserDemographics],
	yearOfBirth *YearOfBirth,
	occupation *Occupation,
	gender *Gender,
	city *City,
	householdSize *HouseholdSize,
	prefecture *string,
) UserDemographics

func (*UserDemographics) Age

func (u *UserDemographics) Age() int

ユーザーの年齢を返す

func (*UserDemographics) ChangeYearOfBirth

func (u *UserDemographics) ChangeYearOfBirth(yearOfBirth *YearOfBirth)

func (*UserDemographics) City

func (u *UserDemographics) City() *City

func (*UserDemographics) Gender

func (u *UserDemographics) Gender() Gender

func (*UserDemographics) HouseholdSize

func (u *UserDemographics) HouseholdSize() *HouseholdSize

func (*UserDemographics) Occupation

func (u *UserDemographics) Occupation() Occupation

func (*UserDemographics) Prefecture

func (u *UserDemographics) Prefecture() *string

func (*UserDemographics) UserDemographicsID

func (u *UserDemographics) UserDemographicsID() shared.UUID[UserDemographics]

func (*UserDemographics) YearOfBirth

func (u *UserDemographics) YearOfBirth() *YearOfBirth

type UserName

type UserName string

func (UserName) String

func (a UserName) String() string

type UserRepository

type UserRepository interface {
	Create(context.Context, User) error
	FindByID(context.Context, shared.UUID[User]) (*User, error)
	FindBySubject(context.Context, UserSubject) (*User, error)
	FindByDisplayID(context.Context, string) (*User, error)
	Update(context.Context, User) error
}

type UserService

type UserService interface {
	// DisplayIDCheckDuplicate ユーザーの表示用IDが重複していないかチェック
	DisplayIDCheckDuplicate(context.Context, string) (bool, error)
}

UserService ユーザードメインサービス

type UserSubject

type UserSubject string

func (UserSubject) String

func (a UserSubject) String() string

type YearOfBirth

type YearOfBirth int

func NewYearOfBirth

func NewYearOfBirth(year *int) *YearOfBirth

func (YearOfBirth) Age

func (y YearOfBirth) Age() int

Jump to

Keyboard shortcuts

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