Documentation ¶
Index ¶
- Constants
- Variables
- func LoadAll()
- func RegisterInit(order int, i SubInitializer)
- type ApiService
- func (apiService *ApiService) CreateApi(api system.SysApi) (err error)
- func (apiService *ApiService) DeleteApi(api system.SysApi) (err error)
- func (apiService *ApiService) DeleteApisByIds(ids request.IdsReq) (err error)
- func (apiService *ApiService) EnterSyncApi(syncApis systemRes.SysSyncApis) (err error)
- func (apiService *ApiService) GetAPIInfoList(api system.SysApi, info request.PageInfo, order string, desc bool) (list interface{}, total int64, err error)
- func (apiService *ApiService) GetAllApis(authorityID uint) (apis []system.SysApi, err error)
- func (apiService *ApiService) GetApiById(id int) (api system.SysApi, err error)
- func (apiService *ApiService) GetApiGroups() (groups []string, groupApiMap map[string]string, err error)
- func (apiService *ApiService) IgnoreApi(ignoreApi system.SysIgnoreApi) (err error)
- func (apiService *ApiService) SyncApi() (newApis, deleteApis, ignoreApis []system.SysApi, err error)
- func (apiService *ApiService) UpdateApi(api system.SysApi) (err error)
- type AuthorityBtnService
- type AuthorityService
- func (authorityService *AuthorityService) CheckAuthorityIDAuth(authorityID, targetID uint) (err error)
- func (authorityService *AuthorityService) CopyAuthority(adminAuthorityID uint, copyInfo response.SysAuthorityCopyResponse) (authority system.SysAuthority, err error)
- func (authorityService *AuthorityService) CreateAuthority(auth system.SysAuthority) (authority system.SysAuthority, err error)
- func (authorityService *AuthorityService) DeleteAuthority(auth *system.SysAuthority) error
- func (authorityService *AuthorityService) GetAuthorityInfo(auth system.SysAuthority) (sa system.SysAuthority, err error)
- func (authorityService *AuthorityService) GetAuthorityInfoList(authorityID uint) (list []system.SysAuthority, err error)
- func (authorityService *AuthorityService) GetParentAuthorityID(authorityID uint) (parentID uint, err error)
- func (authorityService *AuthorityService) GetStructAuthorityList(authorityID uint) (list []uint, err error)
- func (authorityService *AuthorityService) SetDataAuthority(adminAuthorityID uint, auth system.SysAuthority) error
- func (authorityService *AuthorityService) SetMenuAuthority(auth *system.SysAuthority) error
- func (authorityService *AuthorityService) UpdateAuthority(auth system.SysAuthority) (authority system.SysAuthority, err error)
- type AutoCodeService
- type BaseMenuService
- type CasbinService
- func (casbinService *CasbinService) AddPolicies(db *gorm.DB, rules [][]string) error
- func (casbinService *CasbinService) Casbin() *casbin.SyncedCachedEnforcer
- func (casbinService *CasbinService) ClearCasbin(v int, p ...string) bool
- func (casbinService *CasbinService) FreshCasbin() (err error)
- func (casbinService *CasbinService) GetPolicyPathByAuthorityId(AuthorityID uint) (pathMaps []request.CasbinInfo)
- func (casbinService *CasbinService) RemoveFilteredPolicy(db *gorm.DB, authorityId string) error
- func (casbinService *CasbinService) SyncPolicy(db *gorm.DB, authorityId string, rules [][]string) error
- func (casbinService *CasbinService) UpdateCasbin(adminAuthorityID, AuthorityID uint, casbinInfos []request.CasbinInfo) error
- func (casbinService *CasbinService) UpdateCasbinApi(oldPath string, newPath string, oldMethod string, newMethod string) error
- type Database
- type DictionaryDetailService
- func (dictionaryDetailService *DictionaryDetailService) CreateSysDictionaryDetail(sysDictionaryDetail system.SysDictionaryDetail) (err error)
- func (dictionaryDetailService *DictionaryDetailService) DeleteSysDictionaryDetail(sysDictionaryDetail system.SysDictionaryDetail) (err error)
- func (dictionaryDetailService *DictionaryDetailService) GetDictionaryInfoByTypeValue(t string, value string) (detail system.SysDictionaryDetail, err error)
- func (dictionaryDetailService *DictionaryDetailService) GetDictionaryInfoByValue(dictionaryID uint, value string) (detail system.SysDictionaryDetail, err error)
- func (dictionaryDetailService *DictionaryDetailService) GetDictionaryList(dictionaryID uint) (list []system.SysDictionaryDetail, err error)
- func (dictionaryDetailService *DictionaryDetailService) GetDictionaryListByType(t string) (list []system.SysDictionaryDetail, err error)
- func (dictionaryDetailService *DictionaryDetailService) GetSysDictionaryDetail(id uint) (sysDictionaryDetail system.SysDictionaryDetail, err error)
- func (dictionaryDetailService *DictionaryDetailService) GetSysDictionaryDetailInfoList(info request.SysDictionaryDetailSearch) (list interface{}, total int64, err error)
- func (dictionaryDetailService *DictionaryDetailService) UpdateSysDictionaryDetail(sysDictionaryDetail *system.SysDictionaryDetail) (err error)
- type DictionaryService
- func (dictionaryService *DictionaryService) CreateSysDictionary(sysDictionary system.SysDictionary) (err error)
- func (dictionaryService *DictionaryService) DeleteSysDictionary(sysDictionary system.SysDictionary) (err error)
- func (dictionaryService *DictionaryService) GetSysDictionary(Type string, Id uint, status *bool) (sysDictionary system.SysDictionary, err error)
- func (dictionaryService *DictionaryService) GetSysDictionaryInfoList() (list interface{}, err error)
- func (dictionaryService *DictionaryService) UpdateSysDictionary(sysDictionary *system.SysDictionary) (err error)
- type InitDBService
- type JwtService
- func (jwtService *JwtService) GetRedisJWT(userName string) (redisJWT string, err error)
- func (jwtService *JwtService) IsBlacklist(jwt string) bool
- func (jwtService *JwtService) JsonInBlacklist(jwtList system.JwtBlacklist) (err error)
- func (jwtService *JwtService) SetRedisJWT(jwt string, userName string) (err error)
- type MenuService
- func (menuService *MenuService) AddBaseMenu(menu system.SysBaseMenu) error
- func (menuService *MenuService) AddMenuAuthority(menus []system.SysBaseMenu, adminAuthorityID, authorityId uint) (err error)
- func (menuService *MenuService) GetBaseMenuTree(authorityID uint) (menus []system.SysBaseMenu, err error)
- func (menuService *MenuService) GetInfoList(authorityID uint) (list interface{}, err error)
- func (menuService *MenuService) GetMenuAuthority(info *request.GetAuthorityId) (menus []system.SysMenu, err error)
- func (menuService *MenuService) GetMenuTree(authorityId uint) (menus []system.SysMenu, err error)
- func (menuService *MenuService) UserAuthorityDefaultRouter(user *system.SysUser)
- type MssqlInitHandler
- func (h MssqlInitHandler) EnsureDB(ctx context.Context, conf *request.InitDB) (next context.Context, err error)
- func (h MssqlInitHandler) InitData(ctx context.Context, inits initSlice) error
- func (h MssqlInitHandler) InitTables(ctx context.Context, inits initSlice) error
- func (h MssqlInitHandler) WriteConfig(ctx context.Context) error
- type MysqlInitHandler
- func (h MysqlInitHandler) EnsureDB(ctx context.Context, conf *request.InitDB) (next context.Context, err error)
- func (h MysqlInitHandler) InitData(ctx context.Context, inits initSlice) error
- func (h MysqlInitHandler) InitTables(ctx context.Context, inits initSlice) error
- func (h MysqlInitHandler) WriteConfig(ctx context.Context) error
- type OperationRecordService
- func (operationRecordService *OperationRecordService) CreateSysOperationRecord(sysOperationRecord system.SysOperationRecord) (err error)
- func (operationRecordService *OperationRecordService) DeleteSysOperationRecord(sysOperationRecord system.SysOperationRecord) (err error)
- func (operationRecordService *OperationRecordService) DeleteSysOperationRecordByIds(ids request.IdsReq) (err error)
- func (operationRecordService *OperationRecordService) GetSysOperationRecord(id uint) (sysOperationRecord system.SysOperationRecord, err error)
- func (operationRecordService *OperationRecordService) GetSysOperationRecordInfoList(info systemReq.SysOperationRecordSearch) (list interface{}, total int64, err error)
- type PgsqlInitHandler
- func (h PgsqlInitHandler) EnsureDB(ctx context.Context, conf *request.InitDB) (next context.Context, err error)
- func (h PgsqlInitHandler) InitData(ctx context.Context, inits initSlice) error
- func (h PgsqlInitHandler) InitTables(ctx context.Context, inits initSlice) error
- func (h PgsqlInitHandler) WriteConfig(ctx context.Context) error
- type ServiceGroup
- type SqliteInitHandler
- func (h SqliteInitHandler) EnsureDB(ctx context.Context, conf *request.InitDB) (next context.Context, err error)
- func (h SqliteInitHandler) InitData(ctx context.Context, inits initSlice) error
- func (h SqliteInitHandler) InitTables(ctx context.Context, inits initSlice) error
- func (h SqliteInitHandler) WriteConfig(ctx context.Context) error
- type SubInitializer
- type SysExportTemplateService
- func (sysExportTemplateService *SysExportTemplateService) CreateSysExportTemplate(sysExportTemplate *system.SysExportTemplate) (err error)
- func (sysExportTemplateService *SysExportTemplateService) DeleteSysExportTemplate(sysExportTemplate system.SysExportTemplate) (err error)
- func (sysExportTemplateService *SysExportTemplateService) DeleteSysExportTemplateByIds(ids request.IdsReq) (err error)
- func (sysExportTemplateService *SysExportTemplateService) ExportExcel(templateID string, values url.Values) (file *bytes.Buffer, name string, err error)
- func (sysExportTemplateService *SysExportTemplateService) ExportTemplate(templateID string) (file *bytes.Buffer, name string, err error)
- func (sysExportTemplateService *SysExportTemplateService) GetSysExportTemplate(id uint) (sysExportTemplate system.SysExportTemplate, err error)
- func (sysExportTemplateService *SysExportTemplateService) GetSysExportTemplateInfoList(info systemReq.SysExportTemplateSearch) (list []system.SysExportTemplate, total int64, err error)
- func (sysExportTemplateService *SysExportTemplateService) ImportExcel(templateID string, file *multipart.FileHeader) (err error)
- func (sysExportTemplateService *SysExportTemplateService) UpdateSysExportTemplate(sysExportTemplate system.SysExportTemplate) (err error)
- type SysParamsService
- func (sysParamsService *SysParamsService) CreateSysParams(sysParams *system.SysParams) (err error)
- func (sysParamsService *SysParamsService) DeleteSysParams(ID string) (err error)
- func (sysParamsService *SysParamsService) DeleteSysParamsByIds(IDs []string) (err error)
- func (sysParamsService *SysParamsService) GetSysParam(key string) (param system.SysParams, err error)
- func (sysParamsService *SysParamsService) GetSysParams(ID string) (sysParams system.SysParams, err error)
- func (sysParamsService *SysParamsService) GetSysParamsInfoList(info systemReq.SysParamsSearch) (list []system.SysParams, total int64, err error)
- func (sysParamsService *SysParamsService) UpdateSysParams(sysParams system.SysParams) (err error)
- type SystemConfigService
- type TypedDBInitHandler
- type UserService
- func (userService *UserService) ChangePassword(u *system.SysUser, newPassword string) (userInter *system.SysUser, err error)
- func (userService *UserService) DeleteUser(id int) (err error)
- func (userService *UserService) FindUserById(id int) (user *system.SysUser, err error)
- func (userService *UserService) FindUserByUuid(uuid string) (user *system.SysUser, err error)
- func (userService *UserService) GetUserInfo(uuid uuid.UUID) (user system.SysUser, err error)
- func (userService *UserService) GetUserInfoList(info systemReq.GetUserList) (list interface{}, total int64, err error)
- func (userService *UserService) Login(u *system.SysUser) (userInter *system.SysUser, err error)
- func (userService *UserService) Register(u system.SysUser) (userInter system.SysUser, err error)
- func (userService *UserService) ResetPassword(ID uint) (err error)
- func (userService *UserService) SetSelfInfo(req system.SysUser) error
- func (userService *UserService) SetSelfSetting(req common.JSONMap, uid uint) error
- func (userService *UserService) SetUserAuthorities(adminAuthorityID, id uint, authorityIds []uint) (err error)
- func (userService *UserService) SetUserAuthority(id uint, authorityId uint) (err error)
- func (userService *UserService) SetUserInfo(req system.SysUser) error
Constants ¶
const ( Mysql = "mysql" Pgsql = "pgsql" Sqlite = "sqlite" Mssql = "mssql" InitSuccess = "\n[%v] --> 初始数据成功!\n" InitDataExist = "\n[%v] --> %v 的初始数据已存在!\n" InitDataFailed = "\n[%v] --> %v 初始数据失败! \nerr: %+v\n" InitDataSuccess = "\n[%v] --> %v 初始数据成功!\n" )
const ( InitOrderSystem = 10 InitOrderInternal = 1000 InitOrderExternal = 100000 )
Variables ¶
var ( ErrMissingDBContext = errors.New("missing db in context") ErrMissingDependentContext = errors.New("missing dependent value in context") ErrDBTypeMismatch = errors.New("db type mismatch") )
var ApiServiceApp = new(ApiService)
var AuthorityBtnServiceApp = new(AuthorityBtnService)
var AuthorityServiceApp = new(AuthorityService)
var AutoCodeMssql = new(autoCodeMssql)
var AutoCodeMysql = new(autoCodeMysql)
var AutoCodeOracle = new(autoCodeOracle)
var AutoCodePackage = new(autoCodePackage)
var AutoCodePgsql = new(autoCodePgsql)
var AutoCodePlugin = new(autoCodePlugin)
var AutoCodeSqlite = new(autoCodeSqlite)
var AutoCodeTemplate = new(autoCodeTemplate)
var AutocodeHistory = new(autoCodeHistory)
var BaseMenuServiceApp = new(BaseMenuService)
var CasbinServiceApp = new(CasbinService)
var DictionaryDetailServiceApp = new(DictionaryDetailService)
var DictionaryServiceApp = new(DictionaryService)
var ErrRoleExistence = errors.New("存在相同角色id")
var JwtServiceApp = new(JwtService)
var MenuServiceApp = new(MenuService)
var OperationRecordServiceApp = new(OperationRecordService)
var SysExportTemplateServiceApp = new(SysExportTemplateService)
var SystemConfigServiceApp = new(SystemConfigService)
var UserServiceApp = new(UserService)
Functions ¶
func RegisterInit ¶
func RegisterInit(order int, i SubInitializer)
RegisterInit 注册要执行的初始化过程,会在 InitDB() 时调用
Types ¶
type ApiService ¶
type ApiService struct{}
func (*ApiService) CreateApi ¶
func (apiService *ApiService) CreateApi(api system.SysApi) (err error)
func (*ApiService) DeleteApi ¶
func (apiService *ApiService) DeleteApi(api system.SysApi) (err error)
func (*ApiService) DeleteApisByIds ¶
func (apiService *ApiService) DeleteApisByIds(ids request.IdsReq) (err error)
func (*ApiService) EnterSyncApi ¶
func (apiService *ApiService) EnterSyncApi(syncApis systemRes.SysSyncApis) (err error)
func (*ApiService) GetAPIInfoList ¶
func (*ApiService) GetAllApis ¶
func (apiService *ApiService) GetAllApis(authorityID uint) (apis []system.SysApi, err error)
func (*ApiService) GetApiById ¶
func (apiService *ApiService) GetApiById(id int) (api system.SysApi, err error)
func (*ApiService) GetApiGroups ¶
func (apiService *ApiService) GetApiGroups() (groups []string, groupApiMap map[string]string, err error)
func (*ApiService) IgnoreApi ¶
func (apiService *ApiService) IgnoreApi(ignoreApi system.SysIgnoreApi) (err error)
type AuthorityBtnService ¶
type AuthorityBtnService struct{}
func (*AuthorityBtnService) CanRemoveAuthorityBtn ¶
func (a *AuthorityBtnService) CanRemoveAuthorityBtn(ID string) (err error)
func (*AuthorityBtnService) GetAuthorityBtn ¶
func (a *AuthorityBtnService) GetAuthorityBtn(req request.SysAuthorityBtnReq) (res response.SysAuthorityBtnRes, err error)
func (*AuthorityBtnService) SetAuthorityBtn ¶
func (a *AuthorityBtnService) SetAuthorityBtn(req request.SysAuthorityBtnReq) (err error)
type AuthorityService ¶
type AuthorityService struct{}
func (*AuthorityService) CheckAuthorityIDAuth ¶
func (authorityService *AuthorityService) CheckAuthorityIDAuth(authorityID, targetID uint) (err error)
func (*AuthorityService) CopyAuthority ¶
func (authorityService *AuthorityService) CopyAuthority(adminAuthorityID uint, copyInfo response.SysAuthorityCopyResponse) (authority system.SysAuthority, err error)
func (*AuthorityService) CreateAuthority ¶
func (authorityService *AuthorityService) CreateAuthority(auth system.SysAuthority) (authority system.SysAuthority, err error)
func (*AuthorityService) DeleteAuthority ¶
func (authorityService *AuthorityService) DeleteAuthority(auth *system.SysAuthority) error
func (*AuthorityService) GetAuthorityInfo ¶
func (authorityService *AuthorityService) GetAuthorityInfo(auth system.SysAuthority) (sa system.SysAuthority, err error)
func (*AuthorityService) GetAuthorityInfoList ¶
func (authorityService *AuthorityService) GetAuthorityInfoList(authorityID uint) (list []system.SysAuthority, err error)
func (*AuthorityService) GetParentAuthorityID ¶
func (authorityService *AuthorityService) GetParentAuthorityID(authorityID uint) (parentID uint, err error)
func (*AuthorityService) GetStructAuthorityList ¶
func (authorityService *AuthorityService) GetStructAuthorityList(authorityID uint) (list []uint, err error)
func (*AuthorityService) SetDataAuthority ¶
func (authorityService *AuthorityService) SetDataAuthority(adminAuthorityID uint, auth system.SysAuthority) error
func (*AuthorityService) SetMenuAuthority ¶
func (authorityService *AuthorityService) SetMenuAuthority(auth *system.SysAuthority) error
func (*AuthorityService) UpdateAuthority ¶
func (authorityService *AuthorityService) UpdateAuthority(auth system.SysAuthority) (authority system.SysAuthority, err error)
type AutoCodeService ¶
type AutoCodeService struct{}
func (*AutoCodeService) Database ¶
func (autoCodeService *AutoCodeService) Database(businessDB string) Database
type BaseMenuService ¶
type BaseMenuService struct{}
func (*BaseMenuService) DeleteBaseMenu ¶
func (baseMenuService *BaseMenuService) DeleteBaseMenu(id int) (err error)
func (*BaseMenuService) GetBaseMenuById ¶
func (baseMenuService *BaseMenuService) GetBaseMenuById(id int) (menu system.SysBaseMenu, err error)
func (*BaseMenuService) UpdateBaseMenu ¶
func (baseMenuService *BaseMenuService) UpdateBaseMenu(menu system.SysBaseMenu) (err error)
type CasbinService ¶
type CasbinService struct{}
func (*CasbinService) AddPolicies ¶
func (casbinService *CasbinService) AddPolicies(db *gorm.DB, rules [][]string) error
func (*CasbinService) Casbin ¶
func (casbinService *CasbinService) Casbin() *casbin.SyncedCachedEnforcer
func (*CasbinService) ClearCasbin ¶
func (casbinService *CasbinService) ClearCasbin(v int, p ...string) bool
func (*CasbinService) FreshCasbin ¶
func (casbinService *CasbinService) FreshCasbin() (err error)
func (*CasbinService) GetPolicyPathByAuthorityId ¶
func (casbinService *CasbinService) GetPolicyPathByAuthorityId(AuthorityID uint) (pathMaps []request.CasbinInfo)
func (*CasbinService) RemoveFilteredPolicy ¶
func (casbinService *CasbinService) RemoveFilteredPolicy(db *gorm.DB, authorityId string) error
func (*CasbinService) SyncPolicy ¶
func (*CasbinService) UpdateCasbin ¶
func (casbinService *CasbinService) UpdateCasbin(adminAuthorityID, AuthorityID uint, casbinInfos []request.CasbinInfo) error
func (*CasbinService) UpdateCasbinApi ¶
type DictionaryDetailService ¶
type DictionaryDetailService struct{}
func (*DictionaryDetailService) CreateSysDictionaryDetail ¶
func (dictionaryDetailService *DictionaryDetailService) CreateSysDictionaryDetail(sysDictionaryDetail system.SysDictionaryDetail) (err error)
func (*DictionaryDetailService) DeleteSysDictionaryDetail ¶
func (dictionaryDetailService *DictionaryDetailService) DeleteSysDictionaryDetail(sysDictionaryDetail system.SysDictionaryDetail) (err error)
func (*DictionaryDetailService) GetDictionaryInfoByTypeValue ¶
func (dictionaryDetailService *DictionaryDetailService) GetDictionaryInfoByTypeValue(t string, value string) (detail system.SysDictionaryDetail, err error)
按照字典type+字典内容value获取单条字典内容
func (*DictionaryDetailService) GetDictionaryInfoByValue ¶
func (dictionaryDetailService *DictionaryDetailService) GetDictionaryInfoByValue(dictionaryID uint, value string) (detail system.SysDictionaryDetail, err error)
按照字典id+字典内容value获取单条字典内容
func (*DictionaryDetailService) GetDictionaryList ¶
func (dictionaryDetailService *DictionaryDetailService) GetDictionaryList(dictionaryID uint) (list []system.SysDictionaryDetail, err error)
按照字典id获取字典全部内容的方法
func (*DictionaryDetailService) GetDictionaryListByType ¶
func (dictionaryDetailService *DictionaryDetailService) GetDictionaryListByType(t string) (list []system.SysDictionaryDetail, err error)
按照字典type获取字典全部内容的方法
func (*DictionaryDetailService) GetSysDictionaryDetail ¶
func (dictionaryDetailService *DictionaryDetailService) GetSysDictionaryDetail(id uint) (sysDictionaryDetail system.SysDictionaryDetail, err error)
func (*DictionaryDetailService) GetSysDictionaryDetailInfoList ¶
func (dictionaryDetailService *DictionaryDetailService) GetSysDictionaryDetailInfoList(info request.SysDictionaryDetailSearch) (list interface{}, total int64, err error)
func (*DictionaryDetailService) UpdateSysDictionaryDetail ¶
func (dictionaryDetailService *DictionaryDetailService) UpdateSysDictionaryDetail(sysDictionaryDetail *system.SysDictionaryDetail) (err error)
type DictionaryService ¶
type DictionaryService struct{}
func (*DictionaryService) CreateSysDictionary ¶
func (dictionaryService *DictionaryService) CreateSysDictionary(sysDictionary system.SysDictionary) (err error)
func (*DictionaryService) DeleteSysDictionary ¶
func (dictionaryService *DictionaryService) DeleteSysDictionary(sysDictionary system.SysDictionary) (err error)
func (*DictionaryService) GetSysDictionary ¶
func (dictionaryService *DictionaryService) GetSysDictionary(Type string, Id uint, status *bool) (sysDictionary system.SysDictionary, err error)
func (*DictionaryService) GetSysDictionaryInfoList ¶
func (dictionaryService *DictionaryService) GetSysDictionaryInfoList() (list interface{}, err error)
func (*DictionaryService) UpdateSysDictionary ¶
func (dictionaryService *DictionaryService) UpdateSysDictionary(sysDictionary *system.SysDictionary) (err error)
type InitDBService ¶
type InitDBService struct{}
type JwtService ¶
type JwtService struct{}
func (*JwtService) GetRedisJWT ¶
func (jwtService *JwtService) GetRedisJWT(userName string) (redisJWT string, err error)
func (*JwtService) IsBlacklist ¶
func (jwtService *JwtService) IsBlacklist(jwt string) bool
func (*JwtService) JsonInBlacklist ¶
func (jwtService *JwtService) JsonInBlacklist(jwtList system.JwtBlacklist) (err error)
func (*JwtService) SetRedisJWT ¶
func (jwtService *JwtService) SetRedisJWT(jwt string, userName string) (err error)
type MenuService ¶
type MenuService struct{}
func (*MenuService) AddBaseMenu ¶
func (menuService *MenuService) AddBaseMenu(menu system.SysBaseMenu) error
func (*MenuService) AddMenuAuthority ¶
func (menuService *MenuService) AddMenuAuthority(menus []system.SysBaseMenu, adminAuthorityID, authorityId uint) (err error)
func (*MenuService) GetBaseMenuTree ¶
func (menuService *MenuService) GetBaseMenuTree(authorityID uint) (menus []system.SysBaseMenu, err error)
func (*MenuService) GetInfoList ¶
func (menuService *MenuService) GetInfoList(authorityID uint) (list interface{}, err error)
func (*MenuService) GetMenuAuthority ¶
func (menuService *MenuService) GetMenuAuthority(info *request.GetAuthorityId) (menus []system.SysMenu, err error)
func (*MenuService) GetMenuTree ¶
func (menuService *MenuService) GetMenuTree(authorityId uint) (menus []system.SysMenu, err error)
func (*MenuService) UserAuthorityDefaultRouter ¶
func (menuService *MenuService) UserAuthorityDefaultRouter(user *system.SysUser)
UserAuthorityDefaultRouter 用户角色默认路由检查
Author [SliverHorn](https://github.com/SliverHorn)
type MssqlInitHandler ¶
type MssqlInitHandler struct{}
func NewMssqlInitHandler ¶
func NewMssqlInitHandler() *MssqlInitHandler
func (MssqlInitHandler) EnsureDB ¶
func (h MssqlInitHandler) EnsureDB(ctx context.Context, conf *request.InitDB) (next context.Context, err error)
EnsureDB 创建数据库并初始化 mssql
func (MssqlInitHandler) InitData ¶
func (h MssqlInitHandler) InitData(ctx context.Context, inits initSlice) error
func (MssqlInitHandler) InitTables ¶
func (h MssqlInitHandler) InitTables(ctx context.Context, inits initSlice) error
func (MssqlInitHandler) WriteConfig ¶
func (h MssqlInitHandler) WriteConfig(ctx context.Context) error
WriteConfig mssql回写配置
type MysqlInitHandler ¶
type MysqlInitHandler struct{}
func NewMysqlInitHandler ¶
func NewMysqlInitHandler() *MysqlInitHandler
func (MysqlInitHandler) EnsureDB ¶
func (h MysqlInitHandler) EnsureDB(ctx context.Context, conf *request.InitDB) (next context.Context, err error)
EnsureDB 创建数据库并初始化 mysql
func (MysqlInitHandler) InitData ¶
func (h MysqlInitHandler) InitData(ctx context.Context, inits initSlice) error
func (MysqlInitHandler) InitTables ¶
func (h MysqlInitHandler) InitTables(ctx context.Context, inits initSlice) error
func (MysqlInitHandler) WriteConfig ¶
func (h MysqlInitHandler) WriteConfig(ctx context.Context) error
WriteConfig mysql回写配置
type OperationRecordService ¶
type OperationRecordService struct{}
func (*OperationRecordService) CreateSysOperationRecord ¶
func (operationRecordService *OperationRecordService) CreateSysOperationRecord(sysOperationRecord system.SysOperationRecord) (err error)
func (*OperationRecordService) DeleteSysOperationRecord ¶
func (operationRecordService *OperationRecordService) DeleteSysOperationRecord(sysOperationRecord system.SysOperationRecord) (err error)
func (*OperationRecordService) DeleteSysOperationRecordByIds ¶
func (operationRecordService *OperationRecordService) DeleteSysOperationRecordByIds(ids request.IdsReq) (err error)
func (*OperationRecordService) GetSysOperationRecord ¶
func (operationRecordService *OperationRecordService) GetSysOperationRecord(id uint) (sysOperationRecord system.SysOperationRecord, err error)
func (*OperationRecordService) GetSysOperationRecordInfoList ¶
func (operationRecordService *OperationRecordService) GetSysOperationRecordInfoList(info systemReq.SysOperationRecordSearch) (list interface{}, total int64, err error)
type PgsqlInitHandler ¶
type PgsqlInitHandler struct{}
func NewPgsqlInitHandler ¶
func NewPgsqlInitHandler() *PgsqlInitHandler
func (PgsqlInitHandler) EnsureDB ¶
func (h PgsqlInitHandler) EnsureDB(ctx context.Context, conf *request.InitDB) (next context.Context, err error)
EnsureDB 创建数据库并初始化 pg
func (PgsqlInitHandler) InitData ¶
func (h PgsqlInitHandler) InitData(ctx context.Context, inits initSlice) error
func (PgsqlInitHandler) InitTables ¶
func (h PgsqlInitHandler) InitTables(ctx context.Context, inits initSlice) error
func (PgsqlInitHandler) WriteConfig ¶
func (h PgsqlInitHandler) WriteConfig(ctx context.Context) error
WriteConfig pgsql 回写配置
type ServiceGroup ¶
type ServiceGroup struct { JwtService ApiService MenuService UserService CasbinService InitDBService AutoCodeService BaseMenuService AuthorityService DictionaryService SystemConfigService OperationRecordService DictionaryDetailService AuthorityBtnService SysExportTemplateService SysParamsService AutoCodePlugin autoCodePlugin AutoCodePackage autoCodePackage AutoCodeHistory autoCodeHistory AutoCodeTemplate autoCodeTemplate }
type SqliteInitHandler ¶
type SqliteInitHandler struct{}
func NewSqliteInitHandler ¶
func NewSqliteInitHandler() *SqliteInitHandler
func (SqliteInitHandler) EnsureDB ¶
func (h SqliteInitHandler) EnsureDB(ctx context.Context, conf *request.InitDB) (next context.Context, err error)
EnsureDB 创建数据库并初始化 sqlite
func (SqliteInitHandler) InitData ¶
func (h SqliteInitHandler) InitData(ctx context.Context, inits initSlice) error
func (SqliteInitHandler) InitTables ¶
func (h SqliteInitHandler) InitTables(ctx context.Context, inits initSlice) error
func (SqliteInitHandler) WriteConfig ¶
func (h SqliteInitHandler) WriteConfig(ctx context.Context) error
WriteConfig mysql回写配置
type SubInitializer ¶
type SubInitializer interface { InitializerName() string // 不一定代表单独一个表,所以改成了更宽泛的语义 MigrateTable(ctx context.Context) (next context.Context, err error) InitializeData(ctx context.Context) (next context.Context, err error) TableCreated(ctx context.Context) bool DataInserted(ctx context.Context) bool }
SubInitializer 提供 source/*/init() 使用的接口,每个 initializer 完成一个初始化过程
type SysExportTemplateService ¶
type SysExportTemplateService struct { }
func (*SysExportTemplateService) CreateSysExportTemplate ¶
func (sysExportTemplateService *SysExportTemplateService) CreateSysExportTemplate(sysExportTemplate *system.SysExportTemplate) (err error)
CreateSysExportTemplate 创建导出模板记录 Author [piexlmax](https://github.com/piexlmax)
func (*SysExportTemplateService) DeleteSysExportTemplate ¶
func (sysExportTemplateService *SysExportTemplateService) DeleteSysExportTemplate(sysExportTemplate system.SysExportTemplate) (err error)
DeleteSysExportTemplate 删除导出模板记录 Author [piexlmax](https://github.com/piexlmax)
func (*SysExportTemplateService) DeleteSysExportTemplateByIds ¶
func (sysExportTemplateService *SysExportTemplateService) DeleteSysExportTemplateByIds(ids request.IdsReq) (err error)
DeleteSysExportTemplateByIds 批量删除导出模板记录 Author [piexlmax](https://github.com/piexlmax)
func (*SysExportTemplateService) ExportExcel ¶
func (sysExportTemplateService *SysExportTemplateService) ExportExcel(templateID string, values url.Values) (file *bytes.Buffer, name string, err error)
ExportExcel 导出Excel Author [piexlmax](https://github.com/piexlmax)
func (*SysExportTemplateService) ExportTemplate ¶
func (sysExportTemplateService *SysExportTemplateService) ExportTemplate(templateID string) (file *bytes.Buffer, name string, err error)
ExportTemplate 导出Excel模板 Author [piexlmax](https://github.com/piexlmax)
func (*SysExportTemplateService) GetSysExportTemplate ¶
func (sysExportTemplateService *SysExportTemplateService) GetSysExportTemplate(id uint) (sysExportTemplate system.SysExportTemplate, err error)
GetSysExportTemplate 根据id获取导出模板记录 Author [piexlmax](https://github.com/piexlmax)
func (*SysExportTemplateService) GetSysExportTemplateInfoList ¶
func (sysExportTemplateService *SysExportTemplateService) GetSysExportTemplateInfoList(info systemReq.SysExportTemplateSearch) (list []system.SysExportTemplate, total int64, err error)
GetSysExportTemplateInfoList 分页获取导出模板记录 Author [piexlmax](https://github.com/piexlmax)
func (*SysExportTemplateService) ImportExcel ¶
func (sysExportTemplateService *SysExportTemplateService) ImportExcel(templateID string, file *multipart.FileHeader) (err error)
ImportExcel 导入Excel Author [piexlmax](https://github.com/piexlmax)
func (*SysExportTemplateService) UpdateSysExportTemplate ¶
func (sysExportTemplateService *SysExportTemplateService) UpdateSysExportTemplate(sysExportTemplate system.SysExportTemplate) (err error)
UpdateSysExportTemplate 更新导出模板记录 Author [piexlmax](https://github.com/piexlmax)
type SysParamsService ¶
type SysParamsService struct{}
func (*SysParamsService) CreateSysParams ¶
func (sysParamsService *SysParamsService) CreateSysParams(sysParams *system.SysParams) (err error)
CreateSysParams 创建参数记录 Author [Mr.奇淼](https://github.com/pixelmaxQm)
func (*SysParamsService) DeleteSysParams ¶
func (sysParamsService *SysParamsService) DeleteSysParams(ID string) (err error)
DeleteSysParams 删除参数记录 Author [Mr.奇淼](https://github.com/pixelmaxQm)
func (*SysParamsService) DeleteSysParamsByIds ¶
func (sysParamsService *SysParamsService) DeleteSysParamsByIds(IDs []string) (err error)
DeleteSysParamsByIds 批量删除参数记录 Author [Mr.奇淼](https://github.com/pixelmaxQm)
func (*SysParamsService) GetSysParam ¶
func (sysParamsService *SysParamsService) GetSysParam(key string) (param system.SysParams, err error)
GetSysParam 根据key获取参数value Author [Mr.奇淼](https://github.com/pixelmaxQm)
func (*SysParamsService) GetSysParams ¶
func (sysParamsService *SysParamsService) GetSysParams(ID string) (sysParams system.SysParams, err error)
GetSysParams 根据ID获取参数记录 Author [Mr.奇淼](https://github.com/pixelmaxQm)
func (*SysParamsService) GetSysParamsInfoList ¶
func (sysParamsService *SysParamsService) GetSysParamsInfoList(info systemReq.SysParamsSearch) (list []system.SysParams, total int64, err error)
GetSysParamsInfoList 分页获取参数记录 Author [Mr.奇淼](https://github.com/pixelmaxQm)
func (*SysParamsService) UpdateSysParams ¶
func (sysParamsService *SysParamsService) UpdateSysParams(sysParams system.SysParams) (err error)
UpdateSysParams 更新参数记录 Author [Mr.奇淼](https://github.com/pixelmaxQm)
type SystemConfigService ¶
type SystemConfigService struct{}
func (*SystemConfigService) GetServerInfo ¶
func (systemConfigService *SystemConfigService) GetServerInfo() (server *utils.Server, err error)
func (*SystemConfigService) GetSystemConfig ¶
func (systemConfigService *SystemConfigService) GetSystemConfig() (conf config.Server, err error)
func (*SystemConfigService) SetSystemConfig ¶
func (systemConfigService *SystemConfigService) SetSystemConfig(system system.System) (err error)
type TypedDBInitHandler ¶
type TypedDBInitHandler interface { EnsureDB(ctx context.Context, conf *request.InitDB) (context.Context, error) // 建库,失败属于 fatal error,因此让它 panic WriteConfig(ctx context.Context) error // 回写配置 InitTables(ctx context.Context, inits initSlice) error // 建表 handler InitData(ctx context.Context, inits initSlice) error // 建数据 handler }
TypedDBInitHandler 执行传入的 initializer
type UserService ¶
type UserService struct{}
func (*UserService) ChangePassword ¶
func (*UserService) DeleteUser ¶
func (userService *UserService) DeleteUser(id int) (err error)
func (*UserService) FindUserById ¶
func (userService *UserService) FindUserById(id int) (user *system.SysUser, err error)
func (*UserService) FindUserByUuid ¶
func (userService *UserService) FindUserByUuid(uuid string) (user *system.SysUser, err error)
func (*UserService) GetUserInfo ¶
func (userService *UserService) GetUserInfo(uuid uuid.UUID) (user system.SysUser, err error)
func (*UserService) GetUserInfoList ¶
func (userService *UserService) GetUserInfoList(info systemReq.GetUserList) (list interface{}, total int64, err error)
func (*UserService) ResetPassword ¶
func (userService *UserService) ResetPassword(ID uint) (err error)
func (*UserService) SetSelfInfo ¶
func (userService *UserService) SetSelfInfo(req system.SysUser) error
func (*UserService) SetSelfSetting ¶
func (userService *UserService) SetSelfSetting(req common.JSONMap, uid uint) error
func (*UserService) SetUserAuthorities ¶
func (userService *UserService) SetUserAuthorities(adminAuthorityID, id uint, authorityIds []uint) (err error)
func (*UserService) SetUserAuthority ¶
func (userService *UserService) SetUserAuthority(id uint, authorityId uint) (err error)
func (*UserService) SetUserInfo ¶
func (userService *UserService) SetUserInfo(req system.SysUser) error
Source Files ¶
- auto_code_history.go
- auto_code_package.go
- auto_code_plugin.go
- auto_code_template.go
- enter.go
- jwt_black_list.go
- sys_api.go
- sys_authority.go
- sys_authority_btn.go
- sys_auto_code_interface.go
- sys_auto_code_mssql.go
- sys_auto_code_mysql.go
- sys_auto_code_oracle.go
- sys_auto_code_pgsql.go
- sys_auto_code_sqlite.go
- sys_base_menu.go
- sys_casbin.go
- sys_dictionary.go
- sys_dictionary_detail.go
- sys_export_template.go
- sys_initdb.go
- sys_initdb_mssql.go
- sys_initdb_mysql.go
- sys_initdb_pgsql.go
- sys_initdb_sqlite.go
- sys_menu.go
- sys_operation_record.go
- sys_params.go
- sys_system.go
- sys_user.go