Documentation ¶
Index ¶
- func AddCasbin(roleId int, path, method string) error
- func AddUser(userName, password string) error
- func AddUsr(data map[string]interface{}) error
- func AddVoucher(data map[string]interface{}) error
- func DeleteVoucher(voucherId int) error
- func EditVoucher(voucherId int, data map[string]interface{}) error
- func ExistByEmail(email string) (bool, error)
- func ExistByPhoneNumber(phoneNumber string) (bool, error)
- func ExistByUserId(userId int) (bool, error)
- func ExistByUserName(userName string) (bool, error)
- func ExistCasbin(roleId int, path, method string) (bool, error)
- func ExistVoucherById(voucherId int) (bool, error)
- func GetCasbinList(roleId int) [][]string
- func ParamsMatch(fullNameKey1 string, key2 string) bool
- func ParamsMatchFunc(args ...interface{}) (interface{}, error)
- func Setup()
- func SyncUserVoucher(userId, voucherId int) error
- type BaseModel
- type CasbinModel
- type SysConfig
- type SysDept
- type SysDictData
- type SysDictType
- type SysMenu
- type SysRole
- type SysUser
- type UserVoucher
- type Voucher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EditVoucher ¶
EditVoucher 编辑票券
func ExistByEmail ¶
ExistByEmail checks if there is a user with same email
func ExistByPhoneNumber ¶
ExistByPhoneNumber checks if there is a user with same phonenumber
func ExistByUserId ¶
ExistByUserId checks if there is a user with same user_id
func ExistByUserName ¶
ExistByUserName checks if there is a user with same user_name
func ExistVoucherById ¶
ExistVoucherById checks if an voucher exists based on VoucherId
func GetCasbinList ¶
func ParamsMatch ¶
@function: ParamsMatch @description: 自定义规则函数 @param: fullNameKey1 string, key2 string @return: bool
func ParamsMatchFunc ¶
func ParamsMatchFunc(args ...interface{}) (interface{}, error)
@function: ParamsMatchFunc @description: 自定义规则函数 @param: args ...interface{} @return: interface{}, error
func SyncUserVoucher ¶
Types ¶
type BaseModel ¶
type BaseModel struct { CreatedBy string `json:"created_by" binding:"-"` CreatedAt time.Time `json:"created_at" binding:"-"` UpdatedBy string `json:"updated_by" binding:"-"` UpdatedAt time.Time `json:"updated_at" binding:"-"` DeletedAt *time.Time `json:"deleted_at" sql:"index" binding:"-"` Remark string `json:"remark"` }
type CasbinModel ¶
type CasbinModel struct { PType string `json:"p_type" gorm:"column:p_type" description:"策略类型"` RoleId int `json:"role_id" gorm:"column:v0" description:"角色ID"` Path string `json:"path" gorm:"column:v1" description:"api路径"` Method string `json:"method" gorm:"column:v2" description:"访问方法"` }
func (*CasbinModel) TableName ¶
func (c *CasbinModel) TableName() string
type SysDictData ¶
type SysDictType ¶
type SysUser ¶
type SysUser struct { BaseModel UserId int `gorm:"type:bigint(32);primary_key;auto_increment"` DeptId int `gorm:"type:bigint(32)"` UserName string `gorm:"type:varchar(32)"` NickName string `gorm:"type:varchar(32)"` UserType string `gorm:"type:varchar(2)"` Email string `gorm:"type:varchar(64)"` PhoneNumber string `gorm:"type:varchar(15)"` Sex int `gorm:"type:int(1)"` Avatar string `gorm:"type:varchar(128)"` Password string `gorm:"type:varchar(64)"` Status string `gorm:"type:char(1)"` LoginIP string `gorm:"type:varchar(128)"` LoginDate time.Time `gorm:"type:datetime"` }
type UserVoucher ¶
type Voucher ¶
type Voucher struct { BaseModel VoucherId int `gorm:"primary_key;auto_increment"` // 票券ID MerchantId int `gorm:"type:int(20); not null"` // 票券商家ID VoucherName string `gorm:"type:varchar(64); not null"` // 票券名称 VoucherCode string `gorm:"type:varchar(64); not null"` // 票券编码 VoucherType int `gorm:"type:int(2); not null"` // 票券类型 FullLimit float32 `gorm:"type:decimal(8, 2); not null"` // 满额限制 DiscountAmount float32 `gorm:"type:decimal(8, 2); not null"` // 折扣金额 UseRangeType int `gorm:"type:int(2); not null"` // 使用范围类型 UseRangeId int `gorm:"type:int(2); not null"` // 使用范围ID PublishCount int `gorm:"type:int(8); not null"` // 发行数量 UseCount int `gorm:"type:int(8); not null"` // 使用数量 ReceiveCount int `gorm:"type:int(8); not null"` // 领取数量 StartPeriod time.Time `gorm:"type:datatime; not null"` // 其实有效期 EndPeriod time.Time `gorm:"type:datatime; not null"` // 结束有效期 VoucherStatus int `gorm:"type:int(2); not null"` // 票券状态 AvailablePlatform int `gorm:"type:int(2); not null"` // 可用平台 }
Voucher 票券
func GetVouchersByPage ¶
GetVouchersByPage 根据分页条件获取所有票券
Click to show internal directories.
Click to hide internal directories.