loginlog

package module
v0.0.0-...-4fd775f Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoginLog

type LoginLog struct {
	LoginLogBase
}

*

  • 登录日志'LoginLog'表结构体
  • 警告:非数据库字段禁止在此添加,应该创建扩展结构体中添加
  • @author HuangXinBian

func (LoginLog) New

func (loginlog LoginLog) New() dbinfo.Entity

*

  • 创建结构实体,并赋予默认值

type LoginLogBase

type LoginLogBase struct {
	GiId           int64     `json:"iId" gorm:"column:iId; type:bigintAUTO_INCREMENT; NOT NULL; primary_key"`           //记录编号
	GsName         string    `json:"sName" gorm:"column:sName; type:varchar"`                                           //日志类型(冗余)
	GiType         int       `json:"iType" gorm:"column:iType; type:int; NOT NULL; DEFAULT '1'"`                        //日志类型
	GsUserId       string    `json:"sUserId" gorm:"column:sUserId; type:varchar"`                                       //用户编号
	GsUser         string    `json:"sUser" gorm:"column:sUser; type:varchar"`                                           //用户名(冗余)
	GsIp           string    `json:"sIp" gorm:"column:sIp; type:varchar"`                                               //IP地址
	GsMACAddress   string    `json:"sMACAddress" gorm:"column:sMACAddress; type:varchar"`                               //MAC地址
	GdLogDate      time.Time `json:"dLogDate" gorm:"column:dLogDate; type:datetime"`                                    //发生时间
	GdLastCall     time.Time `json:"dLastCall" gorm:"column:dLastCall; type:datetime"`                                  //最后访问时间
	GsMemo         string    `json:"sMemo" gorm:"column:sMemo; type:varchar"`                                           //备注
	GsCreator      string    `json:"sCreator" gorm:"column:sCreator; type:varchar; NOT NULL; DEFAULT '00000000'"`       //创建者
	GdCreateDate   time.Time `json:"dCreateDate" gorm:"column:dCreateDate; type:datetime; NOT NULL"`                    //创建时间
	GsModifieder   string    `json:"sModifieder" gorm:"column:sModifieder; type:varchar; NOT NULL; DEFAULT '00000000'"` //修改人
	GdModifiedDate time.Time `json:"dModifiedDate" gorm:"column:dModifiedDate; type:datetime; NOT NULL"`                //修改时间
	GiState        int       `json:"iState" gorm:"column:iState; type:int; NOT NULL; DEFAULT '1'"`                      //状态
	GiIndex        int       `json:"iIndex" gorm:"column:iIndex; type:int; NOT NULL; DEFAULT '1'"`                      //序号
	GiVersion      int       `json:"iVersion" gorm:"column:iVersion; type:int; NOT NULL; DEFAULT '1'"`                  //版本号
}

*

  • 登录日志'LoginLog'表结构体
  • 警告:非数据库字段禁止在此添加,应该创建扩展结构体中添加
  • @author HuangXinBian

func (LoginLogBase) BaseColumnNames

func (LoginLogBase) BaseColumnNames() string

*

  • 结构体映射表的字段名串
  • @return

func (LoginLogBase) BaseEntity

func (LoginLogBase) BaseEntity() dbinfo.Entity

*

  • 取基础实体,用于在子类(嵌套结构体)时同样获得基类

func (LoginLogBase) GetDataInfo

func (LoginLogBase) GetDataInfo(name string) *dbinfo.DataInfo

*

  • 取数据结构信息
  • @param name 字段名
  • @return

func (LoginLogBase) New

func (LoginLogBase) New() dbinfo.Entity

*

  • 创建结构实体
  • @return

func (LoginLogBase) OwnerName

func (LoginLogBase) OwnerName() string

*

  • 结构体映射库名,去除'Dev_'等前缀
  • @return

func (LoginLogBase) OwnerTable

func (LoginLogBase) OwnerTable() string

*

  • 结构体映射表名,无库名
  • @return

func (LoginLogBase) TableName

func (LoginLogBase) TableName() string

*

  • 结构体映射表名,处理结构体名称与表名不一致的情况
  • @return

type LoginLogController

type LoginLogController struct {
	app.ControllerBaseFunc                 //通用控制层接口方法
	ModuleEntity           LoginLog        //对应模块数据实体
	ModuleService          LoginLogService //对应模块业务实体
}

@Controller 登录日志控制器

func (LoginLogController) Del

func (control LoginLogController) Del(ctx ginutil.Context) interface{}

#region @Api {title=删除数据} @param {name=iId dataType=int64 paramType=query explain=记录编号 required=true} @param {name=iVersion dataType=int paramType=query explain=版本号 required=true} @return {type=MsgEntity explain=返回影响数} @RequestMapping {name=Del type=POST value=/login/log/del} #endregion

func (LoginLogController) FindByPage

func (control LoginLogController) FindByPage(ctx ginutil.Context) interface{}

#region @Api {title=查询分页数据} @param {name=data dataType=json paramType=body explain=FindByPageParam结构数据 explainType=FindByPageParam<LoginLog> required=true} @return {type=MsgEntity explain=返回分页数据} @RequestMapping {name=FindByPage type=POST value=/login/log/find/page} #endregion

func (LoginLogController) RegisterUrl

func (control LoginLogController) RegisterUrl()

接口注册

type LoginLogService

type LoginLogService struct {
	app.ServiceBaseFunc
}

*

  • 登录日志LoginLog表基本业务操作结构体

func (LoginLogService) AddLog

func (service LoginLogService) AddLog(ctx ginutil.Context, sNameOrNo string) *msgentity.MsgEntity

*

  • 验证更新数据是否存在重复 (一旦使用则覆盖通用方法)
  • @param r Http请求对象
  • @param sIp 登录者IP
  • @param sNameOrNo 登录者使用的用户名或工号
  • @return *msgentity.MsgEntity 返回验证结果

func (LoginLogService) AopAddLog

func (service LoginLogService) AopAddLog(ctx ginutil.Context, params ...interface{}) *msgentity.MsgEntity

*

  • Aop方式添加日志
  • @param sDateSt 开始时间范围
  • @param sDateEd 结束时间范围
  • @return

Jump to

Keyboard shortcuts

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