Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
dbd530c1
Commit
dbd530c1
authored
Aug 12, 2019
by
libin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户行为保存
parent
ea373242
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
142 additions
and
38 deletions
+142
-38
TokenAop.java
...m/github/wxiaoqi/security/admin/support/aop/TokenAop.java
+2
-1
BehaviorEnum.java
.../com/xxfc/platform/user/behavior/common/BehaviorEnum.java
+10
-0
IdentityEnum.java
.../com/xxfc/platform/user/behavior/common/IdentityEnum.java
+33
-0
CustomerBehaviorNoteDTO.java
...c/platform/user/behavior/dto/CustomerBehaviorNoteDTO.java
+4
-2
CustomerBehaviorNotes.java
.../platform/user/behavior/entity/CustomerBehaviorNotes.java
+28
-28
CustomerBehaviorNotesBiz.java
.../platform/user/behavior/biz/CustomerBehaviorNotesBiz.java
+11
-0
SwaggerConfig.java
...com/xxfc/platform/user/behavior/config/SwaggerConfig.java
+0
-2
WebConfiguration.java
.../xxfc/platform/user/behavior/config/WebConfiguration.java
+6
-1
CustomerBehaviorNotesController.java
...m/user/behavior/rest/CustomerBehaviorNotesController.java
+26
-4
CustomerBehaviorNotesAdminController.java
...vior/rest/admin/CustomerBehaviorNotesAdminController.java
+22
-0
No files found.
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/support/aop/TokenAop.java
View file @
dbd530c1
...
...
@@ -68,7 +68,8 @@ public class TokenAop {
if
(
AppUserDTO
.
class
.
equals
(
parameter
.
getType
())){
//token为空
if
(
StringUtils
.
isEmpty
(
token
)){
return
ObjectRestResponse
.
createFailedResult
(
4004
,
"token不能为空"
);
// return ObjectRestResponse.createFailedResult(4004,"token不能为空");
args
[
i
]=
new
AppUserDTO
();
}
args
[
i
]=
userFeign
.
userDetailByToken
(
token
).
getData
();
break
;
...
...
xx-user-behavior-collect/xx-user-behavior-api/src/main/java/com/xxfc/platform/user/behavior/common/BehaviorEnum.java
0 → 100644
View file @
dbd530c1
package
com
.
xxfc
.
platform
.
user
.
behavior
.
common
;
/**
* @author libin
* @version 1.0
* @description 用户行为枚举
* @data 2019/8/12 14:57
*/
public
enum
BehaviorEnum
{
}
xx-user-behavior-collect/xx-user-behavior-api/src/main/java/com/xxfc/platform/user/behavior/common/IdentityEnum.java
0 → 100644
View file @
dbd530c1
package
com
.
xxfc
.
platform
.
user
.
behavior
.
common
;
/**
* @author libin
* @version 1.0
* @description 身份枚举
* @data 2019/8/12 14:53
*/
public
enum
IdentityEnum
{
/**
* 游客
*/
VISITOR
(
1
),
/**
* app用户
*/
USER
(
2
);
private
int
code
;
IdentityEnum
(
int
code
){
this
.
code
=
code
;
}
public
int
getCode
()
{
return
code
;
}
public
void
setCode
(
int
code
)
{
this
.
code
=
code
;
}
}
xx-user-behavior-collect/xx-user-behavior-api/src/main/java/com/xxfc/platform/user/behavior/dto/CustomerBehaviorNoteDTO.java
View file @
dbd530c1
...
...
@@ -21,12 +21,14 @@ public class CustomerBehaviorNoteDTO implements Serializable {
@ApiModelProperty
(
value
=
"用户id"
)
private
String
customerId
;
/**
* 访问者身份 {@link com.xxfc.platform.user.behavior.common.IdentityEnum}
*/
@ApiModelProperty
(
value
=
"1-游客;2-用户"
)
private
Integer
customerType
;
/**
* 行为类型
(见枚举)
* 行为类型
{@link com.xxfc.platform.user.behavior.common.BehaviorEnum}
*/
@ApiModelProperty
(
value
=
"行为类型(见枚举)"
)
private
Integer
type
;
...
...
xx-user-behavior-collect/xx-user-behavior-api/src/main/java/com/xxfc/platform/user/behavior/entity/CustomerBehaviorNotes.java
View file @
dbd530c1
...
...
@@ -12,7 +12,7 @@ import java.io.Serializable;
/**
* 用户行为记录表
*
*
* @author libin
* @email 18178966185@163.com
* @date 2019-08-12 14:03:55
...
...
@@ -20,49 +20,49 @@ import java.io.Serializable;
@Data
@Table
(
name
=
"customer_behavior_notes"
)
public
class
CustomerBehaviorNotes
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
*
主键id
*/
private
static
final
long
serialVersionUID
=
1L
;
/**
*
主键id
*/
@Id
@GeneratedValue
(
generator
=
"JDBC"
)
@ApiModelProperty
(
"主键id"
)
@GeneratedValue
(
generator
=
"JDBC"
)
@ApiModelProperty
(
"主键id"
)
private
Integer
id
;
/**
*
用户id
/**
* 用户id
*/
@Column
(
name
=
"customer_id"
)
@ApiModelProperty
(
value
=
"用户id"
)
@ApiModelProperty
(
value
=
"用户id"
)
private
String
customerId
;
/**
*
1-游客;2-用户
/**
*
访问者身份 {@link com.xxfc.platform.user.behavior.common.IdentityEnum}
*/
@Column
(
name
=
"customer_type"
)
@ApiModelProperty
(
value
=
"1-游客;2-用户"
)
@ApiModelProperty
(
value
=
"1-游客;2-用户"
)
private
Integer
customerType
;
/**
*
行为类型(见枚举)
/**
*
行为类型 {@link com.xxfc.platform.user.behavior.common.BehaviorEnum}
*/
@Column
(
name
=
"type"
)
@ApiModelProperty
(
value
=
"行为类型(见枚举)"
)
@ApiModelProperty
(
value
=
"行为类型(见枚举)"
)
private
Integer
type
;
/**
*
类型id
/**
* 类型id
*/
@Column
(
name
=
"type_id"
)
@ApiModelProperty
(
value
=
"类型id"
)
@ApiModelProperty
(
value
=
"类型id"
)
private
Integer
typeId
;
/**
*
创建时间
/**
* 创建时间
*/
@Column
(
name
=
"crt_time"
)
@ApiModelProperty
(
value
=
"创建时间"
,
hidden
=
true
)
@ApiModelProperty
(
value
=
"创建时间"
,
hidden
=
true
)
private
Long
crtTime
;
}
xx-user-behavior-collect/xx-user-behavior-server/src/main/java/com/xxfc/platform/user/behavior/biz/CustomerBehaviorNotesBiz.java
View file @
dbd530c1
package
com
.
xxfc
.
platform
.
user
.
behavior
.
biz
;
import
com.xxfc.platform.user.behavior.dto.CustomerBehaviorNoteDTO
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
com.xxfc.platform.user.behavior.entity.CustomerBehaviorNotes
;
import
com.xxfc.platform.user.behavior.mapper.CustomerBehaviorNotesMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
java.time.Instant
;
/**
* 用户行为记录表
*
...
...
@@ -15,4 +19,11 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
*/
@Service
public
class
CustomerBehaviorNotesBiz
extends
BaseBiz
<
CustomerBehaviorNotesMapper
,
CustomerBehaviorNotes
>
{
public
void
saveCustomerBehavior
(
CustomerBehaviorNoteDTO
customerBehaviorNoteDTO
)
{
CustomerBehaviorNotes
customerBehaviorNotes
=
new
CustomerBehaviorNotes
();
BeanUtils
.
copyProperties
(
customerBehaviorNoteDTO
,
customerBehaviorNotes
);
customerBehaviorNotes
.
setCrtTime
(
Instant
.
now
().
toEpochMilli
());
mapper
.
insertSelective
(
customerBehaviorNotes
);
}
}
\ No newline at end of file
xx-user-behavior-collect/xx-user-behavior-server/src/main/java/com/xxfc/platform/user/behavior/config/SwaggerConfig.java
View file @
dbd530c1
package
com
.
xxfc
.
platform
.
user
.
behavior
.
config
;
import
io.swagger.annotations.Api
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
springfox.documentation.builders.ApiInfoBuilder
;
...
...
@@ -43,7 +42,6 @@ public class SwaggerConfig {
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"com.xxfc.platform.activity.rest"
))
//.apis(RequestHandlerSelectors.any())
.
build
()
.
globalOperationParameters
(
pars
)
.
apiInfo
(
apiInfo
());
...
...
xx-user-behavior-collect/xx-user-behavior-server/src/main/java/com/xxfc/platform/user/behavior/config/WebConfiguration.java
View file @
dbd530c1
...
...
@@ -5,7 +5,12 @@ import org.springframework.context.annotation.Bean;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/8/12 15:27
*/
@Configuration
(
"campsiteWebConfig"
)
@Primary
public
class
WebConfiguration
implements
WebMvcConfigurer
{
...
...
xx-user-behavior-collect/xx-user-behavior-server/src/main/java/com/xxfc/platform/user/behavior/rest/CustomerBehaviorNotesController.java
View file @
dbd530c1
package
com
.
xxfc
.
platform
.
user
.
behavior
.
rest
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.user.behavior.biz.CustomerBehaviorNotesBiz
;
import
com.xxfc.platform.user.behavior.entity.CustomerBehaviorNotes
;
import
com.xxfc.platform.user.behavior.common.IdentityEnum
;
import
com.xxfc.platform.user.behavior.dto.CustomerBehaviorNoteDTO
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Objects
;
/**
* @author libin
* @version 1.0
* @description
* @description
用户行为日志*记录
* @data 2019/8/12 14:14
*/
@RestController
@RequestMapping
(
"customerBehaviorNotes"
)
public
class
CustomerBehaviorNotesController
extends
BaseController
<
CustomerBehaviorNotesBiz
,
CustomerBehaviorNotes
>
{
@RequiredArgsConstructor
(
onConstructor
=
@__
(
@Autowired
))
public
class
CustomerBehaviorNotesController
{
private
final
CustomerBehaviorNotesBiz
customerBehaviorNotesBiz
;
@PostMapping
(
"app/unauth/save"
)
public
ObjectRestResponse
<
Void
>
saveCustomerBehavior
(
@RequestBody
CustomerBehaviorNoteDTO
customerBehaviorNoteDTO
,
AppUserDTO
appUserDTO
)
{
if
(
Objects
.
nonNull
(
appUserDTO
.
getUserid
()))
{
customerBehaviorNoteDTO
.
setCustomerId
(
String
.
valueOf
(
appUserDTO
.
getUserid
()));
customerBehaviorNoteDTO
.
setCustomerType
(
IdentityEnum
.
USER
.
getCode
());
}
else
{
customerBehaviorNoteDTO
.
setCustomerType
(
IdentityEnum
.
VISITOR
.
getCode
());
}
customerBehaviorNotesBiz
.
saveCustomerBehavior
(
customerBehaviorNoteDTO
);
return
ObjectRestResponse
.
succ
();
}
}
\ No newline at end of file
xx-user-behavior-collect/xx-user-behavior-server/src/main/java/com/xxfc/platform/user/behavior/rest/admin/CustomerBehaviorNotesAdminController.java
0 → 100644
View file @
dbd530c1
package
com
.
xxfc
.
platform
.
user
.
behavior
.
rest
.
admin
;
import
com.xxfc.platform.user.behavior.biz.CustomerBehaviorNotesBiz
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @author libin
* @version 1.0
* @description 用户行为日志*后台统计
* @data 2019/8/12 15:16
*/
@RestController
@RequestMapping
(
"/admin/customerBehaviorNotes"
)
@RequiredArgsConstructor
(
onConstructor
=
@__
(
@Autowired
))
public
class
CustomerBehaviorNotesAdminController
{
private
final
CustomerBehaviorNotesBiz
customerBehaviorNotesBiz
;
}
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