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 { + +} diff --git a/service/src/main/java/cn/bunny/services/service/UserLoginLogService.java b/service/src/main/java/cn/bunny/services/service/UserLoginLogService.java new file mode 100644 index 0000000..3e6599a --- /dev/null +++ b/service/src/main/java/cn/bunny/services/service/UserLoginLogService.java @@ -0,0 +1,16 @@ +package cn.bunny.services.service; + +import cn.bunny.dao.entity.log.UserLoginLog; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 用户登录日志 服务类 + *

+ * + * @author Bunny + * @since 2024-10-18 + */ +public interface UserLoginLogService extends IService { + +} diff --git a/service/src/main/java/cn/bunny/services/service/impl/UserLoginLogServiceImpl.java b/service/src/main/java/cn/bunny/services/service/impl/UserLoginLogServiceImpl.java new file mode 100644 index 0000000..9638bd9 --- /dev/null +++ b/service/src/main/java/cn/bunny/services/service/impl/UserLoginLogServiceImpl.java @@ -0,0 +1,20 @@ +package cn.bunny.services.service.impl; + +import cn.bunny.dao.entity.log.UserLoginLog; +import cn.bunny.services.mapper.UserLoginLogMapper; +import cn.bunny.services.service.UserLoginLogService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 用户登录日志 服务实现类 + *

+ * + * @author Bunny + * @since 2024-10-18 + */ +@Service +public class UserLoginLogServiceImpl extends ServiceImpl implements UserLoginLogService { + +} diff --git a/service/src/main/resources/mapper/UserLoginLogMapper.xml b/service/src/main/resources/mapper/UserLoginLogMapper.xml new file mode 100644 index 0000000..e324e8e --- /dev/null +++ b/service/src/main/resources/mapper/UserLoginLogMapper.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + id, user_id, username, token, ip, ip_address, user_agent, create_time, update_time, create_user, update_user, is_deleted + + +