Commit 2152ccbd authored by libin's avatar libin

用户行为日志实体相关

parent f7e890d2
......@@ -9,4 +9,11 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>xx-user-behavior-api</artifactId>
<dependencies>
<dependency>
<groupId>com.xxfc.common</groupId>
<artifactId>xx-common-platform</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.xxfc.platform.user.behavior.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/8/12 14:13
*/
@Data
public class CustomerBehaviorNoteDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键id")
private Integer id;
@ApiModelProperty(value = "用户id")
private String customerId;
@ApiModelProperty(value = "1-游客;2-用户")
private Integer customerType;
/**
* 行为类型(见枚举)
*/
@ApiModelProperty(value = "行为类型(见枚举)")
private Integer type;
@ApiModelProperty(value = "类型id")
private Integer typeId;
}
package com.xxfc.platform.user.behavior.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
/**
* 用户行为记录表
*
* @author libin
* @email 18178966185@163.com
* @date 2019-08-12 14:03:55
*/
@Data
@Table(name = "customer_behavior_notes")
public class CustomerBehaviorNotes implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@Id
@GeneratedValue(generator = "JDBC")
@ApiModelProperty("主键id")
private Integer id;
/**
* 用户id
*/
@Column(name = "customer_id")
@ApiModelProperty(value = "用户id")
private String customerId;
/**
* 1-游客;2-用户
*/
@Column(name = "customer_type")
@ApiModelProperty(value = "1-游客;2-用户")
private Integer customerType;
/**
* 行为类型(见枚举)
*/
@Column(name = "type")
@ApiModelProperty(value = "行为类型(见枚举)")
private Integer type;
/**
* 类型id
*/
@Column(name = "type_id")
@ApiModelProperty(value = "类型id")
private Integer typeId;
/**
* 创建时间
*/
@Column(name = "crt_time")
@ApiModelProperty(value = "创建时间", hidden = true )
private Long crtTime;
}
......@@ -20,5 +20,10 @@
<artifactId>ace-admin-api</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.github.wxiaoqi</groupId>
<artifactId>xx-user-behavior-api</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.xxfc.platform.user.behavior.biz;
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;
/**
* 用户行为记录表
*
* @author libin
* @email 18178966185@163.com
* @date 2019-08-12 14:03:55
*/
@Service
public class CustomerBehaviorNotesBiz extends BaseBiz<CustomerBehaviorNotesMapper,CustomerBehaviorNotes> {
}
\ No newline at end of file
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;
import springfox.documentation.builders.ParameterBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.schema.ModelRef;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Parameter;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.ArrayList;
import java.util.List;
/**
* @Description : swagger配置配置
* @Author : Mars
* @Date : 2017年9月6日
*/
@Configuration
@EnableSwagger2
public class SwaggerConfig {
/**
* Every Docket bean is picked up by the swagger-mvc framework - allowing for multiple
* swagger groups i.e. same code base multiple swagger resource listings.
*/
@Bean
public Docket customDocket() {
ParameterBuilder ticketPar = new ParameterBuilder();
List<Parameter> pars = new ArrayList<Parameter>();
ticketPar.name("Authorization").description("user Authorization")
.modelRef(new ModelRef("string")).parameterType("header")
//header中的ticket参数非必填,传空也可以
.required(false).build();
//根据每个方法名也知道当前方法在设置什么参数
pars.add(ticketPar.build());
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage("com.xxfc.platform.activity.rest"))
//.apis(RequestHandlerSelectors.any())
.build()
.globalOperationParameters(pars)
.apiInfo(apiInfo());
}
ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("api swagger document")
.description("前后端联调swagger api 文档")
.version("2.1.5.5")
.build();
}
}
\ No newline at end of file
package com.xxfc.platform.user.behavior.config;
import com.github.wxiaoqi.security.common.handler.GlobalExceptionHandler;
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;
@Configuration("campsiteWebConfig")
@Primary
public class WebConfiguration implements WebMvcConfigurer {
@Bean
GlobalExceptionHandler getGlobalExceptionHandler() {
return new GlobalExceptionHandler();
}
}
package com.xxfc.platform.user.behavior.mapper;
import com.xxfc.platform.user.behavior.entity.CustomerBehaviorNotes;
import tk.mybatis.mapper.common.Mapper;
/**
* 用户行为记录表
*
* @author libin
* @email 18178966185@163.com
* @date 2019-08-12 14:03:55
*/
public interface CustomerBehaviorNotesMapper extends Mapper<CustomerBehaviorNotes> {
}
package com.xxfc.platform.user.behavior.rest;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.xxfc.platform.user.behavior.biz.CustomerBehaviorNotesBiz;
import com.xxfc.platform.user.behavior.entity.CustomerBehaviorNotes;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/8/12 14:14
*/
@RestController
@RequestMapping("customerBehaviorNotes")
public class CustomerBehaviorNotesController extends BaseController<CustomerBehaviorNotesBiz,CustomerBehaviorNotes> {
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xxfc.platform.user.behavior.mapper.CustomerBehaviorNotesMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="com.xxfc.platform.user.behavior.entity.CustomerBehaviorNotes" id="customerBehaviorNotesMap">
<result property="id" column="id"/>
<result property="customerId" column="customer_id"/>
<result property="customerType" column="customer_type"/>
<result property="type" column="type"/>
<result property="typeId" column="type_id"/>
<result property="crtTime" column="crt_time"/>
</resultMap>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment