webdto

package
v1.0.1-dev-02 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MulanPSL-2.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InjectApiUserResult

func InjectApiUserResult(s *ApiUserResult)

func InjectSysMenu

func InjectSysMenu(s *SysMenu)

func InjectSysMenuEntity

func InjectSysMenuEntity(s *SysMenuEntity)

func InjectSysUser

func InjectSysUser(s *SysUser)

func InjectSysUserEntity

func InjectSysUserEntity(s *SysUserEntity)

func InjectWebCheckRequest

func InjectWebCheckRequest(s *WebCheckRequest)

func InjectWebCheckRes

func InjectWebCheckRes(s *WebCheckRes)

func InjectWebCheckResult

func InjectWebCheckResult(s *WebCheckResult)

func InjectWebUserId

func InjectWebUserId(s *WebUserId)

func LoadApiUserResult

func LoadApiUserResult() baseiface.ISingleton

func LoadSysMenu

func LoadSysMenu() baseiface.ISingleton

func LoadSysMenuEntity

func LoadSysMenuEntity() baseiface.ISingleton

func LoadSysUser

func LoadSysUser() baseiface.ISingleton

func LoadSysUserEntity

func LoadSysUserEntity() baseiface.ISingleton

func LoadWebCheckRequest

func LoadWebCheckRequest() baseiface.ISingleton

func LoadWebCheckRes

func LoadWebCheckRes() baseiface.ISingleton

func LoadWebCheckResult

func LoadWebCheckResult() baseiface.ISingleton

func LoadWebUserId

func LoadWebUserId() baseiface.ISingleton

func SetUserId

func SetUserId(c *gin.Context, userId *WebUserId)

SetUserId 设定用户ID

Types

type ApiUserResult

type ApiUserResult struct {
	basedto.BaseEntity
	*SysUser

	IsAdmin   bool     `json:"is_admin"`
	MenuPerms []string `json:"menu_perms"`
}

token session save info

func FindBeanApiUserResult

func FindBeanApiUserResult() *ApiUserResult

func NewApiUserResult

func NewApiUserResult() *ApiUserResult

func (*ApiUserResult) AppendMenuPerm

func (self *ApiUserResult) AppendMenuPerm(menu string)

type SysMenu

type SysMenu struct {
	basedto.BaseEntity `gorm:"-"`

	/*  菜单ID  */
	MenuId int64 `gorm:"column:menu_id;type:bigint(20);PRIMARY_KEY;comment:'菜单ID'" json:"menu_id,string"`
	/*  菜单名称  */
	MenuName string `gorm:"column:menu_name;type:varchar(50);comment:'菜单名称'" json:"menu_name"`
	/*    */
	Subsys int32 `gorm:"column:subsys;type:int(11);comment:'';default:0" json:"subsys"`
	/*  父菜单ID  */
	ParentId int64 `gorm:"column:parent_id;type:bigint(20);comment:'父菜单ID';default:0" json:"parent_id,string"`
	/*  显示顺序  */
	OrderNum int32 `gorm:"column:order_num;type:int(4);comment:'显示顺序';default:0" json:"order_num"`
	/*  路由地址  */
	Path string `gorm:"column:path;type:varchar(200);comment:'路由地址'" json:"path"`
	/*  组件路径  */
	Component string `gorm:"column:component;type:varchar(255);comment:'组件路径'" json:"component"`
	/*  路由参数  */
	Query string `gorm:"column:query;type:varchar(255);comment:'路由参数'" json:"query"`
	/*  是否为外链(0是 1否)  */
	IsFrame int32 `gorm:"column:is_frame;type:int(1);comment:'是否为外链(0是 1否)';default:1" json:"is_frame"`
	/*  是否缓存(0缓存 1不缓存)  */
	IsCache int32 `gorm:"column:is_cache;type:int(1);comment:'是否缓存(0缓存 1不缓存)';default:0" json:"is_cache"`
	/*  菜单类型(M目录 C菜单 F按钮)  */
	MenuType string `gorm:"column:menu_type;type:char(1);comment:'菜单类型(M目录 C菜单 F按钮)'" json:"menu_type"`
	/*  菜单状态(0显示 1隐藏)  */
	Visible string `gorm:"column:visible;type:char(1);comment:'菜单状态(0显示 1隐藏)';default:'0'" json:"visible"`
	/*  菜单状态(0正常 1停用)  */
	Status string `gorm:"column:status;type:char(1);comment:'菜单状态(0正常 1停用)';default:'0'" json:"status"`
	/*  权限标识  */
	Perms string `gorm:"column:perms;type:varchar(100);comment:'权限标识'" json:"perms"`
	/*  菜单图标  */
	Icon string `gorm:"column:icon;type:varchar(100);comment:'菜单图标';default:'#'" json:"icon"`
	/*  创建者  */
	CreateBy string `gorm:"column:create_by;type:varchar(64);comment:'创建者'" json:"create_by"`
	/*  创建时间  */
	CreateTime time.Time `gorm:"column:create_time;type:datetime;comment:'创建时间'" json:"create_time"`
	/*  更新者  */
	UpdateBy string `gorm:"column:update_by;type:varchar(64);comment:'更新者'" json:"update_by"`
	/*  更新时间  */
	UpdateTime time.Time `gorm:"column:update_time;type:datetime;comment:'更新时间'" json:"update_time"`
	/*  备注  */
	Remark string `gorm:"column:remark;type:varchar(500);comment:'备注'" json:"remark"`
}

菜单权限表

func FindBeanSysMenu

func FindBeanSysMenu() *SysMenu

func NewSysMenu

func NewSysMenu() *SysMenu

func (*SysMenu) AutoMigrate

func (entity *SysMenu) AutoMigrate(db *gorm.DB) error

迁移

func (*SysMenu) PkeyName

func (entity *SysMenu) PkeyName() string

func (*SysMenu) PkeyValue

func (entity *SysMenu) PkeyValue() int64

func (*SysMenu) SetComponent

func (entity *SysMenu) SetComponent(Component string)

func (*SysMenu) SetCreateBy

func (entity *SysMenu) SetCreateBy(CreateBy string)

func (*SysMenu) SetCreateTime

func (entity *SysMenu) SetCreateTime(CreateTime time.Time)

func (*SysMenu) SetIcon

func (entity *SysMenu) SetIcon(Icon string)

func (*SysMenu) SetIsCache

func (entity *SysMenu) SetIsCache(IsCache int32)

func (*SysMenu) SetIsFrame

func (entity *SysMenu) SetIsFrame(IsFrame int32)

func (*SysMenu) SetMenuId

func (entity *SysMenu) SetMenuId(MenuId int64)

func (*SysMenu) SetMenuName

func (entity *SysMenu) SetMenuName(MenuName string)

func (*SysMenu) SetMenuType

func (entity *SysMenu) SetMenuType(MenuType string)

func (*SysMenu) SetOrderNum

func (entity *SysMenu) SetOrderNum(OrderNum int32)

func (*SysMenu) SetParentId

func (entity *SysMenu) SetParentId(ParentId int64)

func (*SysMenu) SetPath

func (entity *SysMenu) SetPath(Path string)

func (*SysMenu) SetPerms

func (entity *SysMenu) SetPerms(Perms string)

func (*SysMenu) SetQuery

func (entity *SysMenu) SetQuery(Query string)

func (*SysMenu) SetRemark

func (entity *SysMenu) SetRemark(Remark string)

func (*SysMenu) SetStatus

func (entity *SysMenu) SetStatus(Status string)

func (*SysMenu) SetSubsys

func (entity *SysMenu) SetSubsys(Subsys int32)

func (*SysMenu) SetUpdateBy

func (entity *SysMenu) SetUpdateBy(UpdateBy string)

func (*SysMenu) SetUpdateTime

func (entity *SysMenu) SetUpdateTime(UpdateTime time.Time)

func (*SysMenu) SetVisible

func (entity *SysMenu) SetVisible(Visible string)

func (*SysMenu) TableName

func (entity *SysMenu) TableName() string

gorm默认生成的表名是结构名+'s',所以必须以结构方法指定!

type SysMenuEntity

type SysMenuEntity struct {
	basedto.BaseEntity `gorm:"-"`

	/*  菜单ID  */
	MenuId int64 `gorm:"column:menu_id;type:bigint(20);PRIMARY_KEY;comment:'菜单ID'" json:"menu_id,string"`
	/*  菜单名称  */
	MenuName string `gorm:"column:menu_name;type:varchar(50);comment:'菜单名称'" json:"menu_name"`
	/*    */
	Subsys int32 `gorm:"column:subsys;type:int(11);comment:'';default:0" json:"subsys"`
	/*  父菜单ID  */
	ParentId int64 `gorm:"column:parent_id;type:bigint(20);comment:'父菜单ID';default:0" json:"parent_id,string"`
	/*  显示顺序  */
	OrderNum int32 `gorm:"column:order_num;type:int(4);comment:'显示顺序';default:0" json:"order_num"`
	/*  路由地址  */
	Path string `gorm:"column:path;type:varchar(200);comment:'路由地址'" json:"path"`
	/*  组件路径  */
	Component string `gorm:"column:component;type:varchar(255);comment:'组件路径'" json:"component"`
	/*  路由参数  */
	Query string `gorm:"column:query;type:varchar(255);comment:'路由参数'" json:"query"`
	/*  是否为外链(0是 1否)  */
	IsFrame int32 `gorm:"column:is_frame;type:int(1);comment:'是否为外链(0是 1否)';default:1" json:"is_frame"`
	/*  是否缓存(0缓存 1不缓存)  */
	IsCache int32 `gorm:"column:is_cache;type:int(1);comment:'是否缓存(0缓存 1不缓存)';default:0" json:"is_cache"`
	/*  菜单类型(M目录 C菜单 F按钮)  */
	MenuType string `gorm:"column:menu_type;type:char(1);comment:'菜单类型(M目录 C菜单 F按钮)'" json:"menu_type"`
	/*  菜单状态(0显示 1隐藏)  */
	Visible string `gorm:"column:visible;type:char(1);comment:'菜单状态(0显示 1隐藏)';default:\'0\'" json:"visible"`
	/*  菜单状态(0正常 1停用)  */
	Status string `gorm:"column:status;type:char(1);comment:'菜单状态(0正常 1停用)';default:\'0\'" json:"status"`
	/*  权限标识  */
	Perms string `gorm:"column:perms;type:varchar(100);comment:'权限标识'" json:"perms"`
	/*  菜单图标  */
	Icon string `gorm:"column:icon;type:varchar(100);comment:'菜单图标';default:\'#\'" json:"icon"`
	/*  创建者  */
	CreateBy string `gorm:"column:create_by;type:varchar(64);comment:'创建者'" json:"create_by"`
	/*  创建时间  */
	CreateTime int64 `gorm:"column:create_time;type:datetime;comment:'创建时间'" json:"create_time,string"`
	/*  更新者  */
	UpdateBy string `gorm:"column:update_by;type:varchar(64);comment:'更新者'" json:"update_by"`
	/*  更新时间  */
	UpdateTime int64 `gorm:"column:update_time;type:datetime;comment:'更新时间'" json:"update_time,string"`
	/*  备注  */
	Remark string `gorm:"column:remark;type:varchar(500);comment:'备注'" json:"remark"`
}

func FindBeanSysMenuEntity

func FindBeanSysMenuEntity() *SysMenuEntity

func NewSysMenuEntity

func NewSysMenuEntity() *SysMenuEntity

func (*SysMenuEntity) AutoMigrate

func (entity *SysMenuEntity) AutoMigrate(db *gorm.DB) error

迁移

func (*SysMenuEntity) PkeyName

func (entity *SysMenuEntity) PkeyName() string

func (*SysMenuEntity) PkeyValue

func (entity *SysMenuEntity) PkeyValue() int64

func (*SysMenuEntity) TableName

func (entity *SysMenuEntity) TableName() string

gorm默认生成的表名是结构名+'s',所以必须以结构方法指定!

type SysUser

type SysUser struct {
	basedto.BaseEntity `gorm:"-"`

	/*  主键  */
	Id int32 `gorm:"column:id;type:int(11);PRIMARY_KEY;comment:'主键'" json:"id"`
	/*  工号  */
	Username string `gorm:"column:username;type:varchar(32);comment:'工号'" json:"username"`
	/*  密码  */
	Passwd string `gorm:"column:passwd;type:varchar(64);comment:'密码'" json:"passwd"`
	/*    */
	Realname string `gorm:"column:realname;type:varchar(128);comment:''" json:"realname"`
	/*  企业ID  */
	CorpId int32 `gorm:"column:corp_id;type:int(11);comment:'企业ID'" json:"corp_id"`
	/*  组织结构ID  */
	OrgId int32 `gorm:"column:org_id;type:int(11);comment:'组织结构ID'" json:"org_id"`
	/*    */
	MobileNo string `gorm:"column:mobile_no;type:varchar(32);comment:''" json:"mobile_no"`
	/*  公司邮箱  */
	Email string `gorm:"column:email;type:varchar(255);comment:'公司邮箱'" json:"email"`
	/*  状态(1:启用;0:停用)  */
	Status bool `gorm:"column:status;type:tinyint(1);comment:'状态(1:启用;0:停用)'" json:"status"`
	/*  备注  */
	Remark string `gorm:"column:remark;type:varchar(500);comment:'备注'" json:"remark"`
	/*  创建人  */
	CreateBy int32 `gorm:"column:create_by;type:int(11);comment:'创建人';default:0" json:"create_by"`
	/*  创建时间  */
	CreateOn time.Time `gorm:"column:create_on;type:datetime;comment:'创建时间'" json:"create_on"`
	/*  操作人  */
	OpBy int32 `gorm:"column:op_by;type:int(11);comment:'操作人';default:0" json:"op_by"`
	/*  操作时间  */
	OpOn time.Time `gorm:"column:op_on;type:datetime;comment:'操作时间'" json:"op_on"`
	/*  扩展属性  */
	ExtParams string `gorm:"column:ext_params;type:varchar(1000);comment:'扩展属性'" json:"ext_params"`
	/*  员工标识  */
	EmployeeId int32 `gorm:"column:employee_id;type:int(11);comment:'员工标识';default:0" json:"employee_id"`
}

系统用户表

func FindBeanSysUser

func FindBeanSysUser() *SysUser

func NewSysUser

func NewSysUser() *SysUser

func (*SysUser) AutoMigrate

func (entity *SysUser) AutoMigrate(db *gorm.DB) error

迁移

func (*SysUser) PkeyName

func (entity *SysUser) PkeyName() string

func (*SysUser) PkeyValue

func (entity *SysUser) PkeyValue() int32

func (*SysUser) SetCorpId

func (entity *SysUser) SetCorpId(CorpId int32)

func (*SysUser) SetCreateBy

func (entity *SysUser) SetCreateBy(CreateBy int32)

func (*SysUser) SetCreateOn

func (entity *SysUser) SetCreateOn(CreateOn time.Time)

func (*SysUser) SetEmail

func (entity *SysUser) SetEmail(Email string)

func (*SysUser) SetEmployeeId

func (entity *SysUser) SetEmployeeId(EmployeeId int32)

func (*SysUser) SetExtParams

func (entity *SysUser) SetExtParams(ExtParams string)

func (*SysUser) SetId

func (entity *SysUser) SetId(Id int32)

func (*SysUser) SetMobileNo

func (entity *SysUser) SetMobileNo(MobileNo string)

func (*SysUser) SetOpBy

func (entity *SysUser) SetOpBy(OpBy int32)

func (*SysUser) SetOpOn

func (entity *SysUser) SetOpOn(OpOn time.Time)

func (*SysUser) SetOrgId

func (entity *SysUser) SetOrgId(OrgId int32)

func (*SysUser) SetPasswd

func (entity *SysUser) SetPasswd(Passwd string)

func (*SysUser) SetRealname

func (entity *SysUser) SetRealname(Realname string)

func (*SysUser) SetRemark

func (entity *SysUser) SetRemark(Remark string)

func (*SysUser) SetStatus

func (entity *SysUser) SetStatus(Status bool)

func (*SysUser) SetUsername

func (entity *SysUser) SetUsername(Username string)

func (*SysUser) TableName

func (entity *SysUser) TableName() string

gorm默认生成的表名是结构名+'s',所以必须以结构方法指定!

type SysUserEntity

type SysUserEntity struct {
	basedto.BaseEntity `gorm:"-"`

	/*  主键  */
	Id int32 `gorm:"column:id;type:int(11);PRIMARY_KEY;comment:'主键'" json:"id"`
	/*  工号  */
	Username string `gorm:"column:username;type:varchar(32);comment:'工号'" json:"username"`
	/*  密码  */
	Passwd string `gorm:"column:passwd;type:varchar(64);comment:'密码'" json:"passwd"`
	/*    */
	Realname string `gorm:"column:realname;type:varchar(128);comment:''" json:"realname"`
	/*  企业ID  */
	CorpId int32 `gorm:"column:corp_id;type:int(11);comment:'企业ID'" json:"corp_id"`
	/*  组织结构ID  */
	OrgId int32 `gorm:"column:org_id;type:int(11);comment:'组织结构ID'" json:"org_id"`
	/*    */
	MobileNo string `gorm:"column:mobile_no;type:varchar(32);comment:''" json:"mobile_no"`
	/*  公司邮箱  */
	Email string `gorm:"column:email;type:varchar(255);comment:'公司邮箱'" json:"email"`
	/*  状态(1:启用;0:停用)  */
	Status int8 `gorm:"column:status;type:tinyint(1);comment:'状态(1:启用;0:停用)'" json:"status"`
	/*  备注  */
	Remark string `gorm:"column:remark;type:varchar(500);comment:'备注'" json:"remark"`
	/*  创建人  */
	CreateBy int32 `gorm:"column:create_by;type:int(11);comment:'创建人';default:0" json:"create_by"`
	/*  创建时间  */
	CreateOn int64 `gorm:"column:create_on;type:datetime;comment:'创建时间'" json:"create_on,string"`
	/*  操作人  */
	OpBy int32 `gorm:"column:op_by;type:int(11);comment:'操作人';default:0" json:"op_by"`
	/*  操作时间  */
	OpOn int64 `gorm:"column:op_on;type:datetime;comment:'操作时间'" json:"op_on,string"`
	/*  扩展属性  */
	ExtParams string `gorm:"column:ext_params;type:varchar(1000);comment:'扩展属性'" json:"ext_params"`
	/*  员工标识  */
	EmployeeId int32 `gorm:"column:employee_id;type:int(11);comment:'员工标识';default:0" json:"employee_id"`
}

func FindBeanSysUserEntity

func FindBeanSysUserEntity() *SysUserEntity

func NewSysUserEntity

func NewSysUserEntity() *SysUserEntity

func (*SysUserEntity) AutoMigrate

func (entity *SysUserEntity) AutoMigrate(db *gorm.DB) error

迁移

func (*SysUserEntity) PkeyName

func (entity *SysUserEntity) PkeyName() string

func (*SysUserEntity) PkeyValue

func (entity *SysUserEntity) PkeyValue() int32

func (*SysUserEntity) TableName

func (entity *SysUserEntity) TableName() string

gorm默认生成的表名是结构名+'s',所以必须以结构方法指定!

type WebCheckRequest

type WebCheckRequest struct {
	basedto.BaseEntity

	TenantId     string
	ShopId       int64
	ShopMemberId int64
	JobId        int64

	*WebCheckRes
	MaxDepth string
}

func DefaultRequest

func DefaultRequest() *WebCheckRequest

func FindBeanWebCheckRequest

func FindBeanWebCheckRequest() *WebCheckRequest

FindBeanWebCheckRequest

func NewWebCheckRequest

func NewWebCheckRequest() *WebCheckRequest

func (*WebCheckRequest) ValueFrom

func (self *WebCheckRequest) ValueFrom(userID *WebUserId)

type WebCheckRes

type WebCheckRes struct {
	basedto.BaseEntity
	RoutePath string

	ResourceType   string
	ResourceDomain string
	ResourceCode   string
	ResourceKey    string
	ActionKey      string
}

func DefaultResof

func DefaultResof(res string) *WebCheckRes

func FindBeanWebCheckRes

func FindBeanWebCheckRes() *WebCheckRes

FindBeanWebCheckRes

func NewWebCheckRes

func NewWebCheckRes() *WebCheckRes

type WebCheckResult

type WebCheckResult struct {
	basedto.BaseEntity
	*ApiUserResult

	Allowed      bool
	Depth        string
	ShopIds      []int64
	ShopMemberId []int64
}

func DefaultDisabledResult

func DefaultDisabledResult() *WebCheckResult

func DefaultPassedResult

func DefaultPassedResult() *WebCheckResult

func DefaultResult

func DefaultResult() *WebCheckResult

func FindBeanWebCheckResult

func FindBeanWebCheckResult() *WebCheckResult

FindBeanWebCheckResult

func GetAllowedResult

func GetAllowedResult(c *gin.Context) *WebCheckResult

func NewWebCheckResult

func NewWebCheckResult() *WebCheckResult

func (*WebCheckResult) SetAllowedResult

func (self *WebCheckResult) SetAllowedResult(c *gin.Context)

SetAllowedResult 设定校验权限结果

type WebUserId

type WebUserId struct {
	basedto.BaseEntity
	*ApiUserResult

	Id             int64
	ShopId         int64
	ShopMemberId   int64
	ShopName       string
	ShopMemberName string
	TenantId       string
	JobId          int64

	AccountId           int64
	RootShopId          int64
	Name                string
	EmployeeAccountId   int64
	ShopMemberShortName string
	ShopShortName       string
	Station             string
	StationShopId       int64
	CurrencyId          int64
	TaxId               int64
}

func DefaultWebUserId

func DefaultWebUserId() *WebUserId

func FindBeanWebUserId

func FindBeanWebUserId() *WebUserId

FindBeanWebUserId

func GetUserId

func GetUserId(c *gin.Context) *WebUserId

func NewWebUserId

func NewWebUserId() *WebUserId

Jump to

Keyboard shortcuts

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