profile

package
v0.0.0-...-9fc3f77 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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 NewJdbcImpl(db *gorm.DB) *JdbcImpl

func (*JdbcImpl) CreateProfile

func (impl *JdbcImpl) CreateProfile(ctx context.Context, user *Profile) *gorm.DB

func (*JdbcImpl) DeleteProfile

func (impl *JdbcImpl) DeleteProfile(ctx context.Context, userId uint) *gorm.DB

func (*JdbcImpl) GetAllProfiles

func (impl *JdbcImpl) GetAllProfiles(ctx context.Context) (users []*Profile, err error)

GetAllProfiles get all users' profile from database. When the amount of data is large, this function may cause library dragging.

func (*JdbcImpl) GetProfileByUserId

func (impl *JdbcImpl) GetProfileByUserId(ctx context.Context, userId uint) (*Profile, error)

func (*JdbcImpl) UpdateProfile

func (impl *JdbcImpl) UpdateProfile(ctx context.Context, user *Profile) *gorm.DB

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)"`
}

func (Profile) Table

func (Profile) Table() string

Jump to

Keyboard shortcuts

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