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, sUrl string, iMustLogin int, sUserType string) bool
- func (service IgnoreURLService) ClearCache(ctx ginutil.Context, cacheName, sUser 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, sCookie string) *msgentity.MsgEntity
- func (service LoginService) GetCurrentLogin(ctx ginutil.Context) *msgentity.MsgEntity
- func (service LoginService) GetLogin(ctx ginutil.Context, key, sCookie string) *msgentity.MsgEntity
- func (service LoginService) GetUserId(ctx ginutil.Context, sNameOrNo, sPass, sOwner string) *msgentity.MsgEntity
- func (service LoginService) Heartbeat(ctx ginutil.Context, sCookie string) *msgentity.MsgEntity
- func (service LoginService) In(ctx ginutil.Context, sNameOrNo, sPass, sOwner string, iDevice int) *msgentity.MsgEntity
- func (service LoginService) Out(ctx ginutil.Context, sCookie string) *msgentity.MsgEntity
- 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, sUserId, url string) *msgentity.MsgEntity
- func (service UserAndRightService) CheckUrlRight(ctx ginutil.Context, sUserId, url string) bool
- func (service UserAndRightService) ClearCache(ctx ginutil.Context, cacheName, sUser string) *msgentity.MsgEntity
- func (service UserAndRightService) FindEnglishByUserId(ctx ginutil.Context, sUserId string) *msgentity.MsgEntity
- func (service UserAndRightService) FindRightId(ctx ginutil.Context, sUserId string) *msgentity.MsgEntity
- func (service UserAndRightService) LastTime(ctx ginutil.Context, sUserId 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=sUrl dataType=string paramType=query explain=待检验的url required=true} @param {name=iMustLogin dataType=int paramType=query explain=是否必须登录,1:是;2:否 required=false} @param {name=sUserType 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=sId 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, sUrl string, iMustLogin int, sUserType string) bool
*
- 验证指定url是否在可忽略的访问路径中(给内部拦截器用,直接返回Boolean)
- @param sUrl 待检验的url
- @param isMustLogin 是否必须登录
- @return
func (IgnoreURLService) ClearCache ¶
func (service IgnoreURLService) ClearCache(ctx ginutil.Context, cacheName, sUser 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=判断sCookie是否已经登录} @param {name=sCookie 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=sCookie 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=sNameOrNo dataType=string paramType=query explain=名称或工号 required=true} @param {name=sPass dataType=string paramType=query explain=密码 required=true} @param {name=sOwner 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=sCookie 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=sNameOrNo dataType=string paramType=query explain=名称或工号 required=true} @param {name=sPass dataType=int paramType=query explain=密码 required=true} @param {name=sOwner dataType=string paramType=query explain=用户来源表 required=true} @param {name=iDevice 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=sCookie 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, sNameOrNo, sPass, sOwner string) *msgentity.MsgEntity
*
- 根据用户和密码取对应的用户编号
- @param sNameOrNo
- @param sPass
- @param sOwner 用户来源表
- @return
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, seriesName string) string
*
- 取各表(或序列)的新Id
- @param formatLong 格式化长度(不足长度+0)
- @param seriesName 表名或序列名
- @return
func (TableKeyDao) GetNewIds ¶
func (dao TableKeyDao) GetNewIds(formatLong int, seriesName string, size int) []string
*
- 取各表的一批新Id
- @param formatLong 格式化长度(不足长度+0)
- @param seriesName 表名或序列名
- @param size 数量
- @return
func (TableKeyDao) Reset ¶
func (dao TableKeyDao) Reset(seriesName string) string
*
- 重置
- @param seriesName 表名或序列名
- @return
type TableKeyService ¶
type TableKeyService struct {
app.ServiceBaseFunc
}
*
- 记录编号序列管理表TableKey表基本业务操作结构体
func (TableKeyService) GetNewId ¶
func (ts TableKeyService) GetNewId(formatLong int, seriesName string) string
*
- 取各表(或序列)的新Id
- @param formatLong 格式化长度(不足长度+0)
- @param seriesName 表名或序列名
- @return
func (TableKeyService) GetNewIds ¶
func (ts TableKeyService) GetNewIds(formatLong int, seriesName string, size int) []string
*
- 取各表的一批新Id
- @param formatLong 格式化长度(不足长度+0)
- @param seriesName 表名或序列名
- @param size 数量
- @return
func (TableKeyService) Reset ¶
func (ts TableKeyService) Reset(seriesName string) string
*
- 重置
- @param seriesName 表名或序列名
- @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=sUserId 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=sUserId 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=sUserId 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=sUserId 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, sUserId, url string) *msgentity.MsgEntity
*
- 验证指定用户是否有访问指定url的权限
- @param sUserId 验证的用户
- @param url 请求验证的权限(URL地址)
- @return
func (UserAndRightService) CheckUrlRight ¶
func (service UserAndRightService) CheckUrlRight(ctx ginutil.Context, sUserId, url string) bool
*
- 验证指定用户是否有访问指定url的权限(给内部拦截器用,直接返回Boolean)
- @param sUserId
- @param url
- @return
func (UserAndRightService) ClearCache ¶
func (service UserAndRightService) ClearCache(ctx ginutil.Context, cacheName, sUser string) *msgentity.MsgEntity
*
- 清理指定用户的缓存
- @param sUser 用户编号
- @return
func (UserAndRightService) FindEnglishByUserId ¶
func (service UserAndRightService) FindEnglishByUserId(ctx ginutil.Context, sUserId string) *msgentity.MsgEntity
*
- 根据用户取权限标识字符串(一个权限标识代表了多个可访问的url路径)
- 不用判断请求用户是谁,因为其它人获取信息后没用,权限校验会在每次进行具体操作时进行再次判断
- @param sUserId
- @return
func (UserAndRightService) FindRightId ¶
func (service UserAndRightService) FindRightId(ctx ginutil.Context, sUserId string) *msgentity.MsgEntity
*
- 根据用户查询用户所拥有的权限编号集合
- @param sUserId
- @return