admin

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AdminRequired = "未经授权访问"
)

Variables

This section is empty.

Functions

func GetProjectsList

func GetProjectsList(c *gin.Context)

GetProjectsList 获取项目列表 @Tags admin @Param request query ListProjectsRequest true "request query" @Produce json @Success 200 {object} ListProjectsResponse @Router /api/v1/admin/projects [get]

func ListUsers

func ListUsers(c *gin.Context)

ListUsers @Tags admin @Param request query listUsersRequest true "request query" @Produce json @Success 200 {object} listUsersResponse @Router /api/v1/admin/users [get]

func LoginAdminRequired

func LoginAdminRequired() gin.HandlerFunc

func QueryUsersList

func QueryUsersList(ctx context.Context, req *listUsersRequest) (int64, []oauth.User, error)

QueryUsersList 获取用户列表

func ReviewProject

func ReviewProject(c *gin.Context)

ReviewProject 审核项目 @Tags admin @Accept json @Produce json @Param id path string true "项目ID" @Param project body ReviewProjectRequest true "项目信息" @Success 200 {object} ReviewProjectResponse @Router /api/v1/admin/projects/{id}/review [put]

Types

type ListProjectsRequest

type ListProjectsRequest struct {
	Current int                    `json:"current" form:"current" binding:"min=1"`
	Size    int                    `json:"size" form:"size" binding:"min=1,max=100"`
	Status  *project.ProjectStatus `json:"status" form:"status" binding:"omitempty,oneof=0 1 2"`
}

type ListProjectsResponse

type ListProjectsResponse struct {
	ErrorMsg string                    `json:"error_msg"`
	Data     *ListProjectsResponseData `json:"data"`
}

type ListProjectsResponseData

type ListProjectsResponseData struct {
	Total   int64                             `json:"total"`
	Results *[]ListProjectsResponseDataResult `json:"results"`
}

func QueryProjectsList

func QueryProjectsList(ctx context.Context, offset, limit int, status *project.ProjectStatus) (*ListProjectsResponseData, error)

QueryProjectsList 获取项目列表

type ListProjectsResponseDataResult

type ListProjectsResponseDataResult struct {
	ID          string                `json:"id"`
	Username    string                `json:"username"`
	Nickname    string                `json:"nickname"`
	Description string                `json:"description"`
	Status      project.ProjectStatus `json:"status"`
	Tags        utils.StringArray     `json:"tags"`
}

type ReviewProjectRequest

type ReviewProjectRequest struct {
	Status project.ProjectStatus `json:"status" binding:"oneof=0 1 2"`
}

type ReviewProjectResponse

type ReviewProjectResponse struct {
	ErrorMsg string      `json:"error_msg"`
	Data     interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

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