config

package
v0.0.0-...-e2f6c6f Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApiUrl                    string = "/api"
	RegistUrl                 string = "/regist"
	LoginUrl                  string = "/login"
	GetUserInfoByIdUrl        string = "/getuserinfobyid"
	PostIdeaUrl               string = "/postidea"
	DeleteIdeaUrl             string = "/deleteidea"
	ShowNewestIdeasUrl        string = "/shownewestideas"
	ShowAllIdeasByUserInfoUrl string = "/showallideasbyuserinfo"
	SearchIdeaByTitleUrl      string = "/searchideabytitle"
	SearchIdeaByTextUrl       string = "/searchideabytext"
)

所有URL

View Source
const (
	DefaultCost int = 10
)

用户密码加密COST

View Source
const (
	IdeasNum int64 = 30
)

每次返回帖子数量

Variables

允许直接通过的URL

Functions

func DbInit

func DbInit()

1.建立连接

func GetCommentCollection

func GetCommentCollection() *mongo.Collection

func GetError

func GetError() error

func GetIdeaCollection

func GetIdeaCollection() *mongo.Collection

func GetUserCollection

func GetUserCollection() *mongo.Collection

func SetRouter

func SetRouter(r *gin.Engine, groupPath string, c *ControllerSet)

Types

type ControllerSet

type ControllerSet struct {
	// contains filtered or unexported fields
}

func NewControllerSet

func NewControllerSet() *ControllerSet

func (*ControllerSet) ADD

func (c *ControllerSet) ADD(p string, m MethodType, f func(*gin.Context))

type MethodType

type MethodType string
const (
	Method_GET    MethodType = "GET"
	Method_POST   MethodType = "POST"
	Method_DELETE MethodType = "DELETE"
)

请求方式

Jump to

Keyboard shortcuts

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