v1

package
v0.0.0-...-61dbfe3 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCasbin

func AddCasbin(c *gin.Context)

AddCasbin godoc @Summary 新增权限 @Description 新增权限 @Tags 权限管理 @Produce json @Security ApiKeyAuth @Param body body service.CasbinCreateRequest true "body" @Success 200 {object} string "成功" @Failure 400 {object} errcode.Error "请求错误" @Failure 500 {object} errcode.Error "内部错误" @Router /v1/casbin [post]

func AddRole

func AddRole(c *gin.Context)

AddRole 添加角色

func AddUser

func AddUser(c *gin.Context)

AddUser 添加用户

func AddVoucher

func AddVoucher(c *gin.Context)

AddVoucher 添加票券

func EditRole

func EditRole(c *gin.Context)

func EditUser

func EditUser(c *gin.Context)

EditUser 编辑用户

func EditVoucher

func EditVoucher(c *gin.Context)

EditVoucher 编辑票券

func FetchVoucher

func FetchVoucher(c *gin.Context)

FetchVoucher 秒杀票券

func GetCasbinList

func GetCasbinList(c *gin.Context)

GetCasbinList godoc @Summary 获取权限列表 @Produce json @Tags 权限管理 @Security ApiKeyAuth @Param data body service.CasbinListRequest true "角色ID" @Success 200 {object} service.CasbinListResponse "成功" @Failure 400 {object} errcode.Error "请求错误" @Failure 500 {object} errcode.Error "内部错误" @Router /v1/casbin/list [post]

func GetUserList

func GetUserList(c *gin.Context)

GetCouponList 获取优惠券列表

func GetVoucherList

func GetVoucherList(c *gin.Context)

GetCouponList 获取优惠券列表

func RemoveRole

func RemoveRole(c *gin.Context)

func RemoveUser

func RemoveUser(c *gin.Context)

RemoveVoucher 移除票券

func RemoveVoucher

func RemoveVoucher(c *gin.Context)

RemoveVoucher 移除票券

func RoleList

func RoleList(c *gin.Context)

Types

type AddCasbinForm

type AddCasbinForm struct {
	RoleId     int          `form:"role_id" binding:"gte=1,lte=20"`
	CasbinRule []CasbinRule `form:"casbin_rule"`
}

type AddRoleForm

type AddRoleForm struct {
	RoleName string
	RoleKey  string
}

type AddUserForm

type AddUserForm struct {
	UserForm
}

type AddVoucherForm

type AddVoucherForm struct {
	VoucherName   string  `form:"voucher_name"`
	VoucherAmount float32 `form:"voucher_amount"`
	VoucherType   int     `form:"voucher_type"`
	VoucherStatus int     `form:"voucher_status"`
	StockCount    int     `form:"stock_count"`
	TotalCount    int     `form:"total_count"`
	StartPeriod   string  `form:"start_period"`
	EndPeriod     string  `form:"end_period"`
}

type CasbinRule

type CasbinRule struct {
	Path   string `json:"path" form:"path"`
	Method string `json:"method" form:"method"`
}

type EditRoleForm

type EditRoleForm struct {
	RoleId   int
	RoleName string
	RoleKey  string
}

type EditUserForm

type EditUserForm struct {
	UserForm
	UserId int `form:"user_id" valid:"Required;Min(1)"`
}

type EditVoucherForm

type EditVoucherForm struct {
	VoucherId     int     `form:"voucher_id" valid:"Required;Min(1)"`
	VoucherName   string  `form:"voucher_name"`
	VoucherAmount float32 `form:"voucher_amount"`
	VoucherType   int     `form:"voucher_type"`
	VoucherStatus int     `form:"voucher_status"`
	StockCount    int     `form:"stock_count"`
	TotalCount    int     `form:"total_count"`
	StartPeriod   string  `form:"start_period"`
	EndPeriod     string  `form:"end_period"`
}

type UserForm

type UserForm struct {
	NickName    string `form:"nick_name"`
	UserName    string `form:"user_name"`
	Password    string `form:"password"`
	PhoneNumber string `form:"phonenumber"`
	Sex         int    `form:"sex"`
	Email       string `form:"email"`
}

UserForm 用户表单

Jump to

Keyboard shortcuts

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