user

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 24 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(c *gin.Context)

Register Add developer @Summary Add developer @Description Admin add developer @Tags Users @Produce json @param Authorization header string true "Authorization" @Param register body user.CreateUserRequest true "Reg user info" @Success 200 {object} model.UserInfo @Router /v1/users [post]

func Delete

func Delete(c *gin.Context)

Create Delete users @Summary Delete users @Description Delete users @Tags Users @Accept json @Produce json @param Authorization header string true "Authorization" @Param id path uint64 true "User ID" @Success 200 {object} api.Response "{"code":0,"message":"OK","data":null}" @Router /v1/users/{id} [delete]

func Get

func Get(c *gin.Context)

Get Get user details @Summary Get user details @Description Get user details @Tags Users @Accept json @Produce json @Param id path string true "Users ID" @param Authorization header string true "Authorization" @Success 200 {object} model.UserInfo "Userinfo" @Router /v1/users/{id} [get]

func GetList

func GetList(c *gin.Context)

Get Get user list @Summary Get user list @Description Get userlist @Tags Users @Accept json @Produce json @param Authorization header string true "Authorization" @Success 200 {object} model.UserList "Get user list" @Router /v1/users [get]

func GetMe

func GetMe(c *gin.Context)

Get Get user personal information @Summary Get user personal information @Description Get user personal information @Tags Users @Accept json @Produce json @param Authorization header string true "Authorization" @Success 200 {object} model.UserInfo "Userinfo" @Router /v1/me [get]

func Import

func Import(c *gin.Context)

func ImportStatus

func ImportStatus(c *gin.Context)

func ListByApplication

func ListByApplication(c *gin.Context)

List all authorized user in application

func ListNotInApplication

func ListNotInApplication(c *gin.Context)

List all unauthorized user in application

func Login

func Login(c *gin.Context)

Login Web and plug-in login @Summary Web and plug-in login @Description Web and plug-in login @Tags Users @Produce json @Param login body user.LoginCredentials true "Login user info" @Success 200 {string} json "{"code":0,"message":"OK","data":{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"}}" @Router /v1/login [post]

func RefreshToken

func RefreshToken(c *gin.Context)

func Register

func Register(c *gin.Context)

Register Registration(obsolete) @Summary The administrator adds users, users cannot register themselves @Description Registration(obsolete) @Tags Users @Produce json @Param register body user.RegisterRequest true "Reg user info" @Success 200 {string} json "{"code":0,"message":"OK","data":{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"}}" @Router /v1/register [post]

func Update

func Update(c *gin.Context)

Update Update user information @Summary Update user information (including disabled users) @Description Update a user by ID,Only status is required @Tags Users @Accept json @Produce json @param Authorization header string true "Authorization" @Param id path uint64 true "The user's database id index num" @Param user body user.UpdateUserRequest true "Update user info" @Success 200 {object} model.UserBaseModel @Router /v1/users/{id} [put]

Types

type CreateRequest

type CreateRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

CreateRequest

type CreateResponse

type CreateResponse struct {
	Username string `json:"username"`
}

CreateResponse

type CreateUserRequest

type CreateUserRequest struct {
	Email           string  `json:"email" form:"email" binding:"required"`
	Name            string  `json:"name" form:"name" binding:"required"`
	Password        string  `json:"password" form:"password" binding:"required"`
	ConfirmPassword string  `json:"confirm_password" form:"confirm_password" binding:"required"`
	Status          *uint64 `json:"status" form:"status" binding:"required"`
	IsAdmin         *uint64 `json:"is_admin" form:"is_admin" binding:"required"`
}

CreateUserRequest

type ImportTaskStatus

type ImportTaskStatus struct {
	Process float32 // 0.0 ~ 1.0
	Items   []ItemStatus
	ErrInfo string
}

type ItemStatus

type ItemStatus struct {
	Success            bool
	Email              string
	Username           string
	CooperatorDevSpace string
	ViewerDevSpace     string
	ErrInfo            string
}

type ListResponse

type ListResponse struct {
	TotalCount uint64      `json:"total_count"`
	HasMore    int         `json:"has_more"`
	PageKey    string      `json:"page_key"`
	PageValue  int         `json:"page_value"`
	Items      interface{} `json:"items"`
}

ListResponse

type LoginCredentials

type LoginCredentials struct {
	Email    string `json:"email" form:"email" binding:"required"`
	Password string `json:"password" form:"password" binding:"required"`
	From     string `json:"from" form:"from" example:"only use for plugin, web interface do not send this key"`
}

LoginCredentials

type RegisterRequest

type RegisterRequest struct {
	Email           string `json:"email" form:"email"`
	Password        string `json:"password" form:"password"`
	ConfirmPassword string `json:"confirm_password" form:"confirm_password"`
}

RegisterRequest

type SwaggerListResponse

type SwaggerListResponse struct {
	TotalCount uint64           `json:"totalCount"`
	UserList   []model.UserInfo `json:"userList"`
}

SwaggerListResponse

type UpdateRequest

type UpdateRequest struct {
	Avatar string `json:"avatar"`
	Sex    int    `json:"sex"`
}

UpdateRequest

type UpdateUserRequest

type UpdateUserRequest struct {
	Email    string  `json:"email" form:"email"`
	Name     string  `json:"name" form:"name"`
	Password string  `json:"password" form:"password"`
	Status   *uint64 `json:"status" form:"status"`
	IsAdmin  *uint64 `json:"is_admin" form:"is_admin"`
}

UpdateUserRequest

Jump to

Keyboard shortcuts

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