Documentation ¶
Index ¶
- func ConvertPhoneNumber(phoneNumber string) (bool, string)
- func IsKatakana(str string) bool
- func IsValidPostalCode(postalCode string) (bool, string)
- type AddressRegisterPayload
- type IRepository
- type IRequests
- type IUtils
- type Requests
- func (r Requests) AddressRegister(userId string, AddressRegisterPayload AddressRegisterPayload) error
- func (r Requests) AddressUpdate(userId string, userAddress UserAddress) error
- func (r Requests) Create(userId string) error
- func (r Requests) Delete(userId string) error
- func (r Requests) Get(userId string) (User, error)
- func (r Requests) ProfileUpdate(userId string, userProfile UserProfile) error
- type User
- type UserAddress
- type UserProfile
- type UserProfileRegisterPayload
- type UserRepository
- func (r UserRepository) Create(UserId string) error
- func (r UserRepository) Delete(UserId string) error
- func (r UserRepository) Get(UserId string) (user User, err error)
- func (r UserRepository) RegisterAddress(UserId string, payload AddressRegisterPayload) error
- func (r UserRepository) UpdateAddress(UserId string, payload map[string]interface{}) error
- func (r UserRepository) UpdateProfile(UserId string, payload map[string]interface{}) error
- type UserUtils
- func (u UserUtils) InspectAddressRegisterPayload(address AddressRegisterPayload) (AddressRegisterPayload, error)
- func (u UserUtils) InspectAddressUpdatePayload(address UserAddress) (map[string]interface{}, error)
- func (u UserUtils) InspectProfileUpdatePayload(profile UserProfile) map[string]interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertPhoneNumber ¶
func IsKatakana ¶
func IsValidPostalCode ¶
Types ¶
type AddressRegisterPayload ¶
type AddressRegisterPayload struct { FirstName string `json:"first_name" binding:"required"` FirstNameKana string `json:"first_name_kana" binding:"required"` LastName string `json:"last_name" binding:"required"` LastNameKana string `json:"last_name_kana" binding:"required"` ZipCode string `json:"zip_code" binding:"required"` Address1 string `json:"address_1" binding:"required"` Address2 string `json:"address_2" binding:"required"` Address3 string `json:"address_3"` PhoneNumber string `json:"phone_number" binding:"required"` }
type IRepository ¶
type IRequests ¶
type IRequests interface { Create(userId string) error Get(userId string) (User, error) Delete(userId string) error ProfileUpdate(userId string, userProfile UserProfile) error AddressRegister(userId string, AddressRegisterPayload AddressRegisterPayload) error AddressUpdate(userId string, userAddress UserAddress) error }
type IUtils ¶
type IUtils interface { InspectAddressRegisterPayload(AddressRegisterPayload) (AddressRegisterPayload, error) InspectProfileUpdatePayload(UserProfile) map[string]interface{} InspectAddressUpdatePayload(UserAddress) (map[string]interface{}, error) }
type Requests ¶
type Requests struct { UserRepository IRepository UserUtils IUtils }
func (Requests) AddressRegister ¶
func (r Requests) AddressRegister(userId string, AddressRegisterPayload AddressRegisterPayload) error
func (Requests) AddressUpdate ¶
func (r Requests) AddressUpdate(userId string, userAddress UserAddress) error
func (Requests) ProfileUpdate ¶
func (r Requests) ProfileUpdate(userId string, userProfile UserProfile) error
type User ¶
type User struct { UserId string `json:"user_id" gorm:"user_id"` UserProfile UserProfile `json:"profile" gorm:"profile"` UserAddress UserAddress `json:"address" gorm:"address"` }
type UserAddress ¶
type UserAddress struct { FirstName string `json:"first_name" gorm:"first_name"` FirstNameKana string `json:"first_name_kana" gorm:"first_name_kana"` LastName string `json:"last_name" gorm:"last_name"` LastNameKana string `json:"last_name_kana" gorm:"last_name_kana"` ZipCode string `json:"zip_code" gorm:"zip_code"` Address1 string `json:"address_1" gorm:"address_1"` Address2 string `json:"address_2" gorm:"address_2"` Address3 string `json:"address_3" gorm:"address_3"` PhoneNumber string `json:"phone_number" gorm:"phone_number"` }
type UserProfile ¶
type UserRepository ¶
func (UserRepository) Create ¶
func (r UserRepository) Create(UserId string) error
firstorinitをそのうち使うかもしれない
func (UserRepository) Delete ¶
func (r UserRepository) Delete(UserId string) error
func (UserRepository) RegisterAddress ¶
func (r UserRepository) RegisterAddress(UserId string, payload AddressRegisterPayload) error
func (UserRepository) UpdateAddress ¶
func (r UserRepository) UpdateAddress(UserId string, payload map[string]interface{}) error
func (UserRepository) UpdateProfile ¶
func (r UserRepository) UpdateProfile(UserId string, payload map[string]interface{}) error
type UserUtils ¶
type UserUtils struct { }
func (UserUtils) InspectAddressRegisterPayload ¶
func (u UserUtils) InspectAddressRegisterPayload(address AddressRegisterPayload) (AddressRegisterPayload, error)
func (UserUtils) InspectAddressUpdatePayload ¶
func (u UserUtils) InspectAddressUpdatePayload(address UserAddress) (map[string]interface{}, error)
func (UserUtils) InspectProfileUpdatePayload ¶
func (u UserUtils) InspectProfileUpdatePayload(profile UserProfile) map[string]interface{}
Click to show internal directories.
Click to hide internal directories.