bridge

package
v0.0.0-...-0090c64 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BridgeController

type BridgeController struct{}

*

  • 桥接代理请求控制器

func (BridgeController) ProxyGet

func (control BridgeController) ProxyGet(ctx *gin.Context) interface{}

func (BridgeController) ProxyPost

func (control BridgeController) ProxyPost(ctx *gin.Context) interface{}

type BridgeDao

type BridgeDao struct{}

*

  • 桥接数据操作结构体

func (BridgeDao) Get

func (dao BridgeDao) Get(ctx *gin.Context, serverName, url string, parameters map[string]interface{}, resultType interface{}) *MsgEmity

*

  • GET请求
  • @param serverName 服务名
  • @param url 请求的相对路径
  • @param resultType 返回类型
  • @param isResultList 返沪类型是否list
  • @return

func (BridgeDao) Post

func (dao BridgeDao) Post(ctx *gin.Context, serverName, url string, parameters map[string]interface{}, resultType interface{}) *MsgEmity

*

  • post请求
  • @param serverName 服务名
  • @param url 请求的相对路径
  • @param parameters 请求参数
  • @param resultType 返回类型
  • @param isResultList 返沪类型是否list
  • @return

func (BridgeDao) ProxyGet

func (dao BridgeDao) ProxyGet(ctx *gin.Context) interface{}

*

  • 代理请求get
  • 注意:要求请求方返回的必须是*MsgEmity类型
  • @return

func (BridgeDao) ProxyPost

func (dao BridgeDao) ProxyPost(ctx *gin.Context) interface{}

*

  • 代理请求post
  • 注意:要求请求方返回的必须是*MsgEmity类型
  • @return

type IgnoreURLController

type IgnoreURLController struct {
}

@Controller 桥接服务-免拦截桥接操作接口

func (IgnoreURLController) CheckIgnoreUrl

func (control IgnoreURLController) CheckIgnoreUrl(ctx *gin.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 *gin.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 *gin.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{}

*

  • 拦截器忽略路径接口桥接业务操作结构体

func (IgnoreURLService) CheckIgnoreUrl

func (service IgnoreURLService) CheckIgnoreUrl(ctx *gin.Context, sUrl string, iMustLogin int, sUserType string) bool

*

  • 验证指定url是否在可忽略的访问路径中(给内部拦截器用,直接返回Boolean)
  • @param sUrl 待检验的url
  • @param isMustLogin 是否必须登录
  • @return

func (IgnoreURLService) ClearCache

func (service IgnoreURLService) ClearCache(ctx *gin.Context) *MsgEmity

*

  • 清理缓存
  • @return

func (IgnoreURLService) FindById

func (service IgnoreURLService) FindById(ctx *gin.Context, sId string) *MsgEmity

*

  • 根据记录编号取对象
  • @param sId 记录编号
  • @return

type LoginController

type LoginController struct {
}

@Controller 桥接服务-登录桥接操作接口

func (LoginController) Check

func (control LoginController) Check(ctx *gin.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 *gin.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 *gin.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 *gin.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 *gin.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 *gin.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 *gin.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 {
}

func (LoginService) Check

func (service LoginService) Check(ctx *gin.Context, sCookie string) *MsgEmity

*

  • 判断sCookie是否已经登录
  • @param sCookie
  • @return

func (LoginService) GetCurrentLogin

func (service LoginService) GetCurrentLogin(ctx *gin.Context) *MsgEmity

*

  • 取当前登录用户简洁信息
  • @param request
  • @return

func (LoginService) GetLogin

func (service LoginService) GetLogin(ctx *gin.Context, key, sCookie string) *MsgEmity

*

  • 取登录用户信息,注意:限制为内部系统访问
  • @param key
  • @param sCookie
  • @return

func (LoginService) GetUserId

func (service LoginService) GetUserId(ctx *gin.Context, sNameOrNo, sPass, sOwner string) *MsgEmity

*

  • 根据用户和密码取对应的用户编号
  • @param sNameOrNo
  • @param sPass
  • @param sOwner 用户来源表
  • @return

func (LoginService) Heartbeat

func (service LoginService) Heartbeat(ctx *gin.Context, sCookie string) *MsgEmity

*

  • 登录心跳操作,sCookie存在则更新并返回true,没有则返回false
  • @param sCookie
  • @return

func (LoginService) In

func (service LoginService) In(ctx *gin.Context, sNameOrNo, sPass, sOwner string, iDevice int) *MsgEmity

*

  • 登录,如果用户和密码正确则返回同行令牌
  • @param sNameOrNo 名称或工号
  • @param sPass 密码
  • @param sOwner 用户来源表
  • @param iDevice 设备类型,1:PC,2:手机,3:平板,4.....
  • @return

func (LoginService) Out

func (service LoginService) Out(ctx *gin.Context, sCookie string) *MsgEmity

*

  • 用户登出
  • @param sCookie
  • @return

type ModuleManageController

type ModuleManageController struct {
}

@Controller 模块管理控制器

func (ModuleManageController) FindByTree

func (control ModuleManageController) FindByTree(ctx *gin.Context) interface{}

#region @Api {title=查询树形结构数据} @param {name=sGroupName dataType=string paramType=query explain=指定节点名 required=false} @return {type=json explain=返回树型数据} @RequestMapping {name=FindByTree type=POST value=/module/manage/find/tree} #endregion

type ModuleManageService

type ModuleManageService struct {
}

*

  • 模块管理ModuleManage表基本业务操作结构体

func (ModuleManageService) FindByTree

func (service ModuleManageService) FindByTree(ctx *gin.Context) *MsgEmity

*

  • 读取树形结构数据
  • ctx Http请求对象

type SystemParamsController

type SystemParamsController struct {
}

@Controller 桥接服务-系统参数桥接操作接口

func (SystemParamsController) FindByNoIntercept

func (control SystemParamsController) FindByNoIntercept(ctx *gin.Context) interface{}

#region @Api {title=取所有免拦截系统参数对象集合} @return {type=json explain=返回分页数据} @RequestMapping {name=FindByPage type=POST value=/system/params/insidevisit/find/not/intercept} #endregion

type SystemParamsService

type SystemParamsService struct {
}

func (SystemParamsService) FindByNoIntercept

func (service SystemParamsService) FindByNoIntercept(ctx *gin.Context) *MsgEmity

*

  • 取所有免拦截系统参数对象集合
  • @return

type TableKeyDao

type TableKeyDao struct {
}

*

  • 记录编号序列管理表TableKey表基本业务操作结构体

func (TableKeyDao) GetNewId

func (this TableKeyDao) GetNewId(formatLong int, seriesName string) string

*

  • 取各表(或序列)的新Id
  • @param formatLong 格式化长度(不足长度+0)
  • @param seriesName 表名或序列名
  • @return

func (TableKeyDao) GetNewIds

func (this TableKeyDao) GetNewIds(formatLong int, seriesName string, size int) []string

*

  • 取各表的一批新Id
  • @param formatLong 格式化长度(不足长度+0)
  • @param seriesName 表名或序列名
  • @param size 数量
  • @return

func (TableKeyDao) Reset

func (this TableKeyDao) Reset(seriesName string) string

*

  • 重置
  • @param seriesName 表名或序列名
  • @return

type TableKeyService

type TableKeyService struct {
	CommonService
}

*

  • 记录编号序列管理表TableKey表基本业务操作结构体

func (TableKeyService) GetNewId

func (this TableKeyService) GetNewId(formatLong int, seriesName string) string

*

  • 取各表(或序列)的新Id
  • @param formatLong 格式化长度(不足长度+0)
  • @param seriesName 表名或序列名
  • @return

func (TableKeyService) GetNewIds

func (this TableKeyService) GetNewIds(formatLong int, seriesName string, size int) []string

*

  • 取各表的一批新Id
  • @param formatLong 格式化长度(不足长度+0)
  • @param seriesName 表名或序列名
  • @param size 数量
  • @return

func (TableKeyService) Reset

func (this TableKeyService) Reset(seriesName string) string

*

  • 重置
  • @param seriesName 表名或序列名
  • @return

type UserAndRightController

type UserAndRightController struct {
}

@Controller 桥接服务-用户权限桥接操作接口

func (UserAndRightController) CheckUrlRight

func (control UserAndRightController) CheckUrlRight(ctx *gin.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 *gin.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 *gin.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 *gin.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 *gin.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

type UserAndRightService

type UserAndRightService struct {
}

func (UserAndRightService) CheckRight

func (service UserAndRightService) CheckRight(ctx *gin.Context, sUserId, url string) *MsgEmity

*

  • 验证指定用户是否有访问指定url的权限
  • @param sUserId 验证的用户
  • @param url 请求验证的权限(URL地址)
  • @return

func (UserAndRightService) CheckUrlRight

func (service UserAndRightService) CheckUrlRight(ctx *gin.Context, sUserId, url string) bool

*

  • 验证指定用户是否有访问指定url的权限(给内部拦截器用,直接返回Boolean)
  • @param sUserId
  • @param url
  • @return

func (UserAndRightService) ClearCache

func (service UserAndRightService) ClearCache(ctx *gin.Context, sLoginId string) *MsgEmity

*

  • 清理指定用户的缓存
  • @param sUser 用户编号
  • @return

func (UserAndRightService) FindEnglishByUserId

func (service UserAndRightService) FindEnglishByUserId(ctx *gin.Context, sUserId string) *MsgEmity

*

  • 根据用户取权限标识字符串(一个权限标识代表了多个可访问的url路径)
  • 不用判断请求用户是谁,因为其它人获取信息后没用,权限校验会在每次进行具体操作时进行再次判断
  • @param sUserId
  • @return

func (UserAndRightService) FindRightId

func (service UserAndRightService) FindRightId(ctx *gin.Context, sUserId string) *MsgEmity

*

  • 根据用户查询用户所拥有的权限编号集合
  • @param sUserId
  • @return

func (UserAndRightService) LastTime

func (service UserAndRightService) LastTime(ctx *gin.Context, sUserId string) *MsgEmity

*

  • 根据用户查询用户所拥有的权限的最后更新时间
  • @param sUserId
  • @return

Jump to

Keyboard shortcuts

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