sdlog

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 CountRequest

type CountRequest struct {
	TargetID *int64
	UserID   *int64
	Type     *SDLogType
}

type CountResponse

type CountResponse struct {
	Count int64
}

type CreateRequest

type CreateRequest struct {
	TargetID  int64
	UserID    int64
	Type      SDLogType
	Extra     SDLogExtra
	CreatedAt time.Time
}

CreateRequest ...

type CreateResponse

type CreateResponse struct {
	SDLog
}

CreateResponse ...

type FindRequest

type FindRequest struct {
	LogID     *int64
	TargetID  *int64
	UserID    *int64
	Type      *SDLogType
	Page      *int16 // 页数从1开始,默认1
	PageSize  *int16 // 页项,默认10
	CreatedAt *time.Time
}

FindRequest ...

type FindResponse

type FindResponse struct {
	List  []SDLog
	Total int64
}

FindResponse ...

type SDLog

type SDLog struct {
	LogID     int64      `json:"log_id"`
	TargetID  int64      `json:"target_id"`
	UserID    int64      `json:"user_id"`
	Type      SDLogType  `json:"type"`
	Extra     SDLogExtra `json:"extra"`
	CreatedAt time.Time  `json:"created_at"`
}

type SDLogExtra

type SDLogExtra struct {
	Count  int64  `json:"count"`
	Detail string `json:"detail"`
}

type SDLogModel

type SDLogModel struct {
	ID        int64     `gorm:"primary_key;AUTO_INCREMENT;not null"`
	UserID    int64     `gorm:"not null;"`
	TargetID  int64     `gorm:"not null;"`
	Type      string    `gorm:"type:varchar(60);not null"`
	CreatedAt time.Time `gorm:"DEFAULT:CURRENT_TIMESTAMP;NOT NULL"`
	Extra     string    `gorm:"type:TEXT;"`
}

func (SDLogModel) TableName

func (SDLogModel) TableName() string

type SDLogService

type SDLogService struct {
	SDLogServiceInterface
	// contains filtered or unexported fields
}

func SDLogServiceInstance

func SDLogServiceInstance() *SDLogService

func (SDLogService) Count

func (ss SDLogService) Count(req CountRequest) (*CountResponse, error)

Count...

func (SDLogService) Create

func (ss SDLogService) Create(req CreateRequest) (*CreateResponse, error)

Create ...

func (SDLogService) Find

func (ss SDLogService) Find(req FindRequest) (*FindResponse, error)

Find ...

type SDLogServiceInterface

type SDLogServiceInterface interface {
	Find(req FindRequest) (*FindResponse, error)
	Create(req CreateRequest) (*CreateResponse, error)
	Count(req CountRequest) (*CountResponse, error)
}

type SDLogType

type SDLogType string
const (
	Clap       SDLogType = "CLAP"
	CancelClap SDLogType = "CANCELCLAP"
	Login      SDLogType = "LOGIN"
	Logout     SDLogType = "LOGOUT"
	Publish    SDLogType = "PUBLISH"
	SIGN       SDLogType = "SIGN"
)

Jump to

Keyboard shortcuts

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