Documentation
¶
Index ¶
- type DAO
- type JdbcImpl
- func (impl *JdbcImpl) CreateProfile(ctx context.Context, user *Profile) *gorm.DB
- func (impl *JdbcImpl) DeleteProfile(ctx context.Context, userId uint) *gorm.DB
- func (impl *JdbcImpl) GetAllProfiles(ctx context.Context) (users []*Profile, err error)
- func (impl *JdbcImpl) GetProfileByUserId(ctx context.Context, userId uint) (*Profile, error)
- func (impl *JdbcImpl) UpdateProfile(ctx context.Context, user *Profile) *gorm.DB
- type Profile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DAO ¶
type DAO interface { GetProfileByUserId(ctx context.Context, userId uint) (*Profile, error) GetAllProfiles(ctx context.Context) ([]*Profile, error) CreateProfile(ctx context.Context, user *Profile) *gorm.DB UpdateProfile(ctx context.Context, user *Profile) *gorm.DB DeleteProfile(ctx context.Context, id uint) *gorm.DB }
type JdbcImpl ¶
type JdbcImpl struct {
// contains filtered or unexported fields
}
func NewJdbcImpl ¶
func (*JdbcImpl) CreateProfile ¶
func (*JdbcImpl) DeleteProfile ¶
func (*JdbcImpl) GetAllProfiles ¶
GetAllProfiles get all users' profile from database. When the amount of data is large, this function may cause library dragging.
func (*JdbcImpl) GetProfileByUserId ¶
type Profile ¶
type Profile struct { global.Model UserId uint `json:"userId" gorm:"column:userId;type:uint;size:32;not null"` Name string `json:"name" gorm:"column:name;type:varchar(255)"` IDCard string `json:"IDCard" gorm:"column:IDCard;type:varchar(255)"` Avatar string `json:"avatar" gorm:"column:avatar;type:varchar(255)"` Gender string `json:"gender" gorm:"column:gender;type:enum('m','f','-');not null;default:'-'"` Intro string `json:"intro" gorm:"column:intro;type:varchar(512)"` }
Click to show internal directories.
Click to hide internal directories.