user

package
v0.0.0-...-03eec91 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseInfo

type BaseInfo struct {
	UserID    int64         `json:"user_id"`
	Name      string        `json:"name"`
	AvatarURL string        `json:"avatar_url"`
	Company   *string       `json:"company"`
	Email     *string       `json:"email"`
	CreatedAt time.Time     `json:"created_at"`
	UpdatedAt time.Time     `json:"updated_at"`
	Extra     BaseInfoExtra `json:"extra"`
}

BaseInfo ...

type BaseInfoExtra

type BaseInfoExtra struct {
	GithubHome string `json:"github_home"`
}

BaseExtra ...

type CreateRequest

type CreateRequest struct {
	Name      string
	AvatarURL string
	Company   *string
	Email     *string
	Extra     BaseInfoExtra
}

CreateRequest ...

type CreateResponse

type CreateResponse struct {
	BaseInfo
}

CreateResponse ...

type DeleteRequest

type DeleteRequest struct {
	UserID int64
}

DeleteRequest ...

type DeleteResponse

type DeleteResponse struct {
	BaseInfo
}

DeleteResponse ...

type FindOneRequest

type FindOneRequest struct {
	UserID *int64
	Name   *string
}

FindOneRequest ...

type FindOneResponse

type FindOneResponse struct {
	BaseInfo
}

FindOneResponse ...

type SDUser

type SDUser struct {
	// gorm.Model
	ID        int64      `gorm:"primary_key;AUTO_INCREMENT;not null"`
	UserID    int64      `gorm:"not null;"`
	Name      string     `gorm:"type:varchar(60);not null"`
	AvatarURL string     `gorm:"type:varchar(300);not null"`
	Company   *string    `gorm:"type:varchar(60)"`
	Email     *string    `gorm:"type:varchar(60)"`
	CreatedAt time.Time  `gorm:"DEFAULT:CURRENT_TIMESTAMP;NOT NULL"`
	UpdatedAt time.Time  `gorm:""`
	DeletedAt *time.Time `gorm:"" sql:"index"`
	Extra     string     `gorm:"type:TEXT;"`
}

SDUser http://gorm.io/docs/models.html

type UserService

type UserService struct {
	UserServiceInterface
	// contains filtered or unexported fields
}

func UserServiceInstance

func UserServiceInstance() *UserService

UserServiceInstance ...

func (UserService) Create

func (us UserService) Create(req CreateRequest) (*CreateResponse, error)

Create ...

func (UserService) Delete

func (us UserService) Delete(req DeleteRequest) (*DeleteResponse, error)

Delete ...

func (UserService) FindOne

func (us UserService) FindOne(req FindOneRequest) (*FindOneResponse, error)

FindOne ...

type UserServiceInterface

type UserServiceInterface interface {
	FindOne(req FindOneRequest) (*FindOneResponse, error)
	Create(req CreateRequest) (*CreateResponse, error)
	Delete(req DeleteRequest) (*DeleteResponse, error)
}

Jump to

Keyboard shortcuts

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