interfaces

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Codec

type Codec interface {
	Encoder
	Decoder
}

Codec 解编码器

type DBFacade added in v1.0.2

type DBFacade[T interface{}] interface {
	All(scopes ...GormApplyQuery) ([]*T, error)                                        //查询所有
	Search(pa *paginate.Pager, apply ...GormApplyQuery) ([]*T, *paginate.Pager, error) //分页查询
	Query(id int64) (*T, error)                                                        //查询指定id的单条记录
	Add(T) (int64, error)                                                              //添加记录
	Update(id int64, up T) (int64, error)                                              //更新记录
	Delete(id int64) (int64, error)                                                    //删除记录
	SetStatus(id int64, status int) (int64, error)                                     //重置status

	QueryByScope(apply ...GormApplyQuery) (*T, error) //自定义scope查询单条记录
	DeleteByScope(scopes ...GormApplyQuery) (int64, error)

	UseDB(db *gorm.DB) DBFacade[T] //使用db

	ItfMigrate
	ItfGormDB
}

type Decoder

type Decoder interface {
	Unmarshal(data []byte, v interface{}) error
}

Decoder 解码器

type Encoder

type Encoder interface {
	// Marshal returns the wire format of v.
	Marshal(v interface{}) ([]byte, error)
}

Encoder 编码器

type GormApplyQuery added in v1.0.2

type GormApplyQuery func(*gorm.DB) *gorm.DB

type IWebsocketWorker added in v1.0.2

type IWebsocketWorker interface {
	Name() string
	Receive(cmd *cmddata.ClientCmd) //接收消息处理

	Online(client *wsserver.Client) //client 上线
	Close(client *wsserver.Client)  //client close

	//NeedAccredit 是否需要授权检查
	NeedAccredit(client *wsserver.Client) bool
}

type ItfAccreditController

type ItfAccreditController interface {
	AccreditInfo(ctx *gin.Context) //权限信息

	CheckAccreditHandler() gin.HandlerFunc //权限检查校验的handler
	Permissions() []*dto.PermissionItem
}

type ItfAdminAuthController added in v1.0.2

type ItfAdminAuthController interface {
	ItfAuthController
}

ItfAdminAuthController 管理站授权模块

type ItfAdminCenterController added in v1.0.2

type ItfAdminCenterController ItfUserCenterController

type ItfAdminDao added in v1.0.2

type ItfAdminDao interface {
	Search(search *dto.SearchAdminParams, pa *paginate.Pager) ([]*models.Admin, *paginate.Pager, error)
	Query(id int64) (*models.Admin, error)
	QueryByAccount(string) (*models.Admin, error)
	QueryPassword(id int64) (string, string, error)
	Add(*models.Admin) (int64, error)
	AddCheckAccount(*models.Admin) (int64, error)
	Update(id int64, admin *models.Admin) (int64, error)
	Delete(id int64) (int64, error)

	SetStatus(id int64, status int) (int64, error)
	ResetPassword(id int64, password string, noRoot bool) (int64, error)
	UpdateProInfo(id int64, admin *models.Admin) (int64, error)

	LoginNote(id int64, info *dto.LoginInfoParam) (int64, error) //登录记录

	Use(db *gorm.DB) ItfAdminDao //使用db

	ItfMigrate
	ItfGormDB
}

type ItfAdminLog

type ItfAdminLog interface {
	Search(search *dto.SearchAdminLogParams, p *paginate.Pager) ([]*models.AdminLog, *paginate.Pager, error)
	Add(log *models.AdminLog) (int64, error)

	Use(db *gorm.DB) ItfAdminLog

	ItfMigrate
	ItfGormDB
}

type ItfAdminLogController

type ItfAdminLogController interface {
	SearchAdminLog(ctx *gin.Context)

	LogHandler() gin.HandlerFunc //日志记录的handler
}

ItfAdminLogController 管理员日志管理

type ItfAdminManageController

type ItfAdminManageController interface {
	SearchAdmin(ctx *gin.Context)
	QueryAdmin(ctx *gin.Context)
	SaveAdmin(ctx *gin.Context)
	DisableAdmin(ctx *gin.Context)
	DeleteAdmin(ctx *gin.Context)
}

ItfAdminManageController 管理员管理

type ItfAdminService added in v1.0.1

type ItfAdminService interface {
	ValidatePassword(adminId int64, password string) (bool, error)          //验证密码是否正确
	AutoCreateAdmin(nickname string, account string, password string) error //自动创建超级管理员

	Search(search *dto.SearchAdminParams, pa *paginate.Pager) ([]*models.Admin, *paginate.Pager, error)

	SetStatus(id int64, status int) (int64, error)
	ResetPassword(id int64, password string) (int64, error)
	ResetRootPassword(id int64, password string) (int64, error)
	UpdateProInfo(id int64, profile *dto.UpdateProfileParams) (int64, error)
}

type ItfApiServer

type ItfApiServer interface {
	Start() error
	Stop() error
}

ItfApiServer api服务

type ItfApp

type ItfApp interface {
	Name() string //app名称

	//Start 开始
	//处理上视为非异步处理
	Start() error

	//Stop 停止,视为同步阻塞处理
	Stop() error
}

type ItfAppInitialize added in v1.0.4

type ItfAppInitialize interface {
	Initialize()
}

ItfAppInitialize app初始化支持

type ItfAppModule added in v1.0.4

type ItfAppModule interface {
	WithModule(t bool)
}

ItfAppModule 支持模块服务

type ItfAppName added in v1.0.4

type ItfAppName interface {
	Name() string
}

ItfAppName app带名称

type ItfAuthController

type ItfAuthController interface {
	AuthLogin(ctx *gin.Context)  //登录
	AuthLogout(ctx *gin.Context) //登出

	AuthCheck(ctx *gin.Context)      //校验登录状态
	AuthInfo(ctx *gin.Context)       //获取认证信息
	AuthFreshToken(ctx *gin.Context) //token刷新
}

ItfAuthController 通用授权模块

type ItfAuthService

type ItfAuthService interface {
	DoAuth(*dto.AccountLoginParams) (*dto.AuthInfo, error)
}

type ItfBaseDataController

type ItfBaseDataController interface {
	Regions(ctx *gin.Context)
}

ItfBaseDataController 基本数据

type ItfBlockContentController added in v1.0.2

type ItfBlockContentController interface {
	SearchBlock(ctx *gin.Context)
	QueryBlock(ctx *gin.Context)
	SaveBlock(ctx *gin.Context)
	DeleteBlock(ctx *gin.Context)
	DisableBlock(ctx *gin.Context)
}

ItfBlockContentController 块内容控制器

type ItfBlockContentDao added in v1.0.2

type ItfBlockContentDao interface {
	Search(search *dto.SearchBlockContentParams, pa *paginate.Pager) ([]*models.BlockContent, *paginate.Pager, error)
	Query(id int64) (*models.BlockContent, error)
	QueryByCode(code string) (*models.BlockContent, error)
	Add(code *models.BlockContent) (int64, error)
	Update(id int64, up *models.BlockContent) (int64, error)
	Delete(id int64) (int64, error)

	Use(db *gorm.DB) ItfBlockContentDao //使用db

	ItfMigrate
	ItfGormDB
}

ItfBlockContentDao 块内容操作接口

type ItfBlockContentService added in v1.0.2

type ItfBlockContentService interface {
	Search(search *dto.SearchBlockContentParams, pa *paginate.Pager) ([]*models.BlockContent, *paginate.Pager, error)
	QueryByCode(code string) (*models.BlockContent, error)
	Query(id int64, code string) (*models.BlockContent, error)
	Save(id int64, b *models.BlockContent) (int64, error)
	GetFromCache(code string) (*models.BlockContent, error)
	Delete(id int64) (int64, error)
}

ItfBlockContentService 块内容service

type ItfCaptchaController

type ItfCaptchaController interface {
	GetCaptcha(ctx *gin.Context)
	VerifyCaptcha(ctx *gin.Context)

	VerifyHandler() gin.HandlerFunc //验证handler,用于中间件
}

ItfCaptchaController 图片验证码相关

type ItfCmsArticleDao added in v1.0.4

type ItfCmsArticleDao interface {
	Search(search *dto.SearchCmsArticleParams, pa *paginate.Pager) ([]*models.CmsArticle, *paginate.Pager, error)
	Query(id int64) (*models.CmsArticle, error)
	Add(code *models.CmsArticle) (int64, error)
	Update(id int64, up *models.CmsArticle) (int64, error)
	Delete(id int64) (int64, error)
	SetStatus(id int64, status int) (int64, error)
	SetSort(id int64, sort int) (int64, error)

	Use(db *gorm.DB) ItfCmsArticleDao //使用db

	ItfMigrate
	ItfGormDB
}

ItfCmsArticleDao cms专栏操作dao

type ItfCmsArticleModelController added in v1.0.4

type ItfCmsArticleModelController interface {
	Disable(ctx *gin.Context)
	// contains filtered or unexported methods
}

ItfCmsArticleModelController 文章模型控制器

type ItfCmsArticleModelService added in v1.0.4

type ItfCmsArticleModelService interface {
	Search(search *dto.SearchCmsArticleParams, pa *paginate.Pager) ([]*respdata.CmsArticleListRespItem, *paginate.Pager, error)
	Query(id int64) (*respdata.CmsArticleDetailResp, error)
	Save(id int64, b *reqdata.AddEditCmsArticleReq) (int64, error)
	Create(b *reqdata.AddEditCmsArticleReq) (int64, error)
	Update(id int64, b *reqdata.AddEditCmsArticleReq) (int64, error)
	Delete(id int64) (int64, error)
	SetStatus(id int64, status int) (int64, error)
}

ItfCmsArticleModelService cms文章模型service

type ItfCmsColumnController added in v1.0.4

type ItfCmsColumnController interface {
	SearchColumn(ctx *gin.Context)
	QueryColumn(ctx *gin.Context)
	SaveColumn(ctx *gin.Context)
	DeleteColumn(ctx *gin.Context)
	DisableColumn(ctx *gin.Context)
}

ItfCmsColumnController cms专栏控制器

type ItfCmsColumnDao added in v1.0.4

type ItfCmsColumnDao interface {
	Search(search *dto.SearchCmsColumnParams, pa *paginate.Pager) ([]*models.CmsColumn, *paginate.Pager, error)
	Query(id int64) (*models.CmsColumn, error)
	Add(code *models.CmsColumn) (int64, error)
	Update(id int64, up *models.CmsColumn) (int64, error)
	Delete(id int64) (int64, error)
	SetStatus(id int64, status int) (int64, error)
	SetSort(id int64, sort int) (int64, error)

	Use(db *gorm.DB) ItfCmsColumnDao //使用db

	ItfMigrate
	ItfGormDB
}

ItfCmsColumnDao cms专栏操作dao

type ItfCmsColumnService added in v1.0.4

type ItfCmsColumnService interface {
	Search(search *dto.SearchCmsColumnParams, pa *paginate.Pager) ([]*respdata.CmsColumnListRespItem, *paginate.Pager, error)
	Query(id int64) (*respdata.CmsColumnDetailResp, error)
	Save(id int64, b *reqdata.AddEditCmsColumnReq) (int64, error)
	Create(b *reqdata.AddEditCmsColumnReq) (int64, error)
	Update(id int64, b *reqdata.AddEditCmsColumnReq) (int64, error)
	Delete(id int64) (int64, error)
	SetStatus(id int64, status int) (int64, error)
}

ItfCmsColumnService 专栏services

type ItfCmsPageModelController added in v1.0.4

type ItfCmsPageModelController interface {
	Query(ctx *gin.Context)
	Save(ctx *gin.Context)
	Delete(ctx *gin.Context)
}

ItfCmsPageModelController 单页模型

type ItfCmsProductDao added in v1.0.4

type ItfCmsProductDao interface {
	Search(search *dto.SearchCmsProductParams, pa *paginate.Pager) ([]*models.CmsProduct, *paginate.Pager, error)
	Query(id int64) (*models.CmsProduct, error)
	Add(code *models.CmsProduct) (int64, error)
	Update(id int64, up *models.CmsProduct) (int64, error)
	Delete(id int64) (int64, error)
	SetStatus(id int64, status int) (int64, error)
	SetSort(id int64, sort int) (int64, error)

	Use(db *gorm.DB) ItfCmsProductDao //使用db

	ItfMigrate
	ItfGormDB
}

ItfCmsProductDao cms产品操作dao

type ItfCmsProductModelController added in v1.0.4

type ItfCmsProductModelController interface {
	Disable(ctx *gin.Context)
	// contains filtered or unexported methods
}

ItfCmsProductModelController 产品模型控制器

type ItfCmsProductModelService added in v1.0.4

type ItfCmsProductModelService interface {
	Search(search *dto.SearchCmsProductParams, pa *paginate.Pager) ([]*respdata.CmsProductListRespItem, *paginate.Pager, error)
	Query(id int64) (*respdata.CmsProductDetailResp, error)
	Save(id int64, b *reqdata.AddEditCmsProductReq) (int64, error)
	Create(b *reqdata.AddEditCmsProductReq) (int64, error)
	Update(id int64, b *reqdata.AddEditCmsProductReq) (int64, error)
	Delete(id int64) (int64, error)
	SetStatus(id int64, status int) (int64, error)
}

ItfCmsProductModelService cms产品模型service

type ItfDistributeLocker

type ItfDistributeLocker interface {
	Lock(key string, ttl int64) (bool, error) //加锁
	Release(key string) error                 //释放锁

	Delay(key string, ttl int64) error //延迟锁,对锁进行续期延长
	TTL(key string) (int64, error)     //锁剩余时间
}

ItfDistributeLocker 分布式锁接口

type ItfFullApp added in v1.0.4

type ItfFullApp interface {
	ItfApp
	ItfAppInitialize
	ItfAppModule
}

ItfFullApp 一个完备的app需要的接口

type ItfGinApiServer

type ItfGinApiServer interface {
	ItfApiServer

	InitRouterForGin(engine *gin.Engine)
}

type ItfGormDB

type ItfGormDB interface {
	DB() *gorm.DB
}

type ItfIotDeviceController added in v1.0.4

type ItfIotDeviceController interface {
	Disable(ctx *gin.Context)
	// contains filtered or unexported methods
}

ItfIotDeviceController iot设备管理

type ItfIotDeviceDao added in v1.0.4

type ItfIotDeviceDao interface {
	Search(search *dto.SearchIotDeviceParams, pa *paginate.Pager) ([]*models.IotDevice, *paginate.Pager, error)
	Query(id int64) (*models.IotDevice, error)
	Add(code *models.IotDevice) (int64, error)
	Update(id int64, up *models.IotDevice) (int64, error)
	Delete(id int64) (int64, error)
	SetStatus(id int64, status int) (int64, error)
	SetSort(id int64, sort int) (int64, error)

	Use(db *gorm.DB) ItfIotDeviceDao //使用db

	ItfMigrate
	ItfGormDB
}

ItfIotDeviceDao iot设备操作dao

type ItfIotDeviceService added in v1.0.4

type ItfIotDeviceService interface {
	Search(search *dto.SearchIotDeviceParams, pa *paginate.Pager) ([]*respdata.IotDeviceListRespItem, *paginate.Pager, error)
	Query(id int64) (*respdata.IotDeviceDetailResp, error)
	Save(id int64, b *reqdata.AddEditIotDeviceReq) (int64, error)
	Create(b *reqdata.AddEditIotDeviceReq) (int64, error)
	Update(id int64, b *reqdata.AddEditIotDeviceReq) (int64, error)
	Delete(id int64) (int64, error)
	SetStatus(id int64, status int) (int64, error)
}

ItfIotDeviceService iot设备service

type ItfIotProductController added in v1.0.4

type ItfIotProductController interface {
	Disable(ctx *gin.Context)
	QueryThinModel(ctx *gin.Context)  //物模型查询
	ImportThinModel(ctx *gin.Context) //物模型导入
	// contains filtered or unexported methods
}

ItfIotProductController iot产品管理

type ItfIotProductDao added in v1.0.4

type ItfIotProductDao interface {
	Search(search *dto.SearchIotProductParams, pa *paginate.Pager) ([]*models.IotProduct, *paginate.Pager, error)
	Query(id int64) (*models.IotProduct, error)
	Add(code *models.IotProduct) (int64, error)
	Update(id int64, up *models.IotProduct) (int64, error)
	Delete(id int64) (int64, error)
	SetStatus(id int64, status int) (int64, error)
	SetSort(id int64, sort int) (int64, error)

	Use(db *gorm.DB) ItfIotProductDao //使用db

	ItfMigrate
	ItfGormDB
}

ItfIotProductDao iot产品操作dao

type ItfIotProductService added in v1.0.4

type ItfIotProductService interface {
	Search(search *dto.SearchIotProductParams, pa *paginate.Pager) ([]*respdata.IotProductListRespItem, *paginate.Pager, error)
	Query(id int64) (*respdata.IotProductDetailResp, error)
	Save(id int64, b *reqdata.AddEditIotProductReq) (int64, error)
	Create(b *reqdata.AddEditIotProductReq) (int64, error)
	Update(id int64, b *reqdata.AddEditIotProductReq) (int64, error)
	Delete(id int64) (int64, error)
	SetStatus(id int64, status int) (int64, error)
}

ItfIotProductService iot产品service

type ItfJobController added in v1.0.2

type ItfJobController interface {
	RegJobs(ctx *gin.Context) //已注册jobs

	RunningJobs(ctx *gin.Context) //运行中jobs

}

type ItfJwtParser

type ItfJwtParser interface {
	GetToken(data interface{}) (string, error)
	ParseToken(data interface{}, token string) error
}

type ItfMetricDataDao added in v1.0.2

type ItfMetricDataDao interface {
	Search(search *dto.SearchMetricDataDto, pa *paginate.Pager) ([]*models.MetricData, *paginate.Pager, error)
	Query(metricId int64, timestamp int64) (*models.MetricData, error)
	QuerySum(req *dto.SearchMetricDataDto) (*models.MetricValueData, error)
	Add(data *models.MetricData) (int64, error)
	BatchAdd(...*models.MetricData) (int64, error)
	Delete(metricId int64, timestamp int64) (int64, error)
	Clean(dataDto dto.CleanMetricDataDto) (int64, error)
	CleanAll(dataDto dto.CleanMetricDataDto) (int64, error)

	Use(db *gorm.DB) ItfMetricDataDao //使用db

	InitTable(string) error
	InitSplitTable(string) error

	ItfMigrate
	ItfGormDB
}

ItfMetricDataDao 组织相关

type ItfMetricDataService added in v1.0.2

type ItfMetricDataService interface {
	QueryLatestData(metricId int64) (*models.MetricData, error)                                                        //查询点位的最新数据
	SearchHistoryData(req *dto.SearchMetricDataDto, pa *paginate.Pager) ([]*models.MetricData, *paginate.Pager, error) //搜索历史测点数据
	QuerySumData(req *dto.SearchMetricDataDto) (*models.MetricValueData, error)                                        // 对指定历史数据条件的求和数据获取
	WriteData(...*models.MetricData) (int64, error)                                                                    //写入一个测点(覆盖)

	SearchStatData(req *dto.SearchMetricStatDto, pa *paginate.Pager) ([]*models.MetricStatValueData, *paginate.Pager, error) //搜索统计测点数据
	QueryStatData(req *dto.QueryMetricStatDto) (*models.MetricStatValueData, error)                                          //查询一个统计数据
	QueryStatSumData(req *dto.SearchMetricStatDto) (*models.MetricValueData, error)                                          // 对指定stat条件的求和数据获取
	WriteStat(data []*models.MetricStatData, merge bool) (int64, error)                                                      //写入一个统计数据(合并)
}

ItfMetricDataService metric数据service

type ItfMetricLatestDataDao added in v1.0.2

type ItfMetricLatestDataDao interface {
	Query(metricId int64) (*models.MetricData, error)
	Add(data *models.MetricData) (int64, error)
	BatchAdd(...*models.MetricData) (int64, error)

	Use(db *gorm.DB) ItfMetricLatestDataDao //使用db

	ItfMigrate
	ItfGormDB
}

ItfMetricLatestDataDao 组织相关

type ItfMetricMetaDao added in v1.0.2

type ItfMetricMetaDao interface {
	Search(search *dto.SearchMetricMetaDto, pa *paginate.Pager) ([]*models.Metrics, *paginate.Pager, error)
	Query(id int64) (*models.Metrics, error)
	QueryByName(name string) (*models.Metrics, error)
	Add(data *models.Metrics) (int64, error)
	Delete(id int64) (int64, error)

	Use(db *gorm.DB) ItfMetricMetaDao //使用db

	SubTableStrategy() func(int64) string //分表策略

	ItfMigrate
	ItfGormDB
}

ItfMetricMetaDao 组织相关

type ItfMetricService added in v1.0.2

type ItfMetricService interface {
	CheckCreateMetric(add *models.Metrics) (int64, error)     //检查创建metric
	CreateMetric(*models.Metrics) (int64, error)              //初始化一个测点的表
	QueryMetric(metricId int64) (*models.Metrics, error)      //查询某个测点信息
	QueryMetricByName(string string) (*models.Metrics, error) //查询某个测点信息
	NameByKeys(keys ...string) string                         //多个key生成key
}

ItfMetricService metric service

type ItfMetricStatDataDao added in v1.0.2

type ItfMetricStatDataDao interface {
	Search(search *dto.SearchMetricStatDto, pa *paginate.Pager) ([]*models.MetricStatValueData, *paginate.Pager, error)
	Query(*dto.QueryMetricStatDto) (*models.MetricStatValueData, error)
	QuerySum(search *dto.SearchMetricStatDto) (*models.MetricValueData, error) //查询求和
	MergeAdd(...*models.MetricStatData) (int64, error)                         //合并添加
	CoverAdd(...*models.MetricStatData) (int64, error)                         //覆盖添加

	Use(db *gorm.DB) ItfMetricStatDataDao //使用db

	InitSplitTable(string) error

	ItfMigrate
	ItfGormDB
}

ItfMetricStatDataDao 组织相关

type ItfMigrate

type ItfMigrate interface {
	Migrate() (int64, error)
}

type ItfOptimisticLock

type ItfOptimisticLock interface {
	Lock(name string) bool
	UnLock(name string) bool
}

ItfOptimisticLock 乐观锁实现

type ItfOrganize

type ItfOrganize interface {
	DBFacade[models.Organize]

	Delete(id int64) (int64, error)
	DeleteByPid(pid int64) (int64, error)
	SetStatus(id int64, status int) (int64, error)

	Use(db *gorm.DB) ItfOrganize //使用db

	ItfMigrate
	ItfGormDB
}

ItfOrganize 组织相关

type ItfOrganizeExtra added in v1.0.2

type ItfOrganizeExtra interface {
	Search(orgId int64) ([]*models.OrganizeExtra, error)
	Add(models.OrganizeExtra) (int64, error)
	Clear(orgId int64) (int64, error)

	Use(db *gorm.DB) ItfOrganizeExtra //使用db

	ItfMigrate
	ItfGormDB
}

ItfOrganizeExtra 组织额外信息相关

type ItfOrganizeManageController added in v1.0.2

type ItfOrganizeManageController interface {
	SearchOrganize(ctx *gin.Context)  //组织列表
	TreeOrganize(ctx *gin.Context)    //组织树返回
	QueryOrganize(ctx *gin.Context)   //查询详情
	SaveOrganize(ctx *gin.Context)    //保存组织
	DisableOrganize(ctx *gin.Context) //启用/禁用组织
	DeleteOrganize(ctx *gin.Context)  //删除组织
}

type ItfOrganizeRelate added in v1.0.2

type ItfOrganizeRelate interface {
	DBFacade[models.OrganizeRelate]

	SearchParent(orgId int64, level int) ([]*models.OrganizeRelate, error)
	SearchChild(orgId int64, level int) ([]*models.OrganizeRelate, error)
	Add(models.OrganizeRelate) (int64, error)
	Clear(orgId int64) (int64, error)

	SqlForSearchChild(pid int64, level int) string

	Use(db *gorm.DB) ItfOrganizeRelate //使用db

	ItfMigrate
	ItfGormDB
}

ItfOrganizeRelate 组织关系相关

type ItfOrganizeService added in v1.0.2

type ItfOrganizeService interface {
	Search(search dto.SearchOrganizeParams, pa *paginate.Pager) ([]*respdata.OrganizeListItem, *paginate.Pager, error)
	Tree(search dto.TreeOrganizeParams) ([]*dto.TreeNode[*models.Organize], error)

	Query(id int64) (*respdata.OrganizeDetail, error)
	Add(add models.Organize) (int64, error)
	Update(id int64, up models.Organize) (int64, error)
	Delete(id int64) (int64, error)
	Enable(id int64, status int) (int64, error) //
}

type ItfOssController added in v1.0.2

type ItfOssController interface {
	DoUpload(ctx *gin.Context)  //上传操作
	ConfigOss(ctx *gin.Context) //配置oss
}

type ItfRbac

type ItfRbac interface {
	UserRoles(uid int64) ([]*models.RbacRole, error)
	UserPerms(uid int64) ([]*models.RbacPermission, error)
	UserPermIds(uid int64) ([]int64, error)

	//用户关联角色
	UserRoleIds(uid int64) ([]int64, error)
	UserRelateRoles(uid int64, roleIds []int64) error

	//角色相关
	SearchRoles(search *dto.SearchRbacRoleParams, pa *paginate.Pager) ([]*models.RbacRole, *paginate.Pager, error)
	Roles() ([]*models.RbacRole, error)
	QueryRole(id int64) (*models.RbacRole, error)
	AddRole(*models.RbacRole) (int64, error)
	UpdateRole(int64, *models.RbacRole) (int64, error)
	DeleteRole(id int64) error
	ResetRoleStatus(id int64, status int) (int64, error)

	//角色关联权限
	RolePermIds(roleId int64, moreRoles ...int64) ([]int64, error)
	RoleRelatePerms(roleId int64, permIds []int64) error

	//权限相关
	Perms() ([]*models.RbacPermission, error)
	QueryPerm(id int64) (*models.RbacPermission, error)
	AddPerm(*models.RbacPermission) (int64, error)
	BatchAddPerm(...*models.RbacPermission) (int64, error)
	UpdatePerm(int64, *models.RbacPermission) (int64, error)
	DeletePerm(id int64) error

	//simple相关
	SimplePerms() ([]*dto.RbacPermissionSimple, error)

	Use(db *gorm.DB) ItfRbac //使用db

	ItfMigrate
	ItfGormDB
}

type ItfRbacManageController

type ItfRbacManageController interface {
	//用户与角色绑定关系维护
	SearchUserRoles(ctx *gin.Context) //用户绑定roles列表搜索
	BindUserRoles(ctx *gin.Context)   //用户绑定roles操作

	//角色管理
	SearchRoles(ctx *gin.Context)
	SimpleRoles(ctx *gin.Context)
	QueryRole(ctx *gin.Context)
	SaveRole(ctx *gin.Context)
	DisableRole(ctx *gin.Context)
	DeleteRole(ctx *gin.Context)

	//角色和权限绑定关系维护
	SearchRolePermissions(ctx *gin.Context)
	SaveRolePermissions(ctx *gin.Context)

	//权限管理
	SearchPermissions(ctx *gin.Context)
	DeletePermission(ctx *gin.Context)
	SavePermission(ctx *gin.Context)
}

ItfRbacManageController RBAC管理

type ItfRbacRole

type ItfRbacRole interface {
	Search(search *dto.SearchRbacRoleParams, pa *paginate.Pager) ([]*models.RbacRole, *paginate.Pager, error)
	Query(id int64) (*models.RbacRole, error)
	Add(*models.RbacRole) (int64, error)
	Update(int64, *models.RbacRole) (int64, error)
	Delete(id int64) error
	SetStatus(id int64, status int) (int64, error)

	Use(db *gorm.DB) ItfRbacRole //使用db

	ItfMigrate
	ItfGormDB
}

ItfRbacRole 角色相关

type ItfRegionDistrict added in v1.0.2

type ItfRegionDistrict interface {
	Query(code string) (dto.RegionItem, error)
	Districts(code string) ([]dto.RegionItem, error)
}

type ItfResponseController

type ItfResponseController interface {
	Response(ctx *gin.Context, data respdata.ResponseData, msgData ...map[string]string)
	ResponseCode(ctx *gin.Context, code int, data respdata.ResponseData, msgData ...map[string]string)
}

type ItfRichContentController added in v1.0.4

type ItfRichContentController interface {
	Content(ctx *gin.Context) //供外部查询内容
	// contains filtered or unexported methods
}

ItfRichContentController 富文本内容控制器

type ItfRichContentDao added in v1.0.4

type ItfRichContentDao interface {
	Search(search *dto.SearchRichContentParams, pa *paginate.Pager) ([]*models.RichContent, *paginate.Pager, error)
	Query(id int64) (*models.RichContent, error)
	Add(code *models.RichContent) (int64, error)
	Update(id int64, up *models.RichContent) (int64, error)
	Delete(id int64) (int64, error)

	Use(db *gorm.DB) ItfRichContentDao //使用db

	ItfMigrate
	ItfGormDB
}

ItfRichContentDao cms内容dao

type ItfRichContentService added in v1.0.4

ItfRichContentService 富文本内容service

type ItfRssController added in v1.0.3

type ItfRssController interface {
	RssCacheItems(ctx *gin.Context)
}

type ItfRssManageController added in v1.0.3

type ItfRssManageController interface {
	RssSourceList(ctx *gin.Context)  //rss源列表
	RssSourceItems(ctx *gin.Context) //rss内容列表
}

type ItfServer added in v1.0.4

type ItfServer ItfApiServer

type ItfSettingController added in v1.0.2

type ItfSettingController interface {
	GetSetting(ctx *gin.Context)
	PutSetting(ctx *gin.Context)
	GetMultiSetting(ctx *gin.Context)
	PutMultiSetting(ctx *gin.Context)
}

type ItfSettingDao added in v1.0.2

type ItfSettingDao interface {
	Set(key, value string) error
	Get(key string) (string, error)

	SetMulti(data map[string]string) error
	GetMulti(keys ...string) (map[string]string, error)

	Use(db *gorm.DB) ItfSettingDao

	ItfMigrate
	ItfGormDB
}

type ItfSettingService added in v1.0.2

type ItfSettingService interface {
	Set(key, value string) error
	Get(key string) (string, error)

	SetMulti(data map[string]string) error
	GetMulti(keys ...string) (map[string]string, error)

	GetFromCache(key string) (string, error)
	GetMultiFromCache(keys ...string) (map[string]string, error)
}

type ItfSplitTableModel added in v1.0.2

type ItfSplitTableModel interface {
	TableName() string
	SplitTableName(key string) string
}

type ItfStatistical

type ItfStatistical interface {
	Search(search *dto.SearchStatisticalParams, pa *paginate.Pager) ([]*models.Statistical, *paginate.Pager, error)
	Query(search *dto.SearchStatisticalParams) (*models.Statistical, error)
	Add(st *models.Statistical) (int64, error)
	Delete(id int64) (int64, error)
	DeleteByName(name, date string) (int64, error)

	Use(db *gorm.DB) ItfStatistical //使用db

	ItfMigrate
	ItfGormDB
}

ItfStatistical 统计相关

type ItfSubTableStrategy added in v1.0.2

type ItfSubTableStrategy interface {
	SetSplitStrategyById(f1 func(int64) string)
	SetSplitStrategyByKey(f1 func(string) string)
}

ItfSubTableStrategy 分表策略

type ItfTelemetryController added in v1.0.2

type ItfTelemetryController interface {
	GetLatest(ctx *gin.Context)
	SearchHistory(ctx *gin.Context)
	SearchStats(ctx *gin.Context)
}

ItfTelemetryController 遥测api控制器

type ItfTelemetryService added in v1.0.2

type ItfTelemetryService interface {
	ItfMetricService
	ItfMetricDataService
}

ItfTelemetryService telemetry遥测service

type ItfTreeNode added in v1.0.2

type ItfTreeNode interface {
	NodeId() string
	NodeName() string
	NodePid() string //空字符串代表根节点
}

type ItfUser

type ItfUser interface {
	Search(search *dto.SearchUserParams, pa *paginate.Pager) ([]*models.User, *paginate.Pager, error)
	Query(id int64) (*models.User, error)
	QueryByAccount(string) (*models.User, error)
	QueryByPhone(string) (*models.User, error)
	QueryByEmail(string) (*models.User, error)
	Add(*models.User) (int64, error)
	AddCheckAccount(u *models.User) (int64, error)
	Update(id int64, user *models.User) (int64, error)
	Delete(id int64) (int64, error)

	LoginNote(id int64, info *dto.LoginInfoParam) (int64, error) //登录记录

	SetStatus(id int64, status int) (int64, error)
	ResetPassword(id int64, password string) (int64, error)
	UpdateProInfo(id int64, user *models.User) (int64, error)

	Use(db *gorm.DB) ItfUser //使用db

	ItfMigrate
	ItfGormDB
}

type ItfUserAccount

type ItfUserAccount interface {
	QueryByAccount(string) (*models.UserAccount, error)
	Add(*models.UserAccount) (int64, error)
	Delete(id int64) (int64, error)

	Use(db *gorm.DB) ItfUserAccount //使用db

	ItfMigrate
	ItfGormDB
}

type ItfUserAuthController

type ItfUserAuthController interface {
	ItfAuthController

	SignUp(ctx *gin.Context)       //注册
	AuthByWxCode(ctx *gin.Context) //微信登录
	AuthByQQ(ctx *gin.Context)     //QQ登录

	//debug用
	DebugAuthByThird(ctx *gin.Context)
}

ItfUserAuthController 用户授权模块

type ItfUserCenterController

type ItfUserCenterController interface {
	UserInfo(ctx *gin.Context)       //用户信息(比 AuthController的 AuthInfo 信息更多)
	ResetPassword(ctx *gin.Context)  //重置密码
	BindEmailPhone(ctx *gin.Context) //绑定邮箱
	LoginRecord(ctx *gin.Context)    //登录记录
	ModifyInfo(ctx *gin.Context)     //修改个人信息
	ModifyPassword(ctx *gin.Context) //修改密码
}

ItfUserCenterController 用户中心模块

type ItfUserGenericRecord

type ItfUserGenericRecord interface {
	Search(search *dto.SearchGenericRecordParams, pa *paginate.Pager) ([]*models.UserGenericRecord, *paginate.Pager, error)
	Add(code *models.UserGenericRecord) (int64, error)
	Delete(id int64) (int64, error)

	Use(db *gorm.DB) ItfUserGenericRecord //使用db

	ItfMigrate
	ItfGormDB
}

ItfUserGenericRecord 用户通用记录

type ItfUserLoginRecord

type ItfUserLoginRecord interface {
	Search(search *dto.SearchLoginRecordParams, pa *paginate.Pager) ([]*models.UserLoginRecord, *paginate.Pager, error)
	Add(code *models.UserLoginRecord) (int64, error)

	Use(db *gorm.DB) ItfUserLoginRecord //使用db

	ItfMigrate
	ItfGormDB
}

ItfUserLoginRecord 用户登录记录

type ItfUserManageController

type ItfUserManageController interface {
	SearchUser(ctx *gin.Context)
	QueryUser(ctx *gin.Context)
	SaveUser(ctx *gin.Context)
	DeleteUser(ctx *gin.Context)
	DisableUser(ctx *gin.Context)
	ResetUserPassword(ctx *gin.Context)
}

ItfUserManageController 用户管理

type ItfUserService

type ItfUserService interface {
	SignUp(*dto.UserRegisterParams) (int64, error)
	SaveUser(id int64, up *models.User) (int64, error)
	AutoCreateUser(nickname string, account string, password string) error

	ItfAuthService
}

type ItfUserThird

type ItfUserThird interface {
	Search(search *dto.SearchUserThirdParams, pa *paginate.Pager) ([]*models.UserThird, *paginate.Pager, error)
	Query(id int64) (*models.UserThird, error)
	QueryByThirdId(thirdType string, thirdId string) (*models.UserThird, error)
	QueryByThirdUnionId(thirdType string, unionId string) (*models.UserThird, error)
	Add(*models.UserThird) (int64, error)
	Delete(id int64) (int64, error)

	Use(db *gorm.DB) ItfUserThird //使用db

	ItfMigrate
	ItfGormDB
}

type ItfVerifyCode

type ItfVerifyCode interface {
	Query(id int64) (*models.VerifyCode, error)
	QueryByTarget(target string) (*models.VerifyCode, error)
	Verify(target string, code string) (bool, error)
	Add(code *models.VerifyCode) (int64, error)
	Delete(id int64) (int64, error)

	Use(db *gorm.DB) ItfVerifyCode //使用db

	ItfMigrate
	ItfGormDB
}

ItfVerifyCode 验证码相关db操作接口

type ItfVerifyCodeController

type ItfVerifyCodeController interface {
	SendCode(ctx *gin.Context)
	VerifyCode(ctx *gin.Context)

	VerifyHandler() gin.HandlerFunc //验证handler,用于中间件
}

ItfVerifyCodeController 发送验证码相关

type ItfWorker

type ItfWorker interface {
	Start() error
	Stop() error

	Run() error //运行一次
}

type PasswdBuilder

type PasswdBuilder interface {
	GenPassword(pass string) string
}

PasswdBuilder 密码生成

type PasswdChecker

type PasswdChecker interface {
	CheckPassword(pass string) (bool, string)
}

PasswdChecker 密码校验

Jump to

Keyboard shortcuts

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