Documentation
¶
Index ¶
- type BridgeController
- type BridgeDao
- func (dao BridgeDao) Get(ctx ginutil.Context, serverName, url string, parameters map[string]interface{}, ...) *msgentity.MsgEntity
- func (dao BridgeDao) Post(ctx ginutil.Context, serverName, url string, parameters map[string]interface{}, ...) *msgentity.MsgEntity
- func (dao BridgeDao) ProxyGet(ctx ginutil.Context) interface{}
- func (dao BridgeDao) ProxyPost(ctx ginutil.Context) interface{}
- type IgnoreUrlController
- type IgnoreUrlService
- func (service IgnoreUrlService) CheckIgnoreUrl(ctx ginutil.Context, url string, mustLogin int, userType string) bool
- func (service IgnoreUrlService) ClearCache(ctx ginutil.Context, cacheName, user string) *msgentity.MsgEntity
- func (service IgnoreUrlService) FindById(ctx ginutil.Context, entity dbinfo.Entity, id interface{}) *msgentity.MsgEntity
- type LoginController
- func (control LoginController) Check(ctx ginutil.Context) interface{}
- func (control LoginController) GetCurrentLogin(ctx ginutil.Context) interface{}
- func (control LoginController) GetLogin(ctx ginutil.Context) interface{}
- func (control LoginController) GetUserId(ctx ginutil.Context) interface{}
- func (control LoginController) Heartbeat(ctx ginutil.Context) interface{}
- func (control LoginController) In(ctx ginutil.Context) interface{}
- func (control LoginController) Out(ctx ginutil.Context) interface{}
- func (control LoginController) RegisterUrl()
- type LoginService
- func (service LoginService) Check(ctx ginutil.Context, token string) *msgentity.MsgEntity
- func (service LoginService) GetCurrentLogin(ctx ginutil.Context) *msgentity.MsgEntity
- func (service LoginService) GetLogin(ctx ginutil.Context, key, token string) *msgentity.MsgEntity
- func (service LoginService) GetUserId(ctx ginutil.Context, nameOrNo, Pass, owner string) *msgentity.MsgEntity
- func (service LoginService) Heartbeat(ctx ginutil.Context, token string) *msgentity.MsgEntity
- func (service LoginService) In(ctx ginutil.Context, nameOrNo, Pass, owner string, device int) *msgentity.MsgEntity
- func (service LoginService) Out(ctx ginutil.Context, token string) *msgentity.MsgEntity
- type ModuleManageController
- type ModuleManageService
- type SystemParamsController
- type SystemParamsService
- type TableKeyDao
- type TableKeyService
- type UserAndRightController
- func (control UserAndRightController) CheckUrlRight(ctx ginutil.Context) interface{}
- func (control UserAndRightController) ClearCache(ctx ginutil.Context) interface{}
- func (control UserAndRightController) FindEnglishByUserId(ctx ginutil.Context) interface{}
- func (control UserAndRightController) FindRightId(ctx ginutil.Context) interface{}
- func (control UserAndRightController) LastTime(ctx ginutil.Context) interface{}
- func (control UserAndRightController) RegisterUrl()
- type UserAndRightService
- func (service UserAndRightService) CheckRight(ctx ginutil.Context, userId, url string) *msgentity.MsgEntity
- func (service UserAndRightService) CheckUrlRight(ctx ginutil.Context, userId, url string) bool
- func (service UserAndRightService) ClearCache(ctx ginutil.Context, cacheName, user string) *msgentity.MsgEntity
- func (service UserAndRightService) FindEnglishByUserId(ctx ginutil.Context, userId string) *msgentity.MsgEntity
- func (service UserAndRightService) FindRightId(ctx ginutil.Context, userId string) *msgentity.MsgEntity
- func (service UserAndRightService) LastTime(ctx ginutil.Context, userId string) *msgentity.MsgEntity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BridgeController ¶
type BridgeController struct {
app.ControllerBaseFunc //通用控制层接口方法
}
*
- 桥接代理请求控制器
func (BridgeController) ProxyGet ¶
func (control BridgeController) ProxyGet(ctx ginutil.Context) interface{}
func (BridgeController) ProxyPost ¶
func (control BridgeController) ProxyPost(ctx ginutil.Context) interface{}
type BridgeDao ¶
type BridgeDao struct {
app.DaoBaseFunc
}
*
- 桥接数据操作结构体
func (BridgeDao) Get ¶
func (dao BridgeDao) Get(ctx ginutil.Context, serverName, url string, parameters map[string]interface{}, resultType interface{}) *msgentity.MsgEntity
*
- GET请求
- @param serverName 服务名
- @param url 请求的相对路径
- @param resultType 返回类型
- @param isResultList 返沪类型是否list
- @return
func (BridgeDao) Post ¶
func (dao BridgeDao) Post(ctx ginutil.Context, serverName, url string, parameters map[string]interface{}, resultType interface{}) *msgentity.MsgEntity
*
- post请求
- @param serverName 服务名
- @param url 请求的相对路径
- @param parameters 请求参数
- @param resultType 返回类型
- @param isResultList 返沪类型是否list
- @return
type IgnoreUrlController ¶
type IgnoreUrlController struct {
app.ControllerBaseFunc //通用控制层接口方法
ModuleService IgnoreUrlService //对应模块业务实体
}
@Controller 桥接服务-免拦截桥接操作接口
func (IgnoreUrlController) CheckIgnoreUrl ¶
func (control IgnoreUrlController) CheckIgnoreUrl(ctx ginutil.Context) interface{}
#region @Api {title=内部方法:验证url是否可免于拦截,注意:限制为内部系统(生产者系统)访问} @param {name=url dataType=string paramType=query explain=待检验的url required=true} @param {name=mustLogin dataType=int paramType=query explain=是否必须登录,1:是;2:否 required=false} @param {name=userType dataType=string paramType=query explain=待检验的用户类型 required=false} @return {type=bool explain=返回对象} @RequestMapping {name=CheckIgnoreUrl type=POST value=/ignore/url/check} #endregion
func (IgnoreUrlController) ClearCache ¶
func (control IgnoreUrlController) ClearCache(ctx ginutil.Context) interface{}
#region @Api {title=清理缓存} @return {type=json explain=返回对象} @RequestMapping {name=ClearCache type=POST value=/ignore/url/clear/cache} #endregion
func (IgnoreUrlController) FindById ¶
func (control IgnoreUrlController) FindById(ctx ginutil.Context) interface{}
#region @Api {title=根据记录编号取对象} @param {name=id dataType=string paramType=query explain=记录编号 required=true} @return {type=json explain=返回对象} @RequestMapping {name=FindById type=POST value=/ignore/url/find/id} #endregion
type IgnoreUrlService ¶
type IgnoreUrlService struct {
app.ServiceBaseFunc
}
*
- 拦截器忽略路径接口桥接业务操作结构体
func (IgnoreUrlService) CheckIgnoreUrl ¶
func (service IgnoreUrlService) CheckIgnoreUrl(ctx ginutil.Context, url string, mustLogin int, userType string) bool
*
- 验证指定url是否在可忽略的访问路径中(给内部拦截器用,直接返回Boolean)
- @param url 待检验的url
- @param mustLogin 是否必须登录
- @return
func (IgnoreUrlService) ClearCache ¶
func (service IgnoreUrlService) ClearCache(ctx ginutil.Context, cacheName, user string) *msgentity.MsgEntity
*
- 清理缓存
- @return
type LoginController ¶
type LoginController struct {
app.ControllerBaseFunc //通用控制层接口方法
ModuleService LoginService //对应模块业务实体
}
@Controller 桥接服务-登录桥接操作接口
func (LoginController) Check ¶
func (control LoginController) Check(ctx ginutil.Context) interface{}
#region @Api {title=判断Token是否已经登录} @param {name=token dataType=string paramType=query explain=令牌 required=true} @return {type=json explain=返回对象} @RequestMapping {name=Out type=POST value=/login/check} #endregion
func (LoginController) GetCurrentLogin ¶
func (control LoginController) GetCurrentLogin(ctx ginutil.Context) interface{}
#region @Api {title=取当前登录用户简洁信息} @return {type=json explain=返回对象} @RequestMapping {name=Out type=POST value=/login/info/current} #endregion
func (LoginController) GetLogin ¶
func (control LoginController) GetLogin(ctx ginutil.Context) interface{}
#region @Api {title=取登录用户信息,注意:限制为内部系统访问} @param {name=key dataType=string paramType=query explain=访问基本系统服务的密钥 required=true} @param {name=token dataType=string paramType=query explain=令牌 required=true} @return {type=json explain=返回对象} @RequestMapping {name=Out type=POST value=/login/info} #endregion
func (LoginController) GetUserId ¶
func (control LoginController) GetUserId(ctx ginutil.Context) interface{}
#region @Api {title=根据用户和密码取对应的用户编号} @param {name=nameOrNo dataType=string paramType=query explain=名称或工号 required=true} @param {name=Pass dataType=string paramType=query explain=密码 required=true} @param {name=owner dataType=string paramType=query explain=用户来源表 required=true} @return {type=json explain=返回对象} @RequestMapping {name=Out type=POST value=/login/getid} #endregion
func (LoginController) Heartbeat ¶
func (control LoginController) Heartbeat(ctx ginutil.Context) interface{}
#region @Api {title=维持登录的心跳操作} @param {name=token dataType=string paramType=query explain=令牌 required=true} @return {type=json explain=返回对象} @RequestMapping {name=Out type=POST value=/login/heartbeat} #endregion
func (LoginController) In ¶
func (control LoginController) In(ctx ginutil.Context) interface{}
#region @Api {title=登录,如果用户和密码正确则返回通行令牌} @param {name=nameOrNo dataType=string paramType=query explain=名称或工号 required=true} @param {name=Pass dataType=int paramType=query explain=密码 required=true} @param {name=owner dataType=string paramType=query explain=用户来源表 required=true} @param {name=device dataType=int paramType=query explain=设备类型,1:PC,2:手机,3:平板,4..... required=false} @return {type=json explain=返回对象} @RequestMapping {name=In type=POST value=/login/in} #endregion
func (LoginController) Out ¶
func (control LoginController) Out(ctx ginutil.Context) interface{}
#region @Api {title=用户登出} @param {name=token dataType=string paramType=query explain=令牌 required=true} @return {type=json explain=返回对象} @RequestMapping {name=Out type=POST value=/login/out} #endregion
type LoginService ¶
type LoginService struct {
app.ServiceBaseFunc
}
func (LoginService) GetCurrentLogin ¶
func (service LoginService) GetCurrentLogin(ctx ginutil.Context) *msgentity.MsgEntity
*
- 取当前登录用户简洁信息
- @param request
- @return
func (LoginService) GetUserId ¶
func (service LoginService) GetUserId(ctx ginutil.Context, nameOrNo, Pass, owner string) *msgentity.MsgEntity
*
- 根据用户和密码取对应的用户编号
- @param nameOrNo
- @param Pass
- @param owner 用户来源表
- @return
type ModuleManageController ¶
type ModuleManageController struct {
app.ControllerBaseFunc //通用控制层接口方法
ModuleService ModuleManageService //对应模块业务实体
}
@Controller 模块管理控制器
func (ModuleManageController) FindByTree ¶
func (control ModuleManageController) FindByTree(ctx ginutil.Context) interface{}
#region @Api {title=查询树形结构数据} @param {name=groupName dataType=string paramType=query explain=指定节点名 required=false} @return {type=json explain=返回树型数据} @RequestMapping {name=FindByTree type=POST value=/module/manage/find/tree} #endregion
func (ModuleManageController) RegisterUrl ¶
func (control ModuleManageController) RegisterUrl()
接口注册
type ModuleManageService ¶
type ModuleManageService struct {
}
*
- 模块管理ModuleManage表基本业务操作结构体
func (ModuleManageService) FindByTree ¶
func (service ModuleManageService) FindByTree(ctx ginutil.Context) *msgentity.MsgEntity
*
- 读取树形结构数据
- ctx Http请求对象
type SystemParamsController ¶
type SystemParamsController struct {
app.ControllerBaseFunc //通用控制层接口方法
ModuleService SystemParamsService //对应模块业务实体
}
@Controller 桥接服务-系统参数桥接操作接口
func (SystemParamsController) FindByNoIntercept ¶
func (control SystemParamsController) FindByNoIntercept(ctx ginutil.Context) interface{}
#region @Api {title=取所有免拦截系统参数对象集合} @return {type=json explain=返回分页数据} @RequestMapping {name=FindByPage type=POST value=/system/params/insidevisit/find/not/intercept} #endregion
func (SystemParamsController) RegisterUrl ¶
func (control SystemParamsController) RegisterUrl()
接口注册
type SystemParamsService ¶
type SystemParamsService struct {
app.ServiceBaseFunc
}
func (SystemParamsService) FindByNoIntercept ¶
func (service SystemParamsService) FindByNoIntercept(ctx ginutil.Context) *msgentity.MsgEntity
*
- 取所有免拦截系统参数对象集合
- @return
type TableKeyDao ¶
type TableKeyDao struct {
app.DaoBaseFunc
}
*
- 记录编号序列管理表TableKey表基本业务操作结构体
func (TableKeyDao) GetNewId ¶
func (dao TableKeyDao) GetNewId(formatLong int, serieName string) string
*
- 取各表(或序列)的新Id
- @param formatLong 格式化长度(不足长度+0)
- @param serieName 表名或序列名
- @return
func (TableKeyDao) GetNewIds ¶
func (dao TableKeyDao) GetNewIds(formatLong int, serieName string, size int) []string
*
- 取各表的一批新Id
- @param formatLong 格式化长度(不足长度+0)
- @param serieName 表名或序列名
- @param size 数量
- @return
func (TableKeyDao) Reset ¶
func (dao TableKeyDao) Reset(serieName string) string
*
- 重置
- @param serieName 表名或序列名
- @return
type TableKeyService ¶
type TableKeyService struct {
app.ServiceBaseFunc
}
*
- 记录编号序列管理表TableKey表基本业务操作结构体
func (TableKeyService) GetNewId ¶
func (ts TableKeyService) GetNewId(formatLong int, serieName string) string
*
- 取各表(或序列)的新Id
- @param formatLong 格式化长度(不足长度+0)
- @param serieName 表名或序列名
- @return
func (TableKeyService) GetNewIds ¶
func (ts TableKeyService) GetNewIds(formatLong int, serieName string, size int) []string
*
- 取各表的一批新Id
- @param formatLong 格式化长度(不足长度+0)
- @param serieName 表名或序列名
- @param size 数量
- @return
func (TableKeyService) Reset ¶
func (ts TableKeyService) Reset(serieName string) string
*
- 重置
- @param serieName 表名或序列名
- @return
type UserAndRightController ¶
type UserAndRightController struct {
app.ControllerBaseFunc //通用控制层接口方法
ModuleService UserAndRightService //对应模块业务实体
}
@Controller 桥接服务-用户权限桥接操作接口
func (UserAndRightController) CheckUrlRight ¶
func (control UserAndRightController) CheckUrlRight(ctx ginutil.Context) interface{}
#region @Api {title=验证指定用户是否有访问指定url的权限 explain=给内部拦截器用,直接返回Boolean} @param {name=userId dataType=string paramType=query explain=用户编号 required=true} @param {name=url dataType=string paramType=query explain=检验地址 required=true} @return {type=bool explain=返回对象} @RequestMapping {name=In type=POST value=/user/and/right/check} #endregion
func (UserAndRightController) ClearCache ¶
func (control UserAndRightController) ClearCache(ctx ginutil.Context) interface{}
#region @Api {title=清理指定用户的缓存} @param {name=sLoginId dataType=string paramType=query explain=用户编号 required=false} @return {type=json explain=返回对象} @RequestMapping {name=In type=POST value=/user/and/right/clear/cache} #endregion
func (UserAndRightController) FindEnglishByUserId ¶
func (control UserAndRightController) FindEnglishByUserId(ctx ginutil.Context) interface{}
#region @Api {title=根据用户取权限标识字符串,一个权限标识代表了多个可访问的url路径 explain=不用判断请求用户是谁,因为其它人获取信息后没用,权限校验会在每次进行具体操作时进行再次判断} @param {name=userId dataType=string paramType=query explain=用户编号 required=true} @return {type=json explain=返回对象} @RequestMapping {name=In type=POST value=/user/and/right/find/english} #endregion
func (UserAndRightController) FindRightId ¶
func (control UserAndRightController) FindRightId(ctx ginutil.Context) interface{}
#region @Api {title=根据用户查询用户所拥有的权限编号集合} @param {name=userId dataType=string paramType=query explain=用户编号 required=true} @return {type=bool explain=返回对象} @RequestMapping {name=In type=POST value=/user/and/right/find/rightid} #endregion
func (UserAndRightController) LastTime ¶
func (control UserAndRightController) LastTime(ctx ginutil.Context) interface{}
#region @Api {title=根据用户查询用户所拥有的权限的最后更新时间} @param {name=userId dataType=string paramType=query explain=用户编号 required=true} @return {type=bool explain=返回对象} @RequestMapping {name=In type=POST value=/user/and/right/lasttime} #endregion
func (UserAndRightController) RegisterUrl ¶
func (control UserAndRightController) RegisterUrl()
接口注册
type UserAndRightService ¶
type UserAndRightService struct {
app.ServiceBaseFunc
}
func (UserAndRightService) CheckRight ¶
func (service UserAndRightService) CheckRight(ctx ginutil.Context, userId, url string) *msgentity.MsgEntity
*
- 验证指定用户是否有访问指定url的权限
- @param userId 验证的用户
- @param url 请求验证的权限(URL地址)
- @return
func (UserAndRightService) CheckUrlRight ¶
func (service UserAndRightService) CheckUrlRight(ctx ginutil.Context, userId, url string) bool
*
- 验证指定用户是否有访问指定url的权限(给内部拦截器用,直接返回Boolean)
- @param userId
- @param url
- @return
func (UserAndRightService) ClearCache ¶
func (service UserAndRightService) ClearCache(ctx ginutil.Context, cacheName, user string) *msgentity.MsgEntity
*
- 清理指定用户的缓存
- @param user 用户编号
- @return
func (UserAndRightService) FindEnglishByUserId ¶
func (service UserAndRightService) FindEnglishByUserId(ctx ginutil.Context, userId string) *msgentity.MsgEntity
*
- 根据用户取权限标识字符串(一个权限标识代表了多个可访问的url路径)
- 不用判断请求用户是谁,因为其它人获取信息后没用,权限校验会在每次进行具体操作时进行再次判断
- @param userId
- @return
func (UserAndRightService) FindRightId ¶
func (service UserAndRightService) FindRightId(ctx ginutil.Context, userId string) *msgentity.MsgEntity
*
- 根据用户查询用户所拥有的权限编号集合
- @param userId
- @return