Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
V
volunteer_service
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
licc
volunteer_service
Commits
73821433
Commit
73821433
authored
Jan 15, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LoginRecord 新增操作字段
parent
0e608630
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
4 deletions
+61
-4
LoginRecordMapper.xml
...gy-mapper/src/main/resources/mapper/LoginRecordMapper.xml
+5
-2
LoginRecord.java
...del/src/main/java/cn/wisenergy/model/app/LoginRecord.java
+8
-2
OperationTypeEnum.java
...main/java/cn/wisenergy/model/enums/OperationTypeEnum.java
+40
-0
UserLoginServiceImpl.java
...a/cn/wisenergy/service/app/impl/UserLoginServiceImpl.java
+8
-0
No files found.
wisenergy-mapper/src/main/resources/mapper/LoginRecordMapper.xml
View file @
73821433
...
...
@@ -6,6 +6,7 @@
<id
column=
"id"
property=
"id"
/>
<result
column=
"user_id"
property=
"userId"
/>
<result
column=
"type"
property=
"type"
/>
<result
column=
"operation_name"
property=
"operationName"
/>
<result
column=
"ip"
property=
"ip"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
...
...
@@ -21,16 +22,17 @@
</sql>
<sql
id=
"cols_exclude_id"
>
user_id,type, ip, create_time,update_time
user_id,type,
operationName,
ip, create_time,update_time
</sql>
<sql
id=
"vals"
>
#{userId},#{type},#{ip},now(),now()
#{userId},#{type},#{
operation_name},#{
ip},now(),now()
</sql>
<sql
id=
"updateCondition"
>
<if
test=
"userId != null"
>
user_id = #{userId},
</if>
<if
test=
"type != null"
>
type =#{type},
</if>
<if
test=
"operationName != null"
>
operation_name =#{operationName},
</if>
<if
test=
"ip != null"
>
ip =#{ip},
</if>
update_time =now()
</sql>
...
...
@@ -39,6 +41,7 @@
<if
test=
"id != null"
>
id = #{id}
</if>
<if
test=
"userId != null"
>
and user_id = #{userId}
</if>
<if
test=
"type != null"
>
and type =#{type}
</if>
<if
test=
"operationName != null"
>
and operation_name =#{operationName}
</if>
<if
test=
"ip != null"
>
and ip =#{ip}
</if>
<if
test=
"createTime != null"
>
and create_time
>
= #{createTime}
</if>
<if
test=
"updateTime != null"
>
and #{updateTime}
>
= update_time
</if>
...
...
wisenergy-model/src/main/java/cn/wisenergy/model/app/LoginRecord.java
View file @
73821433
...
...
@@ -30,11 +30,17 @@ public class LoginRecord implements Serializable {
private
Integer
userId
;
/**
* 类型 1:
登录 2:
退出
* 类型 1:
用户祖册 2:用户登录 3:用户
退出
*/
@ApiModelProperty
(
value
=
"类型 1:
登录 2:
退出"
,
name
=
"type"
)
@ApiModelProperty
(
value
=
"类型 1:
用户祖册 2:用户登录 3:用户
退出"
,
name
=
"type"
)
private
Integer
type
;
/**
* 操作名称
*/
@ApiModelProperty
(
value
=
"操作名称"
,
name
=
"operationName"
)
private
String
operationName
;
/**
* ip
*/
...
...
wisenergy-model/src/main/java/cn/wisenergy/model/enums/OperationTypeEnum.java
0 → 100644
View file @
73821433
package
cn
.
wisenergy
.
model
.
enums
;
/**
* @ Description: 操作枚举类
* @ Author : 86187
* @ Date : 2021/1/15 9:58
*/
public
enum
OperationTypeEnum
{
/**
* 用户登录相关-操作枚举类
*/
USER_REGISTER
(
1
,
"用户祖册"
),
USER_LOGIN
(
2
,
"用户登录"
),
USER_OUT
(
3
,
"用户退出"
);
private
Integer
code
;
private
String
desc
;
OperationTypeEnum
(
Integer
code
,
String
desc
)
{
this
.
code
=
code
;
this
.
desc
=
desc
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getDesc
()
{
return
desc
;
}
public
void
setDesc
(
String
desc
)
{
this
.
desc
=
desc
;
}
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/UserLoginServiceImpl.java
View file @
73821433
...
...
@@ -3,6 +3,7 @@ package cn.wisenergy.service.app.impl;
import
cn.wisenergy.common.utils.Md5Util
;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.mapper.UsersMapper
;
import
cn.wisenergy.model.app.LoginRecord
;
import
cn.wisenergy.model.app.UserInfo
;
import
cn.wisenergy.model.vo.UserInfoVo
;
import
cn.wisenergy.model.vo.UserRegisterVo
;
...
...
@@ -58,6 +59,10 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, UserInfo> imp
return
R
.
ok
(
1
,
false
);
}
//4、保存操作记录
LoginRecord
loginRecord
=
new
LoginRecord
();
loginRecord
.
setType
(
1
);
return
R
.
ok
(
0
,
true
);
}
...
...
@@ -159,4 +164,7 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, UserInfo> imp
return
true
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment