controller

package
v0.0.0-...-9c09179 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ContentType = "Accept"

ContentType ...

View Source
const ContentTypeJSON = "application/json"

ContentTypeJSON ...

View Source
const ContentTypeXML = "application/xml"

ContentTypeXML ...

Variables

This section is empty.

Functions

func ActivityAdd

func ActivityAdd(ver string) gin.HandlerFunc

ActivityAdd godoc @Summary Add activity @Description Add activity @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param account body Activity true "activity update info" @success 200 {object} model.Activity @Failure 400 {object} controller.CodeMessage @Router /admin/activity [post]

func ActivityDelete

func ActivityDelete(ver string) gin.HandlerFunc

ActivityDelete godoc @Summary Delete activity @Description Delete activity @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param id path string true "Activity ID" @success 200 {object} model.Activity @Failure 400 {object} controller.CodeMessage @Router /admin/activity/{id} [delete]

func ActivityList

func ActivityList(ver string) gin.HandlerFunc

ActivityList godoc @Summary List activities @Description List activities @Tags admin @Accept json @Produce json @Param token header string true "login token" @success 200 {array} model.Activity @Failure 400 {object} controller.CodeMessage @Router /admin/activity [get]

func ActivityShow

func ActivityShow(ver string) gin.HandlerFunc

ActivityShow godoc @Summary Show activity @Description Show activity @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param id path string true "Activity ID" @success 200 {object} model.Activity @Failure 400 {object} controller.CodeMessage @Router /admin/activity/{id} [get]

func ActivityUpdate

func ActivityUpdate(ver string) gin.HandlerFunc

ActivityUpdate godoc @Summary Update activity @Description Update activity @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param id path string true "Activity ID" @Param account body Activity true "activity update info" @success 200 {object} model.Activity @Failure 400 {object} controller.CodeMessage @Router /admin/activity/{id} [post]

func ActivityUserList

func ActivityUserList(ver string) gin.HandlerFunc

ActivityUserList godoc @Summary List activity @Description List activity @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param id path string true "Activity ID" @success 200 {array} model.User @Failure 400 {object} controller.CodeMessage @Router /admin/activity/{id}/user [get]

func AuthorizeRequest

func AuthorizeRequest(ver string) gin.HandlerFunc

AuthorizeRequest ...

func Error

func Error(ctx *gin.Context, err error)

Error ...

func FAIL

func FAIL(msg string) util.Map

FAIL ...

func FailDes

func FailDes(msg string) util.Map

FailDes ...

func JSONResponse

func JSONResponse(w http.ResponseWriter, data []byte) error

JSONResponse ...

func NotifyPaymentUnify

func NotifyPaymentUnify(ver string) gin.HandlerFunc

NotifyPaymentUnify godoc @Summary List permission @Description List permission @Tags payment @Accept json @Produce json @Param token header string true "login token" @Param path query string true "sign" @Param payType query string true "payType" @success 200 {array} model.User @Failure 400 {object} controller.CodeMessage @Router /payment/{sign}/{payType} [post]

func NotifyServer

func NotifyServer(ver string) gin.HandlerFunc

NotifyServer ...

func PermissionAdd

func PermissionAdd(ver string) gin.HandlerFunc

PermissionAdd godoc @Summary Add permission @Description Add permission @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param account body Permission true "permission update info" @success 200 {object} model.Permission @Failure 400 {object} controller.CodeMessage @Router /admin/permission [post]

func PermissionDelete

func PermissionDelete(ver string) gin.HandlerFunc

PermissionDelete godoc @Summary Delete permission @Description Delete permission @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param id path string true "Permission ID" @success 200 {object} model.Permission @Failure 400 {object} controller.CodeMessage @Router /admin/permission/{id} [delete]

func PermissionList

func PermissionList(ver string) gin.HandlerFunc

PermissionList godoc @Summary List permissions @Description List permissions @Tags admin @Accept json @Produce json @Param token header string true "login token" @success 200 {array} model.Permission @Failure 400 {object} controller.CodeMessage @Router /admin/permission [get]

func PermissionRoleList

func PermissionRoleList(ver string) gin.HandlerFunc

PermissionRoleList godoc @Summary List role @Description List role @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param id path string true "Permission ID" @success 200 {array} model.Role @Failure 400 {object} controller.CodeMessage @Router /admin/permission/{id}/role [get]

func PermissionShow

func PermissionShow(ver string) gin.HandlerFunc

PermissionShow godoc @Summary Show permission @Description Show permission @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param id path string true "Permission ID" @success 200 {object} model.Permission @Failure 400 {object} controller.CodeMessage @Router /admin/permission/{id} [get]

func PermissionUpdate

func PermissionUpdate(ver string) gin.HandlerFunc

PermissionUpdate godoc @Summary Update permission @Description Update permission @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param id path string true "Permission ID" @Param account body Permission true "permission update info" @success 200 {object} model.Permission @Failure 400 {object} controller.CodeMessage @Router /admin/permission/{id} [post]

func PermissionUserList

func PermissionUserList(ver string) gin.HandlerFunc

PermissionUserList godoc @Summary List permission @Description List permission @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param id path string true "Permission ID" @success 200 {array} model.User @Failure 400 {object} controller.CodeMessage @Router /admin/permission/{id}/user [get]

func PropertyAdd

func PropertyAdd(ver string) gin.HandlerFunc

PropertyAdd godoc @Summary Add property @Description Add property @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param account body Properties true "property update info" @success 200 {object} model.Property @Failure 400 {object} controller.CodeMessage @Router /admin/property [post]

func PropertyDelete

func PropertyDelete(ver string) gin.HandlerFunc

PropertyDelete godoc @Summary Delete property @Description Delete property @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param id path string true "Properties ID" @success 200 {object} model.Property @Failure 400 {object} controller.CodeMessage @Router /admin/property/{id} [delete]

func PropertyList

func PropertyList(ver string) gin.HandlerFunc

PropertyList godoc @Summary List propertys @Description List propertys @Tags admin @Accept json @Produce json @Param token header string true "login token" @success 200 {array} model.Property @Failure 400 {object} controller.CodeMessage @Router /admin/property [get]

func PropertyShow

func PropertyShow(ver string) gin.HandlerFunc

PropertyShow godoc @Summary Show property @Description Show property @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param id path string true "Properties ID" @success 200 {object} model.Property @Failure 400 {object} controller.CodeMessage @Router /admin/property/{id} [get]

func PropertyUpdate

func PropertyUpdate(ver string) gin.HandlerFunc

PropertyUpdate godoc @Summary Update property @Description Update property @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param id path string true "Properties ID" @Param account body Properties true "property update info" @success 200 {object} model.Property @Failure 400 {object} controller.CodeMessage @Router /admin/property/{id} [post]

func RoleAdd

func RoleAdd(ver string) gin.HandlerFunc

RoleAdd godoc @Summary Add role @Description Add role @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param account body Role true "role update info" @success 200 {object} model.Role @Failure 400 {object} controller.CodeMessage @Router /admin/role [post]

func RoleDelete

func RoleDelete(ver string) gin.HandlerFunc

RoleDelete godoc @Summary Delete role @Description Delete role @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param id path string true "Role ID" @success 200 {object} model.Role @Failure 400 {object} controller.CodeMessage @Router /admin/role/{id} [delete]

func RoleList

func RoleList(ver string) gin.HandlerFunc

RoleList godoc @Summary List roles @Description List roles @Tags admin @Accept json @Produce json @Param token header string true "login token" @success 200 {array} model.Role @Failure 400 {object} controller.CodeMessage @Router /admin/role [get]

func RolePermissionAdd

func RolePermissionAdd(ver string) gin.HandlerFunc

RolePermissionAdd godoc @Summary add permission @Description add permission @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param id path string true "Role ID" @Param pid path string true "Permission ID" @success 200 {array} model.PermissionRole @Failure 400 {object} controller.CodeMessage @Router /admin/role/{id}/permission/{pid} [get]

func RolePermissionList

func RolePermissionList(ver string) gin.HandlerFunc

RolePermissionList godoc @Summary List permission @Description List permission @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param id path string true "Role ID" @success 200 {array} model.Permission @Failure 400 {object} controller.CodeMessage @Router /admin/role/{id}/permission [get]

func RoleShow

func RoleShow(ver string) gin.HandlerFunc

RoleShow godoc @Summary Show role @Description Show role @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param id path string true "Role ID" @success 200 {object} model.Role @Failure 400 {object} controller.CodeMessage @Router /admin/role/{id} [get]

func RoleUpdate

func RoleUpdate(ver string) gin.HandlerFunc

RoleUpdate godoc @Summary Update role @Description Update role @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param id path string true "Role ID" @Param account body Role true "role update info" @success 200 {object} model.Role @Failure 400 {object} controller.CodeMessage @Router /admin/role/{id} [post]

func RoleUserList

func RoleUserList(ver string) gin.HandlerFunc

RoleUserList godoc @Summary List permission @Description List permission @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param id path string true "Role ID" @success 200 {array} model.User @Failure 400 {object} controller.CodeMessage @Router /admin/role/{id}/user [get]

func SUCCESS

func SUCCESS() util.Map

SUCCESS ...

func Success

func Success(ctx *gin.Context, detail interface{})

Success ...

func User

func User(ctx *gin.Context) *model.User

User ...

func UserAdd

func UserAdd(ver string) gin.HandlerFunc

UserAdd godoc @Summary Add user @Description Add user @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param account body User true "user update info" @success 200 {object} model.User @Failure 400 {object} controller.CodeMessage @Router /admin/user [post]

func UserDelete

func UserDelete(ver string) gin.HandlerFunc

UserDelete godoc @Summary Delete user @Description Delete user @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param id path string true "User ID" @success 200 {object} model.User @Failure 400 {object} controller.CodeMessage @Router /admin/user/{id} [delete]

func UserList

func UserList(ver string) gin.HandlerFunc

UserList godoc @Summary List users @Description List users @Tags admin @Accept json @Produce json @Param token header string true "login token" @success 200 {array} model.Paginate @Failure 400 {object} controller.CodeMessage @Router /admin/user [get]

func UserLogin

func UserLogin(ver string) gin.HandlerFunc

UserLogin godoc @Summary Login user @Description Login user @Tags default @Accept json @Produce json @Param account body Login true "user update info" @success 200 {object} util.WebToken @Failure 400 {object} controller.CodeMessage @Router /login [post]

func UserMenuAdd

func UserMenuAdd(ver string) gin.HandlerFunc

UserMenuAdd godoc @Summary Add user menu @Description Add user menu @Tags menu @Accept json @Produce json @Param token header string true "login token" @Param account body Properties true "menu update info" @success 200 {object} model.Menu @Failure 400 {object} controller.CodeMessage @Router /user/menu [post]

func UserMenuDelete

func UserMenuDelete(ver string) gin.HandlerFunc

UserMenuDelete godoc @Summary Delete user menu @Description Delete user menu @Tags menu @Accept json @Produce json @Param token header string true "login token" @Param id path string true "Properties ID" @success 200 {object} model.Menu @Failure 400 {object} controller.CodeMessage @Router /user/menu/{id} [delete]

func UserMenuList

func UserMenuList(ver string) gin.HandlerFunc

UserMenuList godoc @Summary List user properties @Description List user properties @Tags menu @Accept json @Produce json @Param current query string false "paginate:current" @Param limit query string false "paginate:limit" @Param order query string false "paginate:order" @success 200 {array} model.Menu @Failure 400 {object} controller.CodeMessage @Router /user/menu [get]

func UserMenuShow

func UserMenuShow(ver string) gin.HandlerFunc

UserMenuShow godoc @Summary Show user menu @Description Show user menu @Tags menu @Accept json @Produce json @Param token header string true "login token" @Param id path string true "Properties ID" @success 200 {object} model.Menu @Failure 400 {object} controller.CodeMessage @Router /user/menu/{id} [get]

func UserMenuUpdate

func UserMenuUpdate(ver string) gin.HandlerFunc

UserMenuUpdate godoc @Summary Update user menu @Description Update user menu @Tags menu @Accept json @Produce json @Param token header string true "login token" @Param id path string true "Properties ID" @Param account body Properties true "menu update info" @success 200 {object} model.Menu @Failure 400 {object} controller.CodeMessage @Router /user/menu/{id} [post]

func UserPermissionList

func UserPermissionList(ver string) gin.HandlerFunc

UserPermissionList godoc @Summary List permission @Description List permission @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param id path string true "User ID" @success 200 {array} model.Permission @Failure 400 {object} controller.CodeMessage @Router /admin/user/{id}/permission [get]

func UserPropertyAdd

func UserPropertyAdd(ver string) gin.HandlerFunc

UserPropertyAdd godoc @Summary Add user property @Description Add user property @Tags property @Accept json @Produce json @Param token header string true "login token" @Param account body Properties true "property update info" @success 200 {object} model.Property @Failure 400 {object} controller.CodeMessage @Router /user/property [post]

func UserPropertyDelete

func UserPropertyDelete(ver string) gin.HandlerFunc

UserPropertyDelete godoc @Summary Delete user property @Description Delete user property @Tags property @Accept json @Produce json @Param token header string true "login token" @Param id path string true "Properties ID" @success 200 {object} model.Property @Failure 400 {object} controller.CodeMessage @Router /user/property/{id} [delete]

func UserPropertyList

func UserPropertyList(ver string) gin.HandlerFunc

UserPropertyList godoc @Summary List user properties @Description List user properties @Tags property @Accept json @Produce json @Param token header string true "login token" @success 200 {array} model.Property @Failure 400 {object} controller.CodeMessage @Router /user/property [get]

func UserPropertyShow

func UserPropertyShow(ver string) gin.HandlerFunc

UserPropertyShow godoc @Summary Show user property @Description Show user property @Tags property @Accept json @Produce json @Param token header string true "login token" @Param id path string true "Properties ID" @success 200 {object} model.Property @Failure 400 {object} controller.CodeMessage @Router /user/property/{id} [get]

func UserPropertyUpdate

func UserPropertyUpdate(ver string) gin.HandlerFunc

UserPropertyUpdate godoc @Summary Update user property @Description Update user property @Tags property @Accept json @Produce json @Param token header string true "login token" @Param id path string true "Properties ID" @Param account body Properties true "property update info" @success 200 {object} model.Property @Failure 400 {object} controller.CodeMessage @Router /user/property/{id} [post]

func UserRegister

func UserRegister(ver string) gin.HandlerFunc

UserRegister godoc @Summary register user @Description register user @Tags default @Accept json @Produce json @Param account body User true "user update info" @success 200 {object} util.WebToken @Failure 400 {object} controller.CodeMessage @Router /register [post]

func UserReset

func UserReset(ver string) gin.HandlerFunc

UserReset godoc @Summary reset user password @Description reset user password @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param id path string true "User ID" @Param account body User true "user update info" @success 200 {object} model.User @Failure 400 {object} controller.CodeMessage @Router /admin/user/{id}/reset [post]

func UserRoleAdd

func UserRoleAdd(ver string) gin.HandlerFunc

UserRoleAdd godoc @Summary List role @Description List role @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param id path string true "User ID" @success 200 {array} model.RoleUser @Failure 400 {object} controller.CodeMessage @Router /admin/user/{id}/role/{rid} [post]

func UserRoleList

func UserRoleList(ver string) gin.HandlerFunc

UserRoleList godoc @Summary List role @Description List role @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param id path string true "User ID" @success 200 {array} model.Role @Failure 400 {object} controller.CodeMessage @Router /admin/user/{id}/role [get]

func UserShow

func UserShow(ver string) gin.HandlerFunc

UserShow godoc @Summary Show user @Description Show user @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param id path string true "User ID" @success 200 {object} model.User @Failure 400 {object} controller.CodeMessage @Router /admin/user/{id} [get]

func UserUpdate

func UserUpdate(ver string) gin.HandlerFunc

UserUpdate godoc @Summary Update user @Description Update user @Tags admin @Accept json @Produce json @Param token header string true "login token" @Param id path string true "User ID" @Param account body User true "user update info" @success 200 {object} model.User @Failure 400 {object} controller.CodeMessage @Router /admin/user/{id} [post]

func XMLResponse

func XMLResponse(w http.ResponseWriter, data []byte) error

XMLResponse ...

Types

type CodeMessage

type CodeMessage struct {
	Code    int    `json:"code" example:"-1"`
	Message string `json:"message" example:"status bad request"`
}

CodeMessage ...

type Notifier

type Notifier interface {
	ServeHTTP(ctx *gin.Context)
}

Notifier ...

type Notify

type Notify struct {
	RefundKey string
	// contains filtered or unexported fields
}

Notify ...

func NewNotify

func NewNotify(payment *wego.Payment) *Notify

NewNotify ...

func (*Notify) HandlePaidNotify

func (n *Notify) HandlePaidNotify(f ServeNotify) Notifier

HandlePaidNotify ...

func (*Notify) HandleRefunded

func (n *Notify) HandleRefunded(f ServeNotify) Notifier

HandleRefunded ...

func (*Notify) HandleRefundedNotify

func (n *Notify) HandleRefundedNotify(f ServeNotify) ServeHTTPFunc

HandleRefundedNotify ...

func (*Notify) HandleScanned

func (n *Notify) HandleScanned(f ServeNotify) ServeHTTPFunc

HandleScanned ...

func (*Notify) HandleScannedNotify

func (n *Notify) HandleScannedNotify(f ServeNotify) Notifier

HandleScannedNotify ...

type ServeHTTPFunc

type ServeHTTPFunc func(ctx *gin.Context)

ServeHTTPFunc ...

type ServeNotify

type ServeNotify func(p util.Map) (util.Map, error)

ServeNotify ...

Jump to

Keyboard shortcuts

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