service_swa

package
v0.0.0-...-cbb317a Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	B  = 1
	KB = 1024 * B
	MB = 1024 * KB
	GB = 1024 * MB
)

Variables

View Source
var ErrRoleExistence = errors.New("存在相同角色id")
View Source
var StateDict = map[string]string{
	"os":   "操作系统",
	"cpu":  "处理器",
	"ram":  "内存",
	"disk": "硬盘",

	"goos":         "适配系统",
	"numCpu":       "cpu个数",
	"compiler":     "编译器",
	"goVersion":    "go版本",
	"numGoroutine": "协程数量",
	"cores":        "内核数",
	"usedMb":       "已用(GB)",
	"totalMb":      "共计(GB)",
	"usedPercent":  "使用率",
	"usedGb":       "已用(GB)",
	"totalGb":      "容量(GB)",
}

Functions

This section is empty.

Types

type AddMenuRoleInfo

type AddMenuRoleInfo struct {
	Menus  []SysBaseMenu `json:"menus"`
	RoleId uint          `json:"roleId"`
}

type CasbinInReceive

type CasbinInReceive struct {
	RoleId      uint         `json:"roleId"`
	CasbinInfos []CasbinInfo `json:"casbinInfos"`
}

type CasbinInfo

type CasbinInfo struct {
	weaver.AutoMarshal
	Path   string `json:"path"`
	Method string `json:"method"`
}

func DefaultCasbin

func DefaultCasbin() []CasbinInfo

func (*CasbinInfo) WeaverMarshal

func (x *CasbinInfo) WeaverMarshal(enc *codegen.Encoder)

func (*CasbinInfo) WeaverUnmarshal

func (x *CasbinInfo) WeaverUnmarshal(dec *codegen.Decoder)

type CasbinService

type CasbinService struct{}

type ChangePasswordReq

type ChangePasswordReq struct {
	ID          uint   `json:"-"`
	Password    string `json:"password"`
	NewPassword string `json:"newPassword"`
}

type ChangeUserInfo

type ChangeUserInfo struct {
	ID          uint      `gorm:"primarykey"`
	NickName    string    `json:"nickName" gorm:"default:系统用户;comment:用户昵称"`
	Phone       string    `json:"phone"  gorm:"comment:用户手机号"`
	RoleIds     []uint    `json:"roleIds" gorm:"-"`
	Email       string    `json:"email"  gorm:"comment:用户邮箱"`
	HeaderImg   string    `json:"headerImg" gorm:"comment:用户头像"`
	SideMode    string    `json:"sideMode"  gorm:"comment:用户侧边主题"`
	Enable      int       `json:"enable" gorm:"comment:冻结用户"`
	Authorities []SwaRole `json:"-" gorm:"many2many:swa_user_role;"`
}

type Cpu

type Cpu struct {
	weaver.AutoMarshal
	Cpus  []float64 `json:"cpus"`
	Cores int       `json:"cores"`
}

func InitCPU

func InitCPU() (c Cpu, err error)

func (*Cpu) WeaverMarshal

func (x *Cpu) WeaverMarshal(enc *codegen.Encoder)

func (*Cpu) WeaverUnmarshal

func (x *Cpu) WeaverUnmarshal(dec *codegen.Decoder)

type Disk

type Disk struct {
	weaver.AutoMarshal
	UsedGB      int `json:"usedGb"`
	TotalGB     int `json:"totalGb"`
	UsedPercent int `json:"usedPercent"`
}

func InitDisk

func InitDisk() (d Disk, err error)

func (*Disk) WeaverMarshal

func (x *Disk) WeaverMarshal(enc *codegen.Encoder)

func (*Disk) WeaverUnmarshal

func (x *Disk) WeaverUnmarshal(dec *codegen.Decoder)

type Empty

type Empty struct{}

type GetById

type GetById struct {
	ID int `json:"id" form:"id"` // --主键ID
}

func (*GetById) Uint

func (r *GetById) Uint() uint

type GetRoleId

type GetRoleId struct {
	RoleId uint `json:"roleId" form:"roleId"` // --角色ID
}

type IdsReq

type IdsReq struct {
	Ids []uint `json:"ids" form:"ids"`
}

type Login

type Login struct {
	Username  string `json:"username"`
	Password  string `json:"password"`
	Captcha   string `json:"captcha"`
	CaptchaId string `json:"captchaId"`
}

type LoginResponse

type LoginResponse struct {
	User      SysUser `json:"user"`
	Token     string  `json:"token"`
	ExpiresAt int64   `json:"expiresAt"`
}
type MenuRole struct {
	Menu       SysBaseMenu
	Roles      []SwaRole              `json:"roles" gorm:"-"`
	Parameters []SysBaseMenuParameter `json:"parameters" gorm:"-"`
	MenuBtn    []SysBaseMenuBtn       `json:"menuBtn" gorm:"-"`
}

type Meta

type Meta struct {
	weaver.AutoMarshal
	ActiveName  string `json:"activeName" gorm:"comment:高亮菜单"`
	KeepAlive   bool   `json:"keepAlive" gorm:"comment:是否缓存"`
	DefaultMenu bool   `json:"defaultMenu" gorm:"comment:是否是基础路由(开发中)"`
	Title       string `json:"title" gorm:"comment:菜单名"`
	Icon        string `json:"icon" gorm:"comment:菜单图标"`
	CloseTab    bool   `json:"closeTab" gorm:"comment:自动关闭tab"`
}

func (*Meta) WeaverMarshal

func (x *Meta) WeaverMarshal(enc *codegen.Encoder)

func (*Meta) WeaverUnmarshal

func (x *Meta) WeaverUnmarshal(dec *codegen.Decoder)

type ModApi

type ModApi struct {
	weaver.AutoMarshal
	ModBase
	AppID       uint   `json:"appID" gorm:"comment:appID"`
	TableID     uint   `json:"tableID" gorm:"comment:tableID"`
	Path        string `json:"path" gorm:"comment:api路径"`
	Description string `json:"description" gorm:"comment:api中文描述"`
	ApiGroup    string `json:"apiGroup" gorm:"comment:api组"`
	Method      string `json:"method" gorm:"default:POST;comment:方法"`
}

func (ModApi) TableName

func (ModApi) TableName() string

func (*ModApi) WeaverMarshal

func (x *ModApi) WeaverMarshal(enc *codegen.Encoder)

func (*ModApi) WeaverUnmarshal

func (x *ModApi) WeaverUnmarshal(dec *codegen.Decoder)

type ModBase

type ModBase struct {
	weaver.AutoMarshal
	ID        uint `gorm:"primarykey"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt time.Time `gorm:"index" json:"-"`
	CreatedBy uint      `json:"createdBy" gorm:"column:createdBy;comment:创建者"`
	UpdatedBy uint      `json:"updatedBy" gorm:"column:updatedBy;comment:更新者"`
	DeletedBy uint      `json:"deletedBy" gorm:"column:deletedBy"`
}

func (*ModBase) WeaverMarshal

func (x *ModBase) WeaverMarshal(enc *codegen.Encoder)

func (*ModBase) WeaverUnmarshal

func (x *ModBase) WeaverUnmarshal(dec *codegen.Decoder)

type ModDict

type ModDict struct {
	weaver.AutoMarshal
	ModBase
	Name        string       `json:"name" form:"name" gorm:"column:name;comment:字典名(中)"`
	Type        string       `json:"type" form:"type" gorm:"column:type;comment:字典名(英)"`
	Status      *bool        `json:"status" form:"status" gorm:"column:status;comment:状态"`
	Detail      string       `json:"detail" form:"detail" gorm:"column:detail;comment:描述"`
	ModDictails []ModDictail `json:"swaDictail" gorm:"-"`
}

func (ModDict) TableName

func (ModDict) TableName() string

func (*ModDict) WeaverMarshal

func (x *ModDict) WeaverMarshal(enc *codegen.Encoder)

func (*ModDict) WeaverUnmarshal

func (x *ModDict) WeaverUnmarshal(dec *codegen.Decoder)

type ModDictail

type ModDictail struct {
	weaver.AutoMarshal
	ModBase
	Label     string `json:"label" form:"label" gorm:"column:label;comment:展示值"`
	Value     int    `json:"value" form:"value" gorm:"column:value;comment:字典值"`
	Status    *bool  `json:"status" form:"status" gorm:"column:status;comment:启用状态"`
	Sort      int    `json:"sort" form:"sort" gorm:"column:sort;comment:排序标记"`
	SwaDictID int    `json:"swaDictID" form:"swaDictID" gorm:"column:swaDictID;comment:关联标记"`
}

func (ModDictail) TableName

func (ModDictail) TableName() string

func (*ModDictail) WeaverMarshal

func (x *ModDictail) WeaverMarshal(enc *codegen.Encoder)

func (*ModDictail) WeaverUnmarshal

func (x *ModDictail) WeaverUnmarshal(dec *codegen.Decoder)

type ModMenu

type ModMenu struct {
	weaver.AutoMarshal
	ModBase
	MenuLevel uint   `json:"-"`
	ParentId  string `json:"parentId" gorm:"comment:父菜单ID"`
	Path      string `json:"path" gorm:"comment:路由path"`
	Name      string `json:"name" gorm:"comment:路由name"`
	Hidden    bool   `json:"hidden" gorm:"comment:是否在列表隐藏"`
	Component string `json:"component" gorm:"comment:对应前端文件路径"`
	Sort      int    `json:"sort" gorm:"comment:排序标记"`

	Meta `json:"meta" gorm:"embedded;comment:附加属性"`
}

func (*ModMenu) WeaverMarshal

func (x *ModMenu) WeaverMarshal(enc *codegen.Encoder)

func (*ModMenu) WeaverUnmarshal

func (x *ModMenu) WeaverUnmarshal(dec *codegen.Decoder)

type ModRole

type ModRole struct {
	weaver.AutoMarshal
	ModBase
	RoleId        uint   `json:"roleId" gorm:"column:roleId;not null;comment:角色ID;size:90"`
	RoleName      string `json:"roleName" gorm:"column:roleName;comment:角色名"`
	ParentId      uint   `json:"parentId" gorm:"column:parentId;comment:父角色ID"`
	DefaultRouter string `json:"defaultRouter" gorm:"column:defaultRouter;comment:默认菜单;default:dashboard"`
}

func (*ModRole) WeaverMarshal

func (x *ModRole) WeaverMarshal(enc *codegen.Encoder)

func (*ModRole) WeaverUnmarshal

func (x *ModRole) WeaverUnmarshal(dec *codegen.Decoder)

type Os

type Os struct {
	weaver.AutoMarshal
	GOOS         string `json:"goos"`
	NumCPU       int    `json:"numCpu"`
	Compiler     string `json:"compiler"`
	GoVersion    string `json:"goVersion"`
	NumGoroutine int    `json:"numGoroutine"`
}

func InitOS

func InitOS() (o Os)

func (*Os) WeaverMarshal

func (x *Os) WeaverMarshal(enc *codegen.Encoder)

func (*Os) WeaverUnmarshal

func (x *Os) WeaverUnmarshal(dec *codegen.Decoder)

type PageInfo

type PageInfo struct {
	weaver.AutoMarshal
	Page     int    `json:"page" form:"page"`         // --页码
	PageSize int    `json:"pageSize" form:"pageSize"` // --每页大小
	Keyword  string `json:"keyword" form:"keyword"`   // --关键字
}

func (*PageInfo) WeaverMarshal

func (x *PageInfo) WeaverMarshal(enc *codegen.Encoder)

func (*PageInfo) WeaverUnmarshal

func (x *PageInfo) WeaverUnmarshal(dec *codegen.Decoder)

type PolicyPathResponse

type PolicyPathResponse struct {
	Paths []CasbinInfo `json:"paths"`
}

type Ram

type Ram struct {
	weaver.AutoMarshal
	UsedMB      int `json:"usedMb"`
	TotalMB     int `json:"totalMb"`
	UsedPercent int `json:"usedPercent"`
}

func InitRAM

func InitRAM() (r Ram, err error)

func (*Ram) WeaverMarshal

func (x *Ram) WeaverMarshal(enc *codegen.Encoder)

func (*Ram) WeaverUnmarshal

func (x *Ram) WeaverUnmarshal(dec *codegen.Decoder)

type Register

type Register struct {
	Username  string `json:"userName" example:"用户名"`
	Password  string `json:"passWord" example:"密码"`
	NickName  string `json:"nickName" example:"昵称"`
	HeaderImg string `json:"headerImg" example:"头像链接"`
	RoleId    uint   `json:"roleId" swaggertype:"string" example:"int 角色id"`
	Enable    int    `json:"enable" swaggertype:"string" example:"int 是否启用"`
	RoleIds   []uint `json:"roleIds" swaggertype:"string" example:"[]uint 角色id"`
	Phone     string `json:"phone" example:"电话号码"`
	Email     string `json:"email" example:"电子邮箱"`
}

type Role2Apis

type Role2Apis struct {
	RoleId uint `json:"roleId"`
	ApiId  uint `json:"apiId"`
}

func (Role2Apis) TableName

func (Role2Apis) TableName() string

type Role2Menus

type Role2Menus struct {
	RoleId uint `json:"roleId"`
	MenuId uint `json:"menuId"`
}

func (Role2Menus) TableName

func (Role2Menus) TableName() string

type Role2SubRoles

type Role2SubRoles struct {
	RoleId    uint `json:"roleId"`
	SubRoleId uint `json:"subRoleId"`
}

func (Role2SubRoles) TableName

func (Role2SubRoles) TableName() string

type Role2Users

type Role2Users struct {
	RoleId uint `json:"roleId"`
	UserId uint `json:"userId"`
}

func (Role2Users) TableName

func (Role2Users) TableName() string

type RoleUserMenu

type RoleUserMenu struct {
	weaver.AutoMarshal
	ModRole
	Users        []SysUser     `json:"users" gorm:"-"`
	SysBaseMenus []SysBaseMenu `json:"menus" gorm:"-"`
}

func (*RoleUserMenu) WeaverMarshal

func (x *RoleUserMenu) WeaverMarshal(enc *codegen.Encoder)

func (*RoleUserMenu) WeaverUnmarshal

func (x *RoleUserMenu) WeaverUnmarshal(dec *codegen.Decoder)

type SearchApiParams

type SearchApiParams struct {
	ModApi
	PageInfo
	OrderKey string `json:"orderKey"`
	Desc     bool   `json:"desc"`
}

type SearchInfoApi

type SearchInfoApi struct {
	weaver.AutoMarshal
	ModApi
	PageInfo
	StartCreatedAt time.Time `json:"startCreatedAt" form:"startCreatedAt"`
	EndCreatedAt   time.Time `json:"endCreatedAt" form:"endCreatedAt"`
	OrderKey       string    `json:"orderKey"`
	Desc           bool      `json:"desc"`
}

func (*SearchInfoApi) WeaverMarshal

func (x *SearchInfoApi) WeaverMarshal(enc *codegen.Encoder)

func (*SearchInfoApi) WeaverUnmarshal

func (x *SearchInfoApi) WeaverUnmarshal(dec *codegen.Decoder)

type SearchInfoDict

type SearchInfoDict struct {
	weaver.AutoMarshal
	ModDict
	PageInfo
	StartCreatedAt time.Time `json:"startCreatedAt" form:"startCreatedAt"`
	EndCreatedAt   time.Time `json:"endCreatedAt" form:"endCreatedAt"`
	OrderKey       string    `json:"orderKey"`
	Desc           bool      `json:"desc"`
}

func (*SearchInfoDict) WeaverMarshal

func (x *SearchInfoDict) WeaverMarshal(enc *codegen.Encoder)

func (*SearchInfoDict) WeaverUnmarshal

func (x *SearchInfoDict) WeaverUnmarshal(dec *codegen.Decoder)

type SearchInfoDictail

type SearchInfoDictail struct {
	weaver.AutoMarshal
	ModDictail
	PageInfo
	StartCreatedAt time.Time `json:"startCreatedAt" form:"startCreatedAt"`
	EndCreatedAt   time.Time `json:"endCreatedAt" form:"endCreatedAt"`
	OrderKey       string    `json:"orderKey"`
	Desc           bool      `json:"desc"`
}

func (*SearchInfoDictail) WeaverMarshal

func (x *SearchInfoDictail) WeaverMarshal(enc *codegen.Encoder)

func (*SearchInfoDictail) WeaverUnmarshal

func (x *SearchInfoDictail) WeaverUnmarshal(dec *codegen.Decoder)

type SearchInfoRecord

type SearchInfoRecord struct {
	weaver.AutoMarshal
	SwaRecord
	PageInfo
	StartCreatedAt time.Time `json:"startCreatedAt" form:"startCreatedAt"`
	EndCreatedAt   time.Time `json:"endCreatedAt" form:"endCreatedAt"`
	OrderKey       string    `json:"orderKey"`
	Desc           bool      `json:"desc"`
}

func (*SearchInfoRecord) WeaverMarshal

func (x *SearchInfoRecord) WeaverMarshal(enc *codegen.Encoder)

func (*SearchInfoRecord) WeaverUnmarshal

func (x *SearchInfoRecord) WeaverUnmarshal(dec *codegen.Decoder)

type Server

type Server struct {
	weaver.AutoMarshal
	Os   Os   `json:"os"`
	Cpu  Cpu  `json:"cpu"`
	Ram  Ram  `json:"ram"`
	Disk Disk `json:"disk"`
}

func (*Server) WeaverMarshal

func (x *Server) WeaverMarshal(enc *codegen.Encoder)

func (*Server) WeaverUnmarshal

func (x *Server) WeaverUnmarshal(dec *codegen.Decoder)

type SetUserAuth

type SetUserAuth struct {
	RoleId uint `json:"roleId"`
}

type SetUserAuthorities

type SetUserAuthorities struct {
	ID      uint
	RoleIds []uint `json:"roleIds"`
}

type SwaDictSearch

type SwaDictSearch struct {
	weaver.AutoMarshal
	ModDict
	PageInfo
}

func (*SwaDictSearch) WeaverMarshal

func (x *SwaDictSearch) WeaverMarshal(enc *codegen.Encoder)

func (*SwaDictSearch) WeaverUnmarshal

func (x *SwaDictSearch) WeaverUnmarshal(dec *codegen.Decoder)

type SwaDictailSearch

type SwaDictailSearch struct {
	weaver.AutoMarshal
	ModDictail
	PageInfo
}

func (*SwaDictailSearch) WeaverMarshal

func (x *SwaDictailSearch) WeaverMarshal(enc *codegen.Encoder)

func (*SwaDictailSearch) WeaverUnmarshal

func (x *SwaDictailSearch) WeaverUnmarshal(dec *codegen.Decoder)

type SwaRecord

type SwaRecord struct {
	weaver.AutoMarshal
	ModBase
	Ip           string        `json:"ip" form:"ip" gorm:"column:ip;comment:请求ip"`
	Method       string        `json:"method" form:"method" gorm:"column:method;comment:请求方法"`
	Path         string        `json:"path" form:"path" gorm:"column:path;comment:请求路径"`
	Status       int           `json:"status" form:"status" gorm:"column:status;comment:请求状态"`
	Latency      time.Duration `json:"latency" form:"latency" gorm:"column:latency;comment:延迟" swaggertype:"string"`
	Agent        string        `json:"agent" form:"agent" gorm:"type:text;column:agent;comment:代理"`
	ErrorMessage string        `json:"error_message" form:"error_message" gorm:"type:text;column:error_message;comment:错误信息"`
	Body         string        `json:"body" form:"body" gorm:"type:text;column:body;comment:请求Body"`
	Resp         string        `json:"resp" form:"resp" gorm:"type:text;column:resp;comment:响应Body"`
	UserID       int           `json:"user_id" form:"user_id" gorm:"column:user_id;comment:用户id"`
	User         SysUser       `json:"user"`
}

func (SwaRecord) TableName

func (SwaRecord) TableName() string

func (*SwaRecord) WeaverMarshal

func (x *SwaRecord) WeaverMarshal(enc *codegen.Encoder)

func (*SwaRecord) WeaverUnmarshal

func (x *SwaRecord) WeaverUnmarshal(dec *codegen.Decoder)

type SwaRecordSearch

type SwaRecordSearch struct {
	weaver.AutoMarshal
	SwaRecord
	PageInfo
}

func (*SwaRecordSearch) WeaverMarshal

func (x *SwaRecordSearch) WeaverMarshal(enc *codegen.Encoder)

func (*SwaRecordSearch) WeaverUnmarshal

func (x *SwaRecordSearch) WeaverUnmarshal(dec *codegen.Decoder)

type SwaRole

type SwaRole struct {
	weaver.AutoMarshal
	ModRole

	SubRoles  []ModRole `json:"subRoles" gorm:"-"`
	RoleMenus []ModMenu `json:"menus" gorm:"-"`
}

func (SwaRole) TableName

func (SwaRole) TableName() string

func (*SwaRole) WeaverMarshal

func (x *SwaRole) WeaverMarshal(enc *codegen.Encoder)

func (*SwaRole) WeaverUnmarshal

func (x *SwaRole) WeaverUnmarshal(dec *codegen.Decoder)

type SwaRoleBtn

type SwaRoleBtn struct {
	RoleId           uint           `gorm:"comment:角色ID"`
	SysMenuID        uint           `gorm:"comment:菜单ID"`
	SysBaseMenuBtnID uint           `gorm:"comment:菜单按钮ID"`
	SysBaseMenuBtn   SysBaseMenuBtn ` gorm:"comment:按钮详情"`
}

func (SwaRoleBtn) TableName

func (SwaRoleBtn) TableName() string

type SwaRoleBtnReq

type SwaRoleBtnReq struct {
	MenuID   uint   `json:"menuID"`
	RoleId   uint   `json:"roleId"`
	Selected []uint `json:"selected"`
}

type SwaRoleBtnRes

type SwaRoleBtnRes struct {
	Selected []uint `json:"selected"`
}

type SwaRoleChildren

type SwaRoleChildren struct {
	SwaRole  `json:"swaRole"`
	Children []SwaRoleChildren `json:"children" gorm:"-"`
}

type SwaRoleCopyResponse

type SwaRoleCopyResponse struct {
	SwaRole   SwaRoleChildren `json:"swaRole"`
	OldRoleId uint            `json:"oldRoleId"` // --旧角色ID
}

type SwaRoleMenu

type SwaRoleMenu struct {
	MenuId string `json:"menuId" gorm:"comment:菜单ID;column:sys_base_menu_id"`
	RoleId string `json:"-" gorm:"comment:角色ID;column:sys_role_role_id"`
}

func (SwaRoleMenu) TableName

func (SwaRoleMenu) TableName() string

type SwaRoleResponse

type SwaRoleResponse struct {
	SwaRole SwaRole `json:"swaRole"`
}

type SysAPIListResponse

type SysAPIListResponse struct {
	Apis []ModApi `json:"apis"`
}

type SysAPIResponse

type SysAPIResponse struct {
	Api ModApi `json:"api"`
}

type SysBaseMenu

type SysBaseMenu struct {
	weaver.AutoMarshal
	ModMenu

	SwaRoles   []SwaRole              `json:"roles" gorm:"many2many:swa_menu_role;"`
	Parameters []SysBaseMenuParameter `json:"parameters" gorm:"-"`
	MenuBtn    []SysBaseMenuBtn       `json:"menuBtn" gorm:"-"`

	Meta `json:"meta" gorm:"embedded;comment:附加属性"`
}

func DefaultMenu

func DefaultMenu() []SysBaseMenu

func (SysBaseMenu) TableName

func (m SysBaseMenu) TableName() string

func (*SysBaseMenu) WeaverMarshal

func (x *SysBaseMenu) WeaverMarshal(enc *codegen.Encoder)

func (*SysBaseMenu) WeaverUnmarshal

func (x *SysBaseMenu) WeaverUnmarshal(dec *codegen.Decoder)

type SysBaseMenuBtn

type SysBaseMenuBtn struct {
	weaver.AutoMarshal
	ModBase
	Name          string `json:"name" gorm:"comment:按钮关键key"`
	Desc          string `json:"desc" gorm:"按钮备注"`
	SysBaseMenuID uint   `json:"sysBaseMenuID" gorm:"comment:菜单ID"`
}

func (SysBaseMenuBtn) TableName

func (SysBaseMenuBtn) TableName() string

func (*SysBaseMenuBtn) WeaverMarshal

func (x *SysBaseMenuBtn) WeaverMarshal(enc *codegen.Encoder)

func (*SysBaseMenuBtn) WeaverUnmarshal

func (x *SysBaseMenuBtn) WeaverUnmarshal(dec *codegen.Decoder)

type SysBaseMenuParameter

type SysBaseMenuParameter struct {
	weaver.AutoMarshal
	ModBase
	SysBaseMenuID uint   `json:"menuId"`
	Type          string `json:"type" gorm:"comment:地址栏携带参数为params还是query"`
	Key           string `json:"key" gorm:"comment:地址栏携带参数的key"`
	Value         string `json:"value" gorm:"comment:地址栏携带参数的值"`
}

func (SysBaseMenuParameter) TableName

func (SysBaseMenuParameter) TableName() string

func (*SysBaseMenuParameter) WeaverMarshal

func (x *SysBaseMenuParameter) WeaverMarshal(enc *codegen.Encoder)

func (*SysBaseMenuParameter) WeaverUnmarshal

func (x *SysBaseMenuParameter) WeaverUnmarshal(dec *codegen.Decoder)

type SysBaseMenuResponse

type SysBaseMenuResponse struct {
	Menu SysBaseMenu `json:"menu"`
}

type SysBaseMenusResponse

type SysBaseMenusResponse struct {
	Menus []SysBaseMenu `json:"menus"`
}

type SysMenu

type SysMenu struct {
	SysBaseMenu
	MenuId     string                 `json:"menuId" gorm:"comment:菜单ID"`
	RoleId     uint                   `json:"-" gorm:"comment:角色ID"`
	Parameters []SysBaseMenuParameter `json:"parameters" gorm:"-"`
	Children   []SysMenu              `json:"children" gorm:"-"`
	Btns       map[string]uint        `json:"btns" gorm:"-"`
}

type SysMenusResponse

type SysMenusResponse struct {
	Menus []SysMenu `json:"menus"`
}

type SysUser

type SysUser struct {
	weaver.AutoMarshal
	ModBase
	UUID        uuid.UUID `json:"uuid" gorm:"index;comment:用户UUID"`
	Username    string    `json:"userName" gorm:"index;comment:用户登录名"`
	Password    string    `json:"-"  gorm:"comment:用户登录密码"`
	NickName    string    `json:"nickName" gorm:"default:系统用户;comment:用户昵称"`
	SideMode    string    `json:"sideMode" gorm:"default:dark;comment:用户侧边主题"`
	HeaderImg   string    `json:"headerImg" gorm:"comment:用户头像"`
	BaseColor   string    `json:"baseColor" gorm:"default:#fff;comment:基础颜色"`
	ActiveColor string    `json:"activeColor" gorm:"default:#1890ff;comment:活跃颜色"`
	Phone       string    `json:"phone"  gorm:"comment:用户手机号"`
	Email       string    `json:"email"  gorm:"comment:用户邮箱"`
	Team        string    `json:"team"  gorm:"comment:项目组"`
	Dept        string    `json:"dept"  gorm:"comment:部门"`
	Company     string    `json:"company"  gorm:"comment:公司/组织"`
	Enable      int       `json:"enable" gorm:"default:1;comment:用户是否被冻结 1正常 2冻结"`

	RoleId      uint      `json:"roleId" gorm:"default:888;comment:用户角色ID"`
	RoleIds     []uint    `json:"roleIds" gorm:"-"`
	SwaRole     SwaRole   `json:"swaRole" gorm:"-"`
	Authorities []SwaRole `json:"authorities" gorm:"-"`
}

func (SysUser) TableName

func (SysUser) TableName() string

func (*SysUser) WeaverMarshal

func (x *SysUser) WeaverMarshal(enc *codegen.Encoder)

func (*SysUser) WeaverUnmarshal

func (x *SysUser) WeaverUnmarshal(dec *codegen.Decoder)

type SysUserResponse

type SysUserResponse struct {
	User SysUser `json:"user"`
}

type TApi

type TApi interface {
	CreateApi(_ context.Context, api ModApi) (err error)
	DeleteApi(_ context.Context, api ModApi) (err error)
	GetAPIInfoList(_ context.Context, api ModApi, info PageInfo, order string, desc bool) (list []ModApi, total int64, err error)
	GetAllApis(_ context.Context) (apis []ModApi, err error)
	GetApiById(_ context.Context, id int) (api ModApi, err error)
	UpdateApi(_ context.Context, api ModApi) (err error)
	DeleteApisByIds(_ context.Context, ids []uint) (err error)
}

type TBlacklist

type TBlacklist interface {
	CreateBlacklist(_ context.Context, jwtList JwtBlacklist) (err error)
}

type TCasbin

type TCasbin interface {
	UpdateCasbin(_ context.Context, RoleID uint, casbinInfos []CasbinInfo) error
	GetPolicyPathByRoleId(_ context.Context, RoleID uint) (pathMaps []CasbinInfo, err error)
	Scasbin(_ context.Context, sub string, obj string, act string) (sok bool, err error)
}

type TDict

type TDict interface {
	CreateSwaDict(_ context.Context, swaDict ModDict) (err error)
	DeleteSwaDict(_ context.Context, swaDict ModDict) (err error)
	UpdateSwaDict(_ context.Context, swaDict ModDict) (err error)
	GetSwaDict(_ context.Context, Type string, Id uint, status *bool) (swaDict ModDict, err error)
	GetSwaDictInfoList(_ context.Context, info SwaDictSearch) (list []ModDict, total int64, err error)
}

type TDictail

type TDictail interface {
	CreateSwaDictail(_ context.Context, swaDictail ModDictail) (err error)
	DeleteSwaDictail(_ context.Context, swaDictail ModDictail) (err error)
	UpdateSwaDictail(_ context.Context, swaDictail ModDictail) (err error)
	GetSwaDictail(_ context.Context, id uint) (swaDictail ModDictail, err error)
	GetSwaDictailInfoList(_ context.Context, info SwaDictailSearch) (list []ModDictail, total int64, err error)
}

type TMenu

type TMenu interface {
	GetRoleMenu(ctx context.Context, roleId uint) ([]SysBaseMenu, error)
	GetInfoList(ctx context.Context) (list []SysBaseMenu, total int64, err error)
	AddMenuRole(ctx context.Context, menus []SysBaseMenu, roleId uint) (err error)
	GetBaseMenuById(_ context.Context, id int) (menu SysBaseMenu, err error)
	GetAllBaseMenu(_ context.Context) (menus []SysBaseMenu, err error)
	AddBaseMenu(_ context.Context, menu SysBaseMenu) error
	DeleteBaseMenu(_ context.Context, id int) (err error)
	UpdateBaseMenu(ctx context.Context, menu SysBaseMenu) (err error)
	GetMenuRole(_ context.Context, id uint) (menus []SysBaseMenu, err error)
}

type TRecord

type TRecord interface {
	CreateSwaRecord(_ context.Context, swaRecord SwaRecord) (err error)
	DeleteSwaRecordByIds(_ context.Context, ids []uint) (err error)
	DeleteSwaRecord(_ context.Context, swaRecord SwaRecord) (err error)
	GetSwaRecord(_ context.Context, id uint) (swaRecord SwaRecord, err error)
	GetSwaRecordInfoList(_ context.Context, info SwaRecordSearch) (list []SwaRecord, total int64, err error)
}

type TRole

type TRole interface {
	CreateRole(_ context.Context, auth SwaRole) (swaRole SwaRole, err error)

	UpdateRole(_ context.Context, auth SwaRole) (swaRole SwaRole, err error)
	DeleteRole(_ context.Context, auth RoleUserMenu) (err error)
	GetRoleList(_ context.Context, info PageInfo) (list []SwaRole, total int64, err error)
	GetRoleInfo(_ context.Context, id uint) (sa SwaRole, err error)
	SetSubRoles(_ context.Context, auth SwaRole) error
	SetRoleMenus(_ context.Context, auth SwaRole) error
	GetSubRoles(_ context.Context, id uint) (subRoles []SwaRole, err error)
}

type TSystem

type TSystem interface {
	GetServerInfo(ctx context.Context) (server Server, err error)
}

type TUser

type TUser interface {
	Login(ctx context.Context, m SysUser) (SysUser, error)
	GetUserInfo(ctx context.Context, uuid uuid.UUID) (SysUser, error)
	Register(ctx context.Context, m SysUser) (SysUser, error)
	ChangePassword(ctx context.Context, uid uint, oldPassword string, newPassword string) (userInter *SysUser, err error)
	GetUserInfoList(ctx context.Context, page PageInfo) (list []SysUser, total int64, err error)
	SetUserRole(_ context.Context, id uint, roleId uint) (err error)
	SetUserAuthorities(_ context.Context, id uint, roleIds []uint) (err error)
	SetUserInfo(_ context.Context, req SysUser) error
	DeleteUser(_ context.Context, id int) (err error)
	SetSelfInfo(_ context.Context, req SysUser) error
	ResetPassword(_ context.Context, ID uint) (err error)
	GetUserDict(_ context.Context) (user []SysUser, err error)
}

type UserRole

type UserRole struct {
	UserId uint `gorm:"column:user_id"`
	RoleId uint `gorm:"column:role_id"`
}

func (*UserRole) TableName

func (s *UserRole) TableName() string

Jump to

Keyboard shortcuts

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