From 364a038d1438d6558b7e6c60d3946ad340167b44 Mon Sep 17 00:00:00 2001 From: Bunny <1319900154@qq.com> Date: Fri, 18 Oct 2024 22:25:41 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=94=9F=E6=88=90=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=97=A5=E5=BF=97=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/bunny/dao/entity/log/UserLoginLog.java | 44 +++++++++++++++++++ .../controller/UserLoginLogController.java | 18 ++++++++ .../services/mapper/UserLoginLogMapper.java | 18 ++++++++ .../services/service/UserLoginLogService.java | 16 +++++++ .../service/impl/UserLoginLogServiceImpl.java | 20 +++++++++ .../resources/mapper/UserLoginLogMapper.xml | 26 +++++++++++ 6 files changed, 142 insertions(+) create mode 100644 dao/src/main/java/cn/bunny/dao/entity/log/UserLoginLog.java create mode 100644 service/src/main/java/cn/bunny/services/controller/UserLoginLogController.java create mode 100644 service/src/main/java/cn/bunny/services/mapper/UserLoginLogMapper.java create mode 100644 service/src/main/java/cn/bunny/services/service/UserLoginLogService.java create mode 100644 service/src/main/java/cn/bunny/services/service/impl/UserLoginLogServiceImpl.java create mode 100644 service/src/main/resources/mapper/UserLoginLogMapper.xml diff --git a/dao/src/main/java/cn/bunny/dao/entity/log/UserLoginLog.java b/dao/src/main/java/cn/bunny/dao/entity/log/UserLoginLog.java new file mode 100644 index 0000000..22885b5 --- /dev/null +++ b/dao/src/main/java/cn/bunny/dao/entity/log/UserLoginLog.java @@ -0,0 +1,44 @@ +package cn.bunny.dao.entity.log; + +import cn.bunny.dao.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +/** + *
+ * 用户登录日志 + *
+ * + * @author Bunny + * @since 2024-10-18 + */ +@Getter +@Setter +@Accessors(chain = true) +@TableName("log_user_login") +@ApiModel(value = "UserLogin对象", description = "用户登录日志") +public class UserLoginLog extends BaseEntity { + + @ApiModelProperty("用户Id") + private Long userId; + + @ApiModelProperty("用户名") + private String username; + + @ApiModelProperty("登录token") + private String token; + + @ApiModelProperty("登录Ip") + private String ip; + + @ApiModelProperty("登录Ip地点") + private String ipAddress; + + @ApiModelProperty("登录时代理") + private String userAgent; + +} diff --git a/service/src/main/java/cn/bunny/services/controller/UserLoginLogController.java b/service/src/main/java/cn/bunny/services/controller/UserLoginLogController.java new file mode 100644 index 0000000..d5fe09c --- /dev/null +++ b/service/src/main/java/cn/bunny/services/controller/UserLoginLogController.java @@ -0,0 +1,18 @@ +package cn.bunny.services.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + *+ * 用户登录日志 前端控制器 + *
+ * + * @author Bunny + * @since 2024-10-18 + */ +@RestController +@RequestMapping("/userLogin") +public class UserLoginLogController { + +} diff --git a/service/src/main/java/cn/bunny/services/mapper/UserLoginLogMapper.java b/service/src/main/java/cn/bunny/services/mapper/UserLoginLogMapper.java new file mode 100644 index 0000000..406fda2 --- /dev/null +++ b/service/src/main/java/cn/bunny/services/mapper/UserLoginLogMapper.java @@ -0,0 +1,18 @@ +package cn.bunny.services.mapper; + +import cn.bunny.dao.entity.log.UserLoginLog; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *+ * 用户登录日志 Mapper 接口 + *
+ * + * @author Bunny + * @since 2024-10-18 + */ +@Mapper +public interface UserLoginLogMapper extends BaseMapper+ * 用户登录日志 服务类 + *
+ * + * @author Bunny + * @since 2024-10-18 + */ +public interface UserLoginLogService extends IService+ * 用户登录日志 服务实现类 + *
+ * + * @author Bunny + * @since 2024-10-18 + */ +@Service +public class UserLoginLogServiceImpl extends ServiceImpl