Documentation ¶
Index ¶
- Variables
- type LoginController
- func (LoginController) Check(ctx ginutil.Context) interface{}
- func (LoginController) GetCurrentLogin(ctx ginutil.Context) interface{}
- func (LoginController) GetLogin(ctx ginutil.Context) interface{}
- func (LoginController) GetUserId(ctx ginutil.Context) interface{}
- func (LoginController) Heartbeat(ctx ginutil.Context) interface{}
- func (LoginController) HeartbeatWebsoket(ctx ginutil.Context) interface{}
- func (LoginController) In(ctx ginutil.Context) interface{}
- func (LoginController) Out(ctx ginutil.Context) interface{}
- func (control LoginController) RegisterUrl()
- type LoginDao
- type LoginServer
- func (ls LoginServer) Check(sCookie string) *msgentity.MsgEntity
- func (ls LoginServer) GetLogin(sCookie string) *msgentity.MsgEntity
- func (ls LoginServer) GetLoginInside(sCookie string) *msgentity.MsgEntity
- func (ls LoginServer) GetUserId(sNameOrNo, sPass, sOwner string) *msgentity.MsgEntity
- func (ls LoginServer) Heartbeat(sCookie string) *msgentity.MsgEntity
- func (ls LoginServer) In(sNameOrNo, sPass, sOwner string, iDevice, iResultInfo int) *msgentity.MsgEntity
- func (ls LoginServer) Out(sCookie string) *msgentity.MsgEntity
- type LoginUser
Constants ¶
This section is empty.
Variables ¶
var (
LoginServerLock sync.RWMutex //读写锁
)
Functions ¶
This section is empty.
Types ¶
type LoginController ¶
type LoginController struct { }
@Controller 登录服务控制器
func (LoginController) Check ¶
func (LoginController) Check(ctx ginutil.Context) interface{}
#region @Api {title=验证令牌 explain=判断sCookie是否已经登录} @param {name=sCookie dataType=string paramType=query explain=令牌 required=true} @return {type=MsgEntity} @RequestMapping {name=login type=POST value=/login/check} #endregion
func (LoginController) GetCurrentLogin ¶
func (LoginController) GetCurrentLogin(ctx ginutil.Context) interface{}
#region @Api {title=取当前登录用户简洁信息} @return {type=MsgEntity} @RequestMapping {name=login type=POST value=/login/info/current} #endregion
func (LoginController) GetLogin ¶
func (LoginController) GetLogin(ctx ginutil.Context) interface{}
#region @Api {title=取登录用户信息 explain=注意:限制为内部系统访问} @param {name=key} @param {name=sCookie dataType=string paramType=query explain=令牌 required=true} @return {type=MsgEntity} @RequestMapping {name=login type=POST value=/login/info} #endregion
func (LoginController) GetUserId ¶
func (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=MsgEntity} @RequestMapping {name=login type=POST value=/login/getid} #endregion
func (LoginController) Heartbeat ¶
func (LoginController) Heartbeat(ctx ginutil.Context) interface{}
#region @Api {title=登录心跳操作 explain=sCookie存在则更新并返回true,没有则返回false} @param {name=sCookie dataType=string paramType=query explain=令牌 required=true} @return {type=MsgEntity} @RequestMapping {name=login type=(POST,GET) value=/login/heartbeat} #endregion
func (LoginController) HeartbeatWebsoket ¶
func (LoginController) HeartbeatWebsoket(ctx ginutil.Context) interface{}
#region @Api {title=登录心跳操作Websoket explain=msg存在则更新并返回true,没有则返回false} @param {name=msg dataType=string paramType=query explain=令牌 required=true} @return {type=MsgEntity} @RequestMapping {name=login type=(POST,GET) value=/login/heartbeat/websoket} #endregion
func (LoginController) In ¶
func (LoginController) In(ctx ginutil.Context) interface{}
#region @Api {title=用户登录 explain=如果用户和密码正确则返回同行令牌} @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} @param {name=iDevice dataType=int paramType=query explain=设备类型,1:PC,2:手机,3:平板,4.....} @param {name=iResultInfo dataType=int paramType=query explain=是否返回用户信息} @return {type=MsgEntity explain=返回令牌} @RequestMapping {name=login type=(POST, GET) value=/login/in} #endregion
func (LoginController) Out ¶
func (LoginController) Out(ctx ginutil.Context) interface{}
#region @Api {title=用户登出 explain=使提交的令牌失效} @param {name=sCookie dataType=string paramType=query explain=令牌 required=true} @return {type=MsgEntity} @RequestMapping {name=login type=(POST,GET) value=/login/out} #endregion
type LoginDao ¶
type LoginDao struct {
app.DaoBaseFunc
}
type LoginServer ¶
type LoginServer struct {
app.ServiceBaseFunc
}
func (LoginServer) Check ¶
func (ls LoginServer) Check(sCookie string) *msgentity.MsgEntity
*
- 判断sCookie是否已经登录
- @param sCookie 令牌
- @return
func (LoginServer) GetLogin ¶
func (ls LoginServer) GetLogin(sCookie string) *msgentity.MsgEntity
*
- 取登录信息
- @param sCookie 令牌
- @return
func (LoginServer) GetLoginInside ¶
func (ls LoginServer) GetLoginInside(sCookie string) *msgentity.MsgEntity
*
- 取登录信息(内部调用)
- @param sCookie 令牌
- @return
func (LoginServer) GetUserId ¶
func (ls LoginServer) GetUserId(sNameOrNo, sPass, sOwner string) *msgentity.MsgEntity
*
- 根据用户和密码取对应的用户编号
- @param sNameOrNo
- @param sPass
- @param sOwner 用户来源表
- @return
func (LoginServer) Heartbeat ¶
func (ls LoginServer) Heartbeat(sCookie string) *msgentity.MsgEntity
*
- 登录心跳操作,sCookie存在则更新并返回true,没有则返回false
- @param sCookie 令牌
- @return
type LoginUser ¶
type LoginUser struct { GsId string `json:"sId" gorm:"column:sId; type:varchar"` //用户编号 GsName string `json:"sName" gorm:"column:sName; type:varchar"` //姓名 GsNo string `json:"sNo" gorm:"column:sNo; type:varchar"` //工号 GsPass string `json:"-" gorm:"column:sPass; type:varchar"` //密码 GsSignPass string `json:"-" gorm:"column:sSignPass; type:varchar"` //手势密码 GsType string `json:"sType" gorm:"column:sType; type:varchar"` //用户类型编号 GsOwner string `json:"sOwner" gorm:"column:sOwner; type:varchar"` //用户来源 GiState int `json:"iState" gorm:"column:iState; type:int"` //状态(-1,人员表人员被删除,1表示正常状态,2人员停用,) GdLastDate int64 `json:"dLastDate"` //最后访问时间 GsCookie string `json:"sCookie"` //分配的Cookie GiDevice int `json:"iDevice"` //设备类型,1:PC,2:手机,3:平板,4..... Gattached map[string]string `json:"attached" gorm:"-"` //与登录相关的附属信息 }
*
- 登录缓存对象
- 非数据库实体