模块标准化

This commit is contained in:
2023-01-18 17:21:12 +08:00
parent c44203b176
commit 7c2bdebd0b
16 changed files with 162 additions and 162 deletions
+4 -4
View File
@@ -2,7 +2,7 @@ package dao
import (
"cutego/modules/core/api/v1/request"
"cutego/modules/core/entity"
"cutego/modules/core/dataobject"
"cutego/pkg/common"
"cutego/pkg/page"
"cutego/refs"
@@ -18,8 +18,8 @@ func (d LoginInfoDao) sql(session *xorm.Session) *xorm.Session {
}
// SelectPage 分页查询数据
func (d LoginInfoDao) SelectPage(query request.LoginInfoQuery) (*[]entity.SysLoginInfo, int64) {
loginInfos := make([]entity.SysLoginInfo, 0)
func (d LoginInfoDao) SelectPage(query request.LoginInfoQuery) (*[]dataobject.SysLoginInfo, int64) {
loginInfos := make([]dataobject.SysLoginInfo, 0)
session := d.sql(refs.SqlDB.NewSession())
session.And("user_name = ?", query.UserName)
total, _ := page.GetTotal(session.Clone())
@@ -32,7 +32,7 @@ func (d LoginInfoDao) SelectPage(query request.LoginInfoQuery) (*[]entity.SysLog
}
// Insert 添加登录记录
func (d LoginInfoDao) Insert(body entity.SysLoginInfo) *entity.SysLoginInfo {
func (d LoginInfoDao) Insert(body dataobject.SysLoginInfo) *dataobject.SysLoginInfo {
session := refs.SqlDB.NewSession()
session.Begin()
_, err := session.Table("sys_login_info").Insert(&body)