model

package
v0.0.0-...-839337a Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: BSD-2-Clause Imports: 0 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// 请求错误
	ErrorRequestBodyParseFailed = ErrResponse{HttpSc: 400, Error: Err{Error: "request - fail", ErrorCode: "001"}}
	// 未验证用户错误
	ErrorNotAuthUser = ErrResponse{HttpSc: 401, Error: Err{Error: "AuthUser - fail", ErrorCode: "002"}}
	// DB数据库错误
	ErrorDBError = ErrResponse{HttpSc: 500, Error: Err{Error: "DB ops failed", ErrorCode: "003"}}
	// 网络服务错误
	ErrorInternalFaults = ErrResponse{HttpSc: 500, Error: Err{Error: "Internal service error", ErrorCode: "004"}}
)

Functions

This section is empty.

Types

type Comment

type Comment struct {
	Id      string
	VideoId string
	Author  string
	Content string
}

type Err

type Err struct {
	Error     string `json:"error"`
	ErrorCode string `json:"error_code"`
}

type ErrResponse

type ErrResponse struct {
	HttpSc int // 错误码
	Error  Err
}

type SignedUp

type SignedUp struct {
	Success   bool   `json:"success"`
	SessionId string `json:"session_id"`
}

response

type SimpleSession

type SimpleSession struct {
	Username string //login name
	TTL      int64
}

type UserModelInterface

type UserModelInterface struct {
	// 开头大写,导出 json 标记
	Username string `json:"user_name"`
	Password string `json:"password"`
}

type VideoInfo

type VideoInfo struct {
	Id           string
	AuthorId     int
	Name         string
	DisplayCtime string
}

Data model

Jump to

Keyboard shortcuts

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