feat(后端): 代码提交
parent
6ef08e4404
commit
34795a0ef7
|
@ -0,0 +1,76 @@
|
|||
package com.unisinsight.project.controller;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.unisinsight.project.entity.req.DeleteIdReq;
|
||||
import com.unisinsight.project.entity.req.DeviceReq;
|
||||
import com.unisinsight.project.entity.res.DeviceRes;
|
||||
import com.unisinsight.project.entity.res.PageResult;
|
||||
import com.unisinsight.project.exception.BaseErrorCode;
|
||||
import com.unisinsight.project.exception.Result;
|
||||
import com.unisinsight.project.service.DeviceService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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 javax.annotation.Resource;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @description: DeviceController
|
||||
* @author: rdpnr_puzhi
|
||||
* @create: 2025/08/07
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/nex/v1/device")
|
||||
@Api(tags = "终端Controller")
|
||||
public class DeviceController {
|
||||
|
||||
@Resource
|
||||
private DeviceService deviceService;
|
||||
|
||||
@ApiOperation(value = "终端新增")
|
||||
@PostMapping("/add")
|
||||
public Result<?> insertUser(@RequestBody DeviceReq deviceReq) {
|
||||
if (Objects.isNull(deviceReq)) {
|
||||
return Result.errorResult(BaseErrorCode.PARAMS_CHK_ERROR);
|
||||
}
|
||||
log.info("终端新增请求参数为:{}", JSONUtil.toJsonStr(deviceReq));
|
||||
return deviceService.insert(deviceReq);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "终端修改")
|
||||
@PostMapping("/update")
|
||||
public Result<?> updateUser(@RequestBody DeviceReq deviceReq) {
|
||||
if (Objects.isNull(deviceReq)) {
|
||||
return Result.errorResult(BaseErrorCode.PARAMS_CHK_ERROR);
|
||||
}
|
||||
log.info("终端修改请求参数为:{}", JSONUtil.toJsonStr(deviceReq));
|
||||
return deviceService.update(deviceReq);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "终端删除")
|
||||
@PostMapping("/delete")
|
||||
public Result<?> deleteUser(@RequestBody DeleteIdReq deleteIdReq) {
|
||||
if (Objects.isNull(deleteIdReq)) {
|
||||
return Result.errorResult(BaseErrorCode.PARAMS_CHK_ERROR);
|
||||
}
|
||||
log.info("终端删除请求参数为:{}", JSONUtil.toJsonStr(deleteIdReq));
|
||||
return deviceService.delete(deleteIdReq);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分页查询终端")
|
||||
@PostMapping("/select/page")
|
||||
public Result<PageResult<DeviceRes>> selectPageUser(@RequestBody DeviceReq deviceReq) {
|
||||
if (Objects.isNull(deviceReq)) {
|
||||
return Result.errorResult(BaseErrorCode.PARAMS_CHK_ERROR);
|
||||
}
|
||||
log.info("分页查询终端请求参数为:{}", JSONUtil.toJsonStr(deviceReq));
|
||||
return deviceService.selectPageUser(deviceReq);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package com.unisinsight.project.controller;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.unisinsight.project.entity.req.DeviceImageMappingReq;
|
||||
import com.unisinsight.project.entity.res.DeviceImageMappingRes;
|
||||
import com.unisinsight.project.exception.BaseErrorCode;
|
||||
import com.unisinsight.project.exception.Result;
|
||||
import com.unisinsight.project.service.DeviceImageMappingService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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 javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @description:
|
||||
* @author: rdpnr_puzhi
|
||||
* @create: 2025/08/07
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/nex/v1/device/image/mapping")
|
||||
@Api(tags = "终端镜像映射关系Controller")
|
||||
public class DeviceImageMappingController {
|
||||
|
||||
@Resource
|
||||
private DeviceImageMappingService deviceImageMappingService;
|
||||
|
||||
@ApiOperation(value = "终端镜像映射新增")
|
||||
@PostMapping("/add")
|
||||
public Result<?> insert(@RequestBody DeviceImageMappingReq deviceImageMappingReq) {
|
||||
if (Objects.isNull(deviceImageMappingReq)) {
|
||||
return Result.errorResult(BaseErrorCode.PARAMS_CHK_ERROR);
|
||||
}
|
||||
log.info("终端镜像映射新增请求参数为:{}", JSONUtil.toJsonStr(deviceImageMappingReq));
|
||||
return deviceImageMappingService.insert(deviceImageMappingReq);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "终端镜像映射查询")
|
||||
@PostMapping("/select")
|
||||
public Result<List<DeviceImageMappingRes>> select(@RequestBody DeviceImageMappingReq deviceImageMappingReq) {
|
||||
if (Objects.isNull(deviceImageMappingReq)) {
|
||||
return Result.errorResult(BaseErrorCode.PARAMS_CHK_ERROR);
|
||||
}
|
||||
log.info("终端镜像映射查询请求参数为:{}", JSONUtil.toJsonStr(deviceImageMappingReq));
|
||||
return deviceImageMappingService.select(deviceImageMappingReq);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
package com.unisinsight.project.controller;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.unisinsight.project.entity.req.DeviceUserMappingReq;
|
||||
import com.unisinsight.project.entity.req.DeviceUserReq;
|
||||
import com.unisinsight.project.entity.res.DeviceUserMappingRes;
|
||||
import com.unisinsight.project.entity.res.ImageRes;
|
||||
import com.unisinsight.project.exception.BaseErrorCode;
|
||||
import com.unisinsight.project.exception.Result;
|
||||
import com.unisinsight.project.service.DeviceUserMappingService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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 javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @description: DeviceUserMappingController
|
||||
* @author: rdpnr_puzhi
|
||||
* @create: 2025/08/07
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/nex/v1/device/user/mapping")
|
||||
@Api(tags = "终端用户映射关系Controller")
|
||||
public class DeviceUserMappingController {
|
||||
|
||||
@Resource
|
||||
private DeviceUserMappingService deviceUserMappingService;
|
||||
|
||||
@ApiOperation(value = "终端用户映射新增")
|
||||
@PostMapping("/add")
|
||||
public Result<?> insert(@RequestBody DeviceUserMappingReq deviceUserMappingReq) {
|
||||
if (Objects.isNull(deviceUserMappingReq)) {
|
||||
return Result.errorResult(BaseErrorCode.PARAMS_CHK_ERROR);
|
||||
}
|
||||
log.info("终端用户映射新增请求参数为:{}", JSONUtil.toJsonStr(deviceUserMappingReq));
|
||||
return deviceUserMappingService.insert(deviceUserMappingReq);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "终端用户映射查询")
|
||||
@PostMapping("/select")
|
||||
public Result<List<DeviceUserMappingRes>> select(@RequestBody DeviceUserMappingReq deviceUserMappingReq) {
|
||||
if (Objects.isNull(deviceUserMappingReq)) {
|
||||
return Result.errorResult(BaseErrorCode.PARAMS_CHK_ERROR);
|
||||
}
|
||||
log.info("终端用户映射查询请求参数为:{}", JSONUtil.toJsonStr(deviceUserMappingReq));
|
||||
return deviceUserMappingService.select(deviceUserMappingReq);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "用户登录")
|
||||
@PostMapping("/login")
|
||||
public Result<List<ImageRes>> loginUser(@RequestBody DeviceUserReq deviceUserReq) {
|
||||
if (Objects.isNull(deviceUserReq)) {
|
||||
return Result.errorResult(BaseErrorCode.PARAMS_CHK_ERROR);
|
||||
}
|
||||
log.info("用户登录请求参数为:{}", JSONUtil.toJsonStr(deviceUserReq));
|
||||
return deviceUserMappingService.loginUser(deviceUserReq);
|
||||
}
|
||||
|
||||
}
|
|
@ -27,11 +27,11 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||
public class FileChunkController {
|
||||
|
||||
// 临时目录,用于存储上传的分片
|
||||
@Value("${file.upload.temp-dir:${java.io.tmpdir}/chunked-uploads}")
|
||||
@Value("${file.upload.temp-dir:${file.upload.temp-dir}/chunked-uploads}")
|
||||
private String tempDir;
|
||||
|
||||
// 最终文件存储目录
|
||||
@Value("${file.upload.dir:${user.home}/uploads}")
|
||||
@Value("${file.upload.dir:${file.upload.dir}/uploads}")
|
||||
private String uploadDir;
|
||||
|
||||
// 存储每个文件的分片信息
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
package com.unisinsight.project.controller;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.unisinsight.project.entity.req.ImageReq;
|
||||
import com.unisinsight.project.entity.res.ImageRes;
|
||||
import com.unisinsight.project.entity.res.PageResult;
|
||||
import com.unisinsight.project.exception.BaseErrorCode;
|
||||
import com.unisinsight.project.exception.Result;
|
||||
import com.unisinsight.project.service.ImageService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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 javax.annotation.Resource;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @description:
|
||||
* @author: rdpnr_puzhi
|
||||
* @create: 2025/08/07
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/nex/v1/image")
|
||||
@Api(tags = "镜像Controller")
|
||||
public class ImageController {
|
||||
|
||||
@Resource
|
||||
private ImageService imageService;
|
||||
|
||||
@ApiOperation(value = "分页查询镜像")
|
||||
@PostMapping("/select/page")
|
||||
public Result<PageResult<ImageRes>> selectPage(@RequestBody ImageReq imageReq) {
|
||||
if (Objects.isNull(imageReq)) {
|
||||
return Result.errorResult(BaseErrorCode.PARAMS_CHK_ERROR);
|
||||
}
|
||||
log.info("分页查询镜像请求参数为:{}", JSONUtil.toJsonStr(imageReq));
|
||||
return imageService.selectPage(imageReq);
|
||||
}
|
||||
|
||||
}
|
|
@ -3,6 +3,8 @@ package com.unisinsight.project.controller;
|
|||
import cn.hutool.json.JSONUtil;
|
||||
import com.unisinsight.project.entity.req.DeleteIdReq;
|
||||
import com.unisinsight.project.entity.req.UserReq;
|
||||
import com.unisinsight.project.entity.res.PageResult;
|
||||
import com.unisinsight.project.entity.res.UserRes;
|
||||
import com.unisinsight.project.exception.BaseErrorCode;
|
||||
import com.unisinsight.project.exception.Result;
|
||||
import com.unisinsight.project.service.UserService;
|
||||
|
@ -18,7 +20,7 @@ import javax.annotation.Resource;
|
|||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @description:
|
||||
* @description: UserController
|
||||
* @author: rdpnr_puzhi
|
||||
* @create: 2025/08/06
|
||||
*/
|
||||
|
@ -64,7 +66,7 @@ public class UserController {
|
|||
|
||||
@ApiOperation(value = "分页查询用户")
|
||||
@PostMapping("/select/page")
|
||||
public Result<?> selectPageUser(@RequestBody UserReq userReq) {
|
||||
public Result<PageResult<UserRes>> selectPageUser(@RequestBody UserReq userReq) {
|
||||
if (Objects.isNull(userReq)) {
|
||||
return Result.errorResult(BaseErrorCode.PARAMS_CHK_ERROR);
|
||||
}
|
||||
|
@ -72,4 +74,5 @@ public class UserController {
|
|||
return userService.selectPageUser(userReq);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
package com.unisinsight.project.controller;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.unisinsight.project.entity.req.DeleteIdReq;
|
||||
import com.unisinsight.project.entity.req.UserDeviceGroupReq;
|
||||
import com.unisinsight.project.entity.res.UserDeviceGroupRes;
|
||||
import com.unisinsight.project.exception.BaseErrorCode;
|
||||
import com.unisinsight.project.exception.Result;
|
||||
import com.unisinsight.project.service.UserDeviceGroupService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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 javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @description: UserDeviceGroupController
|
||||
* @author: rdpnr_puzhi
|
||||
* @create: 2025/08/06
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/nex/v1/user/device/group")
|
||||
@Api(tags = "用户、终端分组Controller")
|
||||
public class UserDeviceGroupController {
|
||||
|
||||
@Resource
|
||||
private UserDeviceGroupService groupService;
|
||||
|
||||
@ApiOperation(value = "分组新增")
|
||||
@PostMapping("/add")
|
||||
public Result<?> insertUserDevice(@RequestBody UserDeviceGroupReq groupReq) {
|
||||
if (Objects.isNull(groupReq)) {
|
||||
return Result.errorResult(BaseErrorCode.PARAMS_CHK_ERROR);
|
||||
}
|
||||
log.info("分组新增请求参数为:{}", JSONUtil.toJsonStr(groupReq));
|
||||
return groupService.insert(groupReq);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分组删除")
|
||||
@PostMapping("/delete")
|
||||
public Result<?> deleteUserDevice(@RequestBody DeleteIdReq deleteIdReq) {
|
||||
if (Objects.isNull(deleteIdReq)) {
|
||||
return Result.errorResult(BaseErrorCode.PARAMS_CHK_ERROR);
|
||||
}
|
||||
log.info("分组删除请求参数为:{}", JSONUtil.toJsonStr(deleteIdReq));
|
||||
return groupService.delete(deleteIdReq);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分组查询")
|
||||
@PostMapping("/query")
|
||||
public Result<List<UserDeviceGroupRes>> queryUserDevice(@RequestBody UserDeviceGroupReq groupReq) {
|
||||
if (Objects.isNull(groupReq)) {
|
||||
return Result.errorResult(BaseErrorCode.PARAMS_CHK_ERROR);
|
||||
}
|
||||
log.info("分组查询请求参数为:{}", JSONUtil.toJsonStr(groupReq));
|
||||
return groupService.query(groupReq);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,95 +1,106 @@
|
|||
package com.unisinsight.project.entity.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName device
|
||||
*/
|
||||
@TableName(value ="device")
|
||||
@TableName(value = "device")
|
||||
@Data
|
||||
public class Device implements Serializable {
|
||||
/**
|
||||
*
|
||||
* ID
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
* 序列号
|
||||
*/
|
||||
@TableField(value = "device_id")
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
*
|
||||
* 终端名称
|
||||
*/
|
||||
@TableField(value = "device_name")
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
*
|
||||
* 分组ID
|
||||
*/
|
||||
@TableField(value = "device_group_id")
|
||||
private Long deviceGroupId;
|
||||
|
||||
/**
|
||||
*
|
||||
* 分组名称
|
||||
*/
|
||||
@TableField(value = "device_group_name")
|
||||
private String deviceGroupName;
|
||||
|
||||
/**
|
||||
*
|
||||
* 终端类型:1:VDI 3:VOI
|
||||
*/
|
||||
@TableField(value = "device_type")
|
||||
private Integer deviceType;
|
||||
|
||||
/**
|
||||
*
|
||||
* IP
|
||||
*/
|
||||
@TableField(value = "ip_addr")
|
||||
private String ipAddr;
|
||||
|
||||
/**
|
||||
*
|
||||
* mac
|
||||
*/
|
||||
@TableField(value = "mac_addr")
|
||||
private String macAddr;
|
||||
|
||||
/**
|
||||
*
|
||||
* 型号
|
||||
*/
|
||||
@TableField(value = "model")
|
||||
private String model;
|
||||
|
||||
/**
|
||||
*
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value = "create_time", fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(value = "create_user")
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
*
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(value = "update_user")
|
||||
private String updateUser;
|
||||
|
||||
/**
|
||||
*
|
||||
* 是否删除:0-否,1-删除
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(value = "deleted")
|
||||
private Integer deleted;
|
||||
|
||||
/**
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
@TableField(value = "description")
|
||||
private String description;
|
||||
|
||||
@TableField(exist = false)
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
package com.unisinsight.project.entity.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
@ -17,59 +14,70 @@ import java.util.Date;
|
|||
@Data
|
||||
public class DeviceImageMapping implements Serializable {
|
||||
/**
|
||||
*
|
||||
* ID
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
* 序列号
|
||||
*/
|
||||
@TableField(value = "device_id")
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
*
|
||||
* 终端分组ID
|
||||
*/
|
||||
@TableField(value = "device_group_id")
|
||||
private Long deviceGroupId;
|
||||
|
||||
/**
|
||||
*
|
||||
* 镜像ID
|
||||
*/
|
||||
@TableField(value = "image_id")
|
||||
private Long imageId;
|
||||
|
||||
/**
|
||||
*
|
||||
* 还原方式
|
||||
*/
|
||||
@TableField(value = "restore_type")
|
||||
private Integer restoreType;
|
||||
|
||||
/**
|
||||
*
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value = "create_time", fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(value = "create_user")
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
*
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(value = "update_user")
|
||||
private String updateUser;
|
||||
|
||||
/**
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
@TableField(value = "description")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
*
|
||||
* 是否删除:0-否,1-删除
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(value = "deleted")
|
||||
private Integer deleted;
|
||||
|
||||
@TableField(exist = false)
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
package com.unisinsight.project.entity.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
@ -17,61 +14,78 @@ import java.util.Date;
|
|||
@Data
|
||||
public class DeviceUserMapping implements Serializable {
|
||||
/**
|
||||
*
|
||||
* ID
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
* 序列号
|
||||
*/
|
||||
@TableField(value = "device_id")
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
*
|
||||
* 终端分组ID
|
||||
*/
|
||||
@TableField(value = "device_group_id")
|
||||
private Long deviceGroupId;
|
||||
|
||||
/**
|
||||
*
|
||||
* 用户分组ID
|
||||
*/
|
||||
@TableField(value = "user_group_id")
|
||||
private Long userGroupId;
|
||||
|
||||
/**
|
||||
*
|
||||
* 用户ID
|
||||
*/
|
||||
@TableField(value = "user_id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
*
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value = "create_time", fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(value = "create_user")
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
*
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(value = "update_user")
|
||||
private String updateUser;
|
||||
|
||||
/**
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
@TableField(value = "description")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
*
|
||||
* 是否删除:0-否,1-删除
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(value = "deleted")
|
||||
private Integer deleted;
|
||||
|
||||
/**
|
||||
* 类型: 1-用户,2-用户组
|
||||
*/
|
||||
@TableField(value = "type")
|
||||
private String type;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
|
@ -1,9 +1,6 @@
|
|||
package com.unisinsight.project.entity.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
@ -17,74 +14,88 @@ import java.util.Date;
|
|||
@Data
|
||||
public class Image implements Serializable {
|
||||
/**
|
||||
*
|
||||
* ID
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
* 镜像名
|
||||
*/
|
||||
@TableField(value = "image_name")
|
||||
private String imageName;
|
||||
|
||||
/**
|
||||
*
|
||||
* 镜像类型
|
||||
*/
|
||||
@TableField(value = "image_type")
|
||||
private Integer imageType;
|
||||
|
||||
/**
|
||||
*
|
||||
* 镜像状态
|
||||
*/
|
||||
@TableField(value = "image_status")
|
||||
private Integer imageStatus;
|
||||
|
||||
/**
|
||||
*
|
||||
* 镜像版本
|
||||
*/
|
||||
@TableField(value = "image_version")
|
||||
private String imageVersion;
|
||||
|
||||
/**
|
||||
*
|
||||
* 操作系统
|
||||
*/
|
||||
@TableField(value = "os_version")
|
||||
private String osVersion;
|
||||
|
||||
/**
|
||||
*
|
||||
* BT路径
|
||||
*/
|
||||
@TableField(value = "bt_path")
|
||||
private String btPath;
|
||||
|
||||
/**
|
||||
*
|
||||
* 镜像存储路径
|
||||
*/
|
||||
@TableField(value = "storage_path")
|
||||
private String storagePath;
|
||||
|
||||
/**
|
||||
*
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value = "create_time", fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(value = "create_user")
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
*
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(value = "update_user")
|
||||
private String updateUser;
|
||||
|
||||
/**
|
||||
*
|
||||
* 是否删除:0-否,1-删除
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(value = "deleted")
|
||||
private Integer deleted;
|
||||
|
||||
/**
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
@TableField(value = "description")
|
||||
private String description;
|
||||
|
||||
@TableField(exist = false)
|
||||
|
|
|
@ -7,103 +7,119 @@ import java.io.Serializable;
|
|||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName user
|
||||
*/
|
||||
@TableName(value ="\"user\"")
|
||||
@TableName(value = "\"user\"")
|
||||
@Data
|
||||
public class User implements Serializable {
|
||||
/**
|
||||
*
|
||||
* ID
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
* 用户组ID
|
||||
*/
|
||||
@TableField(value = "user_group_id")
|
||||
private Long userGroupId;
|
||||
|
||||
/**
|
||||
*
|
||||
* 用户名
|
||||
*/
|
||||
@TableField(value = "user_name")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
*
|
||||
* 密码
|
||||
*/
|
||||
@TableField(value = "password")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
*
|
||||
* 生日
|
||||
*/
|
||||
@TableField(value = "birthday")
|
||||
private String birthday;
|
||||
|
||||
/**
|
||||
*
|
||||
* 电话
|
||||
*/
|
||||
@TableField(value = "cell_phone")
|
||||
private String cellPhone;
|
||||
|
||||
/**
|
||||
*
|
||||
* 邮箱
|
||||
*/
|
||||
@TableField(value = "email")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
*
|
||||
* 性别
|
||||
*/
|
||||
|
||||
@TableField(value = "gender")
|
||||
private Integer gender;
|
||||
|
||||
/**
|
||||
*
|
||||
* 身份证
|
||||
*/
|
||||
@TableField(value = "identity_no")
|
||||
private String identityNo;
|
||||
|
||||
/**
|
||||
*
|
||||
* 优先级
|
||||
*/
|
||||
private Long priority;
|
||||
@TableField(value = "priority")
|
||||
private Integer priority;
|
||||
|
||||
/**
|
||||
*
|
||||
* 用户类型
|
||||
*/
|
||||
@TableField(value = "user_type")
|
||||
private Integer userType;
|
||||
|
||||
/**
|
||||
*
|
||||
* 状态
|
||||
*/
|
||||
@TableField(value = "status")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
*
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@TableField(value = "create_time", fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(value = "create_user")
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
*
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(value = "update_user")
|
||||
private String updateUser;
|
||||
|
||||
/**
|
||||
*
|
||||
* 是否删除:0-否,1-是
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(value = "deleted")
|
||||
private Integer deleted;
|
||||
|
||||
/**
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
@TableField(value = "description")
|
||||
private String description;
|
||||
|
||||
@TableField(exist = false)
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
package com.unisinsight.project.entity.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
@ -17,66 +14,83 @@ import java.util.Date;
|
|||
@Data
|
||||
public class UserDeviceGroup implements Serializable {
|
||||
/**
|
||||
*
|
||||
* ID
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
* 名称
|
||||
*/
|
||||
@TableField(value = "name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
*
|
||||
* 父级ID
|
||||
*/
|
||||
@TableField(value = "parent_id")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
*
|
||||
* 父级名称
|
||||
*/
|
||||
@TableField(value = "parent_name")
|
||||
private String parentName;
|
||||
|
||||
/**
|
||||
*
|
||||
* 当前路径
|
||||
*/
|
||||
@TableField(value = "index")
|
||||
private String index;
|
||||
|
||||
/**
|
||||
*
|
||||
* 类型: 1-用户,2-终端
|
||||
*/
|
||||
@TableField(value = "type")
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
*
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(value = "create_time", fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(value = "create_user")
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
*
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(value = "update_user")
|
||||
private String updateUser;
|
||||
|
||||
/**
|
||||
*
|
||||
* 全路径
|
||||
*/
|
||||
@TableField(value = "path")
|
||||
private String path;
|
||||
|
||||
/**
|
||||
*
|
||||
* 是否删除:0-否,1-删除
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(value = "deleted")
|
||||
private Integer deleted;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@TableField(value = "description")
|
||||
private String description;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
|
@ -5,7 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @description:
|
||||
* @description: DeleteIdReq
|
||||
* @author: rdpnr_puzhi
|
||||
* @create: 2025/08/06
|
||||
*/
|
||||
|
@ -13,6 +13,6 @@ import lombok.Data;
|
|||
@Data
|
||||
public class DeleteIdReq {
|
||||
|
||||
@ApiModelProperty(value = "ID", dataType = "Long")
|
||||
@ApiModelProperty(value = "id", dataType = "Long")
|
||||
public Long id;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
package com.unisinsight.project.entity.req;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @TableName device_image_mapping
|
||||
*/
|
||||
@ApiModel(value = "终端镜像映射关系")
|
||||
@Data
|
||||
public class DeviceImageMappingReq implements Serializable {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@ApiModelProperty("ID")
|
||||
@JsonProperty("id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 序列号
|
||||
*/
|
||||
@ApiModelProperty("序列号")
|
||||
@JsonProperty("device_id")
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 终端分组ID
|
||||
*/
|
||||
@ApiModelProperty("终端分组ID")
|
||||
@JsonProperty("device_group_id")
|
||||
private Long deviceGroupId;
|
||||
|
||||
/**
|
||||
* 镜像ID
|
||||
*/
|
||||
@ApiModelProperty("镜像ID")
|
||||
@JsonProperty("image_id")
|
||||
private Long imageId;
|
||||
|
||||
/**
|
||||
* 还原方式
|
||||
*/
|
||||
@ApiModelProperty("还原方式")
|
||||
@JsonProperty("restore_type")
|
||||
private Integer restoreType;
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,104 @@
|
|||
package com.unisinsight.project.entity.req;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @TableName device
|
||||
*/
|
||||
@ApiModel("终端请求类")
|
||||
@Data
|
||||
public class DeviceReq implements Serializable {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@ApiModelProperty("ID")
|
||||
@JsonProperty("id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 序列号
|
||||
*/
|
||||
@ApiModelProperty("序列号")
|
||||
@JsonProperty("device_id")
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 终端名称
|
||||
*/
|
||||
@ApiModelProperty("终端名称")
|
||||
@JsonProperty("device_name")
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 分组ID
|
||||
*/
|
||||
@ApiModelProperty("分组ID")
|
||||
@JsonProperty("device_group_id")
|
||||
private Long deviceGroupId;
|
||||
|
||||
/**
|
||||
* 分组名称
|
||||
*/
|
||||
@ApiModelProperty("分组名称")
|
||||
@JsonProperty("device_group_name")
|
||||
private String deviceGroupName;
|
||||
|
||||
/**
|
||||
* 终端类型:1:VDI 3:VOI
|
||||
*/
|
||||
@ApiModelProperty("终端类型:1:VDI 3:VOI")
|
||||
@JsonProperty("device_type")
|
||||
private Integer deviceType;
|
||||
|
||||
/**
|
||||
* IP
|
||||
*/
|
||||
@ApiModelProperty("IP")
|
||||
@JsonProperty("ip_addr")
|
||||
private String ipAddr;
|
||||
|
||||
/**
|
||||
* mac
|
||||
*/
|
||||
@ApiModelProperty("mac")
|
||||
@JsonProperty("mac_addr")
|
||||
private String macAddr;
|
||||
|
||||
/**
|
||||
* 型号
|
||||
*/
|
||||
@ApiModelProperty("型号")
|
||||
@JsonProperty("model")
|
||||
private String model;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@ApiModelProperty("描述")
|
||||
@JsonProperty("description")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 查询页
|
||||
*/
|
||||
@ApiModelProperty(value = "查询页", notes = "分页查询时再传", dataType = "Integer")
|
||||
@JsonProperty("page_num")
|
||||
private Integer pageNum;
|
||||
|
||||
|
||||
/**
|
||||
* 每页数量
|
||||
*/
|
||||
@ApiModelProperty(value = "每页数量", notes = "分页查询时再传", dataType = "Integer")
|
||||
@JsonProperty("page_size")
|
||||
private Integer pageSize;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
package com.unisinsight.project.entity.req;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @TableName device_user_mapping
|
||||
*/
|
||||
@ApiModel(value = "设备用户映射请求类")
|
||||
@Data
|
||||
public class DeviceUserMappingReq implements Serializable {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@ApiModelProperty("id")
|
||||
@JsonProperty("id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 序列号
|
||||
*/
|
||||
@ApiModelProperty("序列号")
|
||||
@JsonProperty("device_id")
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 终端分组ID
|
||||
*/
|
||||
@ApiModelProperty("终端分组ID")
|
||||
@JsonProperty("device_group_id")
|
||||
private Long deviceGroupId;
|
||||
|
||||
/**
|
||||
* 用户分组ID
|
||||
*/
|
||||
@ApiModelProperty("用户分组ID")
|
||||
@JsonProperty("user_group_id")
|
||||
private Long userGroupId;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@ApiModelProperty("用户ID")
|
||||
@JsonProperty("user_id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 类型: 1-用户,2-用户组
|
||||
*/
|
||||
@ApiModelProperty("类型: 1-用户,2-用户组")
|
||||
@JsonProperty("type")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@ApiModelProperty("描述")
|
||||
@JsonProperty("description")
|
||||
private String description;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.unisinsight.project.entity.req;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @description:
|
||||
* @author: rdpnr_puzhi
|
||||
* @create: 2025/08/07
|
||||
*/
|
||||
@ApiModel("用户登录请求类")
|
||||
@Data
|
||||
public class DeviceUserReq {
|
||||
|
||||
/**
|
||||
* 序列号
|
||||
*/
|
||||
@ApiModelProperty("序列号")
|
||||
@JsonProperty("device_id")
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@ApiModelProperty(value = "用户名", dataType = "String")
|
||||
@JsonProperty("user_name")
|
||||
private String userName;
|
||||
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@ApiModelProperty(value = "密码", dataType = "String")
|
||||
@JsonProperty("password")
|
||||
private String password;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,90 @@
|
|||
package com.unisinsight.project.entity.req;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @TableName image
|
||||
*/
|
||||
@ApiModel("镜像请求类")
|
||||
@Data
|
||||
public class ImageReq implements Serializable {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@ApiModelProperty("id")
|
||||
@JsonProperty("id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 镜像名
|
||||
*/
|
||||
@ApiModelProperty("镜像名")
|
||||
@JsonProperty("image_name")
|
||||
private String imageName;
|
||||
|
||||
/**
|
||||
* 镜像类型
|
||||
*/
|
||||
@ApiModelProperty("镜像类型")
|
||||
@JsonProperty("image_type")
|
||||
private Integer imageType;
|
||||
|
||||
/**
|
||||
* 镜像状态
|
||||
*/
|
||||
@ApiModelProperty("镜像状态")
|
||||
@JsonProperty("image_status")
|
||||
private Integer imageStatus;
|
||||
|
||||
/**
|
||||
* 镜像版本
|
||||
*/
|
||||
@ApiModelProperty("镜像版本")
|
||||
@JsonProperty("image_version")
|
||||
private String imageVersion;
|
||||
|
||||
/**
|
||||
* 操作系统
|
||||
*/
|
||||
@ApiModelProperty("操作系统")
|
||||
@JsonProperty("os_version")
|
||||
private String osVersion;
|
||||
|
||||
/**
|
||||
* BT路径
|
||||
*/
|
||||
@ApiModelProperty("BT路径")
|
||||
@JsonProperty("bt_path")
|
||||
private String btPath;
|
||||
|
||||
/**
|
||||
* 镜像存储路径
|
||||
*/
|
||||
@ApiModelProperty("镜像存储路径")
|
||||
@JsonProperty("storage_path")
|
||||
private String storagePath;
|
||||
|
||||
|
||||
/**
|
||||
* 查询页
|
||||
*/
|
||||
@ApiModelProperty(value = "查询页", notes = "分页查询时再传", dataType = "Integer")
|
||||
@JsonProperty("page_num")
|
||||
private Integer pageNum;
|
||||
|
||||
|
||||
/**
|
||||
* 每页数量
|
||||
*/
|
||||
@ApiModelProperty(value = "每页数量", notes = "分页查询时再传", dataType = "Integer")
|
||||
@JsonProperty("page_size")
|
||||
private Integer pageSize;
|
||||
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
package com.unisinsight.project.entity.req;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @TableName user_device_group
|
||||
*/
|
||||
@ApiModel("分组请求类")
|
||||
@Data
|
||||
public class UserDeviceGroupReq implements Serializable {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@ApiModelProperty("ID")
|
||||
private Long id;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ApiModelProperty("名称")
|
||||
private String name;
|
||||
/**
|
||||
* 父级ID
|
||||
*/
|
||||
@ApiModelProperty("父级ID")
|
||||
@JsonProperty("parent_id")
|
||||
private Long parentId;
|
||||
/**
|
||||
* 父级名称
|
||||
*/
|
||||
@ApiModelProperty("父级名称")
|
||||
@JsonProperty("parent_name")
|
||||
private String parentName;
|
||||
/**
|
||||
* 当前路径
|
||||
*/
|
||||
@ApiModelProperty("当前路径")
|
||||
private String index;
|
||||
/**
|
||||
* 类型: 1-用户,2-终端
|
||||
*/
|
||||
@ApiModelProperty(value = "类型", notes = "1-用户,2-终端")
|
||||
private Integer type;
|
||||
/**
|
||||
* 全路径
|
||||
*/
|
||||
@ApiModelProperty("全路径")
|
||||
private String path;
|
||||
/**
|
||||
* 查询页
|
||||
*/
|
||||
@ApiModelProperty(value = "查询页", notes = "分页查询时再传", dataType = "Integer")
|
||||
@JsonProperty("page_num")
|
||||
private Integer pageNum;
|
||||
|
||||
/**
|
||||
* 每页数量
|
||||
*/
|
||||
@ApiModelProperty(value = "每页数量", notes = "分页查询时再传", dataType = "Integer")
|
||||
@JsonProperty("page_size")
|
||||
private Integer pageSize;
|
||||
|
||||
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package com.unisinsight.project.entity.req;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
@ -9,7 +10,7 @@ import java.io.Serializable;
|
|||
/**
|
||||
* @TableName user
|
||||
*/
|
||||
@ApiModel("用户新增类")
|
||||
@ApiModel("用户请求类")
|
||||
@Data
|
||||
public class UserReq implements Serializable {
|
||||
|
||||
|
@ -17,85 +18,112 @@ public class UserReq implements Serializable {
|
|||
* ID
|
||||
*/
|
||||
@ApiModelProperty(value = "ID", dataType = "Long")
|
||||
@JsonProperty("id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户组ID
|
||||
*/
|
||||
@ApiModelProperty(value = "用户组ID", dataType = "Long")
|
||||
@JsonProperty("user_group_id")
|
||||
private Long userGroupId;
|
||||
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@ApiModelProperty(value = "用户名", dataType = "String")
|
||||
@JsonProperty("user_name")
|
||||
private String userName;
|
||||
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@ApiModelProperty(value = "密码", dataType = "String")
|
||||
@JsonProperty("password")
|
||||
private String password;
|
||||
|
||||
|
||||
/**
|
||||
* 生日
|
||||
*/
|
||||
@ApiModelProperty(value = "生日", dataType = "String")
|
||||
@JsonProperty("birthday")
|
||||
private String birthday;
|
||||
|
||||
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
@ApiModelProperty(value = "电话", dataType = "String")
|
||||
@JsonProperty("cell_phone")
|
||||
private String cellPhone;
|
||||
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@ApiModelProperty(value = "邮箱", dataType = "String")
|
||||
@JsonProperty("email")
|
||||
private String email;
|
||||
|
||||
|
||||
/**
|
||||
* 身份证
|
||||
* 性别
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "身份证", dataType = "Integer")
|
||||
@ApiModelProperty(value = "性别", dataType = "Integer")
|
||||
@JsonProperty("gender")
|
||||
private Integer gender;
|
||||
|
||||
|
||||
/**
|
||||
* 身份证
|
||||
*/
|
||||
@ApiModelProperty(value = "身份证", dataType = "String")
|
||||
@JsonProperty("identity_no")
|
||||
private String identityNo;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 优先级
|
||||
*/
|
||||
@ApiModelProperty(value = "暂时不清楚", dataType = "Integer")
|
||||
@ApiModelProperty(value = "优先级", dataType = "Integer")
|
||||
@JsonProperty("priority")
|
||||
private Integer priority;
|
||||
|
||||
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
@ApiModelProperty(value = "用户类型", dataType = "Integer")
|
||||
@JsonProperty("user_type")
|
||||
private Integer userType;
|
||||
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@ApiModelProperty(value = "状态", dataType = "Integer")
|
||||
@JsonProperty("status")
|
||||
private Integer status;
|
||||
|
||||
|
||||
/**
|
||||
* 查询页
|
||||
*/
|
||||
@ApiModelProperty(value = "查询页", notes = "分页查询时再传", dataType = "Integer")
|
||||
@JsonProperty("page_num")
|
||||
private Integer pageNum;
|
||||
|
||||
|
||||
/**
|
||||
* 每页数量
|
||||
*/
|
||||
@ApiModelProperty(value = "每页数量", notes = "分页查询时再传", dataType = "Integer")
|
||||
@JsonProperty("page_size")
|
||||
private Integer pageSize;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package com.unisinsight.project.entity.res;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @TableName device_image_mapping
|
||||
*/
|
||||
@Data
|
||||
public class DeviceImageMappingRes implements Serializable {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@ApiModelProperty("ID")
|
||||
@JsonProperty("id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 序列号
|
||||
*/
|
||||
@ApiModelProperty("序列号")
|
||||
@JsonProperty("device_id")
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 终端分组ID
|
||||
*/
|
||||
@ApiModelProperty("终端分组ID")
|
||||
@JsonProperty("device_group_id")
|
||||
private Long deviceGroupId;
|
||||
|
||||
/**
|
||||
* 镜像ID
|
||||
*/
|
||||
@ApiModelProperty("镜像ID")
|
||||
@JsonProperty("image_id")
|
||||
private Long imageId;
|
||||
|
||||
/**
|
||||
* 还原方式
|
||||
*/
|
||||
@ApiModelProperty("还原方式")
|
||||
@JsonProperty("restore_type")
|
||||
private Integer restoreType;
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
package com.unisinsight.project.entity.res;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @TableName device
|
||||
*/
|
||||
@ApiModel("终端响应类")
|
||||
@Data
|
||||
public class DeviceRes implements Serializable {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@ApiModelProperty("id")
|
||||
@JsonProperty("id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 序列号
|
||||
*/
|
||||
@ApiModelProperty("序列号")
|
||||
@JsonProperty("device_id")
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 终端名称
|
||||
*/
|
||||
@ApiModelProperty("终端名称")
|
||||
@JsonProperty("device_name")
|
||||
private String deviceName;
|
||||
|
||||
/**
|
||||
* 分组ID
|
||||
*/
|
||||
@ApiModelProperty("分组ID")
|
||||
@JsonProperty("device_group_id")
|
||||
private Long deviceGroupId;
|
||||
|
||||
/**
|
||||
* 分组名称
|
||||
*/
|
||||
@ApiModelProperty("分组名称")
|
||||
@JsonProperty("device_group_name")
|
||||
private String deviceGroupName;
|
||||
|
||||
/**
|
||||
* 终端类型:1:VDI 3:VOI
|
||||
*/
|
||||
@ApiModelProperty("终端类型:1:VDI 3:VOI")
|
||||
@JsonProperty("device_type")
|
||||
private Integer deviceType;
|
||||
|
||||
/**
|
||||
* IP
|
||||
*/
|
||||
@ApiModelProperty("IP")
|
||||
@JsonProperty("ip_addr")
|
||||
private String ipAddr;
|
||||
|
||||
/**
|
||||
* mac
|
||||
*/
|
||||
@ApiModelProperty("mac")
|
||||
@JsonProperty("mac_addr")
|
||||
private String macAddr;
|
||||
|
||||
/**
|
||||
* 型号
|
||||
*/
|
||||
@ApiModelProperty("型号")
|
||||
@JsonProperty("model")
|
||||
private String model;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@ApiModelProperty("描述")
|
||||
@JsonProperty("description")
|
||||
private String description;
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
package com.unisinsight.project.entity.res;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @TableName device_user_mapping
|
||||
*/
|
||||
@ApiModel(value = "设备用户映射响应类")
|
||||
@Data
|
||||
public class DeviceUserMappingRes implements Serializable {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@ApiModelProperty("id")
|
||||
@JsonProperty("id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 序列号
|
||||
*/
|
||||
@ApiModelProperty("序列号")
|
||||
@JsonProperty("device_id")
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 终端分组ID
|
||||
*/
|
||||
@ApiModelProperty("终端分组ID")
|
||||
@JsonProperty("device_group_id")
|
||||
private Long deviceGroupId;
|
||||
|
||||
/**
|
||||
* 用户分组ID
|
||||
*/
|
||||
@ApiModelProperty("用户分组ID")
|
||||
@JsonProperty("user_group_id")
|
||||
private Long userGroupId;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@ApiModelProperty("用户ID")
|
||||
@JsonProperty("user_id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 类型: 1-用户,2-用户组
|
||||
*/
|
||||
@ApiModelProperty("类型: 1-用户,2-用户组")
|
||||
@JsonProperty("type")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@ApiModelProperty("描述")
|
||||
@JsonProperty("description")
|
||||
private String description;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package com.unisinsight.project.entity.res;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @TableName image
|
||||
*/
|
||||
@ApiModel("镜像响应类")
|
||||
@Data
|
||||
public class ImageRes implements Serializable {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@ApiModelProperty("id")
|
||||
@JsonProperty("id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 镜像名
|
||||
*/
|
||||
@ApiModelProperty("镜像名")
|
||||
@JsonProperty("image_name")
|
||||
private String imageName;
|
||||
|
||||
/**
|
||||
* 镜像类型
|
||||
*/
|
||||
@ApiModelProperty("镜像类型")
|
||||
@JsonProperty("image_type")
|
||||
private Integer imageType;
|
||||
|
||||
/**
|
||||
* 镜像状态
|
||||
*/
|
||||
@ApiModelProperty("镜像状态")
|
||||
@JsonProperty("image_status")
|
||||
private Integer imageStatus;
|
||||
|
||||
/**
|
||||
* 镜像版本
|
||||
*/
|
||||
@ApiModelProperty("镜像版本")
|
||||
@JsonProperty("image_version")
|
||||
private String imageVersion;
|
||||
|
||||
/**
|
||||
* 操作系统
|
||||
*/
|
||||
@ApiModelProperty("操作系统")
|
||||
@JsonProperty("os_version")
|
||||
private String osVersion;
|
||||
|
||||
/**
|
||||
* BT路径
|
||||
*/
|
||||
@ApiModelProperty("BT路径")
|
||||
@JsonProperty("bt_path")
|
||||
private String btPath;
|
||||
|
||||
/**
|
||||
* 镜像存储路径
|
||||
*/
|
||||
@ApiModelProperty("镜像存储路径")
|
||||
@JsonProperty("storage_path")
|
||||
private String storagePath;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package com.unisinsight.project.entity.res;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description:
|
||||
* @author: rdpnr_puzhi
|
||||
* @create: 2025/08/07
|
||||
*/
|
||||
@ApiModel("分页结果类")
|
||||
@Data
|
||||
public class PageResult<T1> {
|
||||
// 当前页码
|
||||
@ApiModelProperty("当前页码")
|
||||
private long current;
|
||||
// 每页记录数
|
||||
@ApiModelProperty("每页记录数")
|
||||
private long size;
|
||||
// 总记录数
|
||||
@ApiModelProperty("总记录数")
|
||||
private long total;
|
||||
// 总页数
|
||||
@ApiModelProperty("总页数")
|
||||
private long pages;
|
||||
// 数据列表
|
||||
@ApiModelProperty("数据列表")
|
||||
private List<T1> records;
|
||||
|
||||
// 转换方法
|
||||
public static <T, T1> PageResult<T1> convertIPage(IPage<T> page, Class<T1> clazz) {
|
||||
PageResult<T1> result = new PageResult<>();
|
||||
result.setCurrent(page.getCurrent());
|
||||
result.setSize(page.getSize());
|
||||
result.setTotal(page.getTotal());
|
||||
result.setPages(page.getPages());
|
||||
List<T1> copyToList = BeanUtil.copyToList(page.getRecords(), clazz);
|
||||
result.setRecords(copyToList);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static <T, T1> PageResult<T1> convertPage(Page<T> page, Class<T1> clazz) {
|
||||
PageResult<T1> result = new PageResult<>();
|
||||
result.setCurrent(page.getCurrent());
|
||||
result.setSize(page.getSize());
|
||||
result.setTotal(page.getTotal());
|
||||
result.setPages(page.getPages());
|
||||
List<T1> copyToList = BeanUtil.copyToList(page.getRecords(), clazz);
|
||||
result.setRecords(copyToList);
|
||||
return result;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package com.unisinsight.project.entity.res;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @TableName user_device_group
|
||||
*/
|
||||
@ApiModel("分组响应类")
|
||||
@Data
|
||||
public class UserDeviceGroupRes implements Serializable {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@ApiModelProperty("ID")
|
||||
private Long id;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ApiModelProperty("名称")
|
||||
private String name;
|
||||
/**
|
||||
* 父级ID
|
||||
*/
|
||||
@ApiModelProperty("父级ID")
|
||||
@JsonProperty("parent_id")
|
||||
private Long parentId;
|
||||
/**
|
||||
* 父级名称
|
||||
*/
|
||||
@ApiModelProperty("父级名称")
|
||||
@JsonProperty("parent_name")
|
||||
private String parentName;
|
||||
/**
|
||||
* 当前路径
|
||||
*/
|
||||
@ApiModelProperty("当前路径")
|
||||
private String index;
|
||||
/**
|
||||
* 类型: 1-用户,2-终端
|
||||
*/
|
||||
@ApiModelProperty("类型")
|
||||
private Integer type;
|
||||
/**
|
||||
* 全路径
|
||||
*/
|
||||
@ApiModelProperty("全路径")
|
||||
private String path;
|
||||
|
||||
@JsonProperty("children")
|
||||
@ApiModelProperty("下级数据")
|
||||
private List<UserDeviceGroupRes> children;
|
||||
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package com.unisinsight.project.entity.res;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
@ -16,73 +17,97 @@ public class UserRes implements Serializable {
|
|||
* ID
|
||||
*/
|
||||
@ApiModelProperty(value = "ID", dataType = "Long")
|
||||
@JsonProperty("id")
|
||||
private Long id;
|
||||
|
||||
|
||||
/**
|
||||
* 用户组ID
|
||||
*/
|
||||
@ApiModelProperty(value = "用户组ID", dataType = "Long")
|
||||
@JsonProperty("user_group_id")
|
||||
private Long userGroupId;
|
||||
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@ApiModelProperty(value = "用户名", dataType = "String")
|
||||
@JsonProperty("user_name")
|
||||
private String userName;
|
||||
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@ApiModelProperty(value = "密码", dataType = "String")
|
||||
@JsonProperty("password")
|
||||
private String password;
|
||||
|
||||
|
||||
/**
|
||||
* 生日
|
||||
*/
|
||||
@ApiModelProperty(value = "生日", dataType = "String")
|
||||
@JsonProperty("birthday")
|
||||
private String birthday;
|
||||
|
||||
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
@ApiModelProperty(value = "电话", dataType = "String")
|
||||
@JsonProperty("cell_phone")
|
||||
private String cellPhone;
|
||||
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@ApiModelProperty(value = "邮箱", dataType = "String")
|
||||
@JsonProperty("email")
|
||||
private String email;
|
||||
|
||||
|
||||
/**
|
||||
* 身份证
|
||||
* 性别
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "身份证", dataType = "Integer")
|
||||
@ApiModelProperty(value = "性别", dataType = "Integer")
|
||||
@JsonProperty("gender")
|
||||
private Integer gender;
|
||||
|
||||
|
||||
/**
|
||||
* 身份证
|
||||
*/
|
||||
@ApiModelProperty(value = "身份证", dataType = "String")
|
||||
@JsonProperty("identity_no")
|
||||
private String identityNo;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 优先级
|
||||
*/
|
||||
@ApiModelProperty(value = "", dataType = "Integer")
|
||||
@ApiModelProperty(value = "优先级", dataType = "Integer")
|
||||
@JsonProperty("priority")
|
||||
private Integer priority;
|
||||
|
||||
|
||||
/**
|
||||
* 用户类型
|
||||
*/
|
||||
@ApiModelProperty(value = "用户类型", dataType = "Integer")
|
||||
@JsonProperty("user_type")
|
||||
private Integer userType;
|
||||
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@ApiModelProperty(value = "状态", dataType = "Integer")
|
||||
@JsonProperty("status")
|
||||
private Integer status;
|
||||
|
||||
|
||||
}
|
|
@ -1,6 +1,8 @@
|
|||
package com.unisinsight.project.exception;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
|
@ -10,23 +12,27 @@ import lombok.Data;
|
|||
* @since 1.0
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("返回结果类")
|
||||
public class Result<T> implements ErrorCode {
|
||||
|
||||
/**
|
||||
* 返回码
|
||||
*/
|
||||
@ApiModelProperty("返回码")
|
||||
@JsonProperty(value = "error_code")
|
||||
private String errorCode;
|
||||
|
||||
/**
|
||||
* 返回信息
|
||||
*/
|
||||
@ApiModelProperty("返回信息")
|
||||
@JsonProperty(value = "message")
|
||||
private String message;
|
||||
|
||||
/**
|
||||
* 返回数据
|
||||
*/
|
||||
@ApiModelProperty("返回数据")
|
||||
@JsonProperty(value = "data")
|
||||
private T data;
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package com.unisinsight.project.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.unisinsight.project.entity.dao.DeviceImageMapping;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author rdpnr_puzhi
|
||||
* @description 针对表【device_image_mapping】的数据库操作Mapper
|
||||
* @createDate 2025-08-06 11:07:16
|
||||
* @createDate 2025-08-06 18:44:32
|
||||
* @Entity com.unisinsight.project.entity.DeviceImageMapping
|
||||
*/
|
||||
public interface DeviceImageMappingMapper extends BaseMapper<DeviceImageMapping> {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package com.unisinsight.project.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.unisinsight.project.entity.dao.Device;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author rdpnr_puzhi
|
||||
* @description 针对表【device】的数据库操作Mapper
|
||||
* @createDate 2025-08-06 11:04:49
|
||||
* @createDate 2025-08-06 18:37:55
|
||||
* @Entity com.unisinsight.project.entity.Device
|
||||
*/
|
||||
public interface DeviceMapper extends BaseMapper<Device> {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package com.unisinsight.project.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.unisinsight.project.entity.dao.DeviceUserMapping;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author rdpnr_puzhi
|
||||
* @description 针对表【device_user_mapping】的数据库操作Mapper
|
||||
* @createDate 2025-08-06 11:07:39
|
||||
* @createDate 2025-08-06 18:45:24
|
||||
* @Entity com.unisinsight.project.entity.DeviceUserMapping
|
||||
*/
|
||||
public interface DeviceUserMappingMapper extends BaseMapper<DeviceUserMapping> {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package com.unisinsight.project.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.unisinsight.project.entity.dao.Image;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author rdpnr_puzhi
|
||||
* @description 针对表【image】的数据库操作Mapper
|
||||
* @createDate 2025-08-06 11:12:22
|
||||
* @createDate 2025-08-06 18:46:15
|
||||
* @Entity com.unisinsight.project.entity.Image
|
||||
*/
|
||||
public interface ImageMapper extends BaseMapper<Image> {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package com.unisinsight.project.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.unisinsight.project.entity.dao.UserDeviceGroup;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author rdpnr_puzhi
|
||||
* @description 针对表【user_device_group】的数据库操作Mapper
|
||||
* @createDate 2025-08-06 10:52:20
|
||||
* @createDate 2025-08-06 18:46:45
|
||||
* @Entity com.unisinsight.project.entity.UserDeviceGroup
|
||||
*/
|
||||
public interface UserDeviceGroupMapper extends BaseMapper<UserDeviceGroup> {
|
||||
|
|
|
@ -2,12 +2,17 @@ package com.unisinsight.project.service;
|
|||
|
||||
import com.unisinsight.project.entity.dao.DeviceImageMapping;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.unisinsight.project.entity.req.DeviceImageMappingReq;
|
||||
import com.unisinsight.project.exception.Result;
|
||||
|
||||
/**
|
||||
* @author rdpnr_puzhi
|
||||
* @description 针对表【device_image_mapping】的数据库操作Service
|
||||
* @createDate 2025-08-06 11:07:16
|
||||
* @createDate 2025-08-06 18:44:32
|
||||
*/
|
||||
public interface DeviceImageMappingService extends IService<DeviceImageMapping> {
|
||||
|
||||
Result<?> insert(DeviceImageMappingReq deviceImageMappingReq);
|
||||
|
||||
Result select(DeviceImageMappingReq deviceImageMappingReq);
|
||||
}
|
||||
|
|
|
@ -2,12 +2,22 @@ package com.unisinsight.project.service;
|
|||
|
||||
import com.unisinsight.project.entity.dao.Device;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.unisinsight.project.entity.req.DeleteIdReq;
|
||||
import com.unisinsight.project.entity.req.DeviceReq;
|
||||
import com.unisinsight.project.exception.Result;
|
||||
|
||||
/**
|
||||
* @author rdpnr_puzhi
|
||||
* @description 针对表【device】的数据库操作Service
|
||||
* @createDate 2025-08-06 11:04:49
|
||||
* @createDate 2025-08-06 18:37:55
|
||||
*/
|
||||
public interface DeviceService extends IService<Device> {
|
||||
|
||||
Result<?> insert(DeviceReq deviceReq);
|
||||
|
||||
Result<?> update(DeviceReq deviceReq);
|
||||
|
||||
Result<?> delete(DeleteIdReq deleteIdReq);
|
||||
|
||||
Result selectPageUser(DeviceReq deviceReq);
|
||||
}
|
||||
|
|
|
@ -2,12 +2,20 @@ package com.unisinsight.project.service;
|
|||
|
||||
import com.unisinsight.project.entity.dao.DeviceUserMapping;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.unisinsight.project.entity.req.DeviceUserMappingReq;
|
||||
import com.unisinsight.project.entity.req.DeviceUserReq;
|
||||
import com.unisinsight.project.exception.Result;
|
||||
|
||||
/**
|
||||
* @author rdpnr_puzhi
|
||||
* @description 针对表【device_user_mapping】的数据库操作Service
|
||||
* @createDate 2025-08-06 11:07:39
|
||||
*/
|
||||
* @author rdpnr_puzhi
|
||||
* @description 针对表【device_user_mapping】的数据库操作Service
|
||||
* @createDate 2025-08-06 18:45:24
|
||||
*/
|
||||
public interface DeviceUserMappingService extends IService<DeviceUserMapping> {
|
||||
|
||||
Result<?> insert(DeviceUserMappingReq deviceUserMappingReq);
|
||||
|
||||
Result select(DeviceUserMappingReq deviceUserMappingReq);
|
||||
|
||||
Result loginUser(DeviceUserReq deviceUserReq);
|
||||
}
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
package com.unisinsight.project.service;
|
||||
|
||||
import com.unisinsight.project.entity.dao.Image;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.unisinsight.project.entity.dao.Image;
|
||||
import com.unisinsight.project.entity.req.ImageReq;
|
||||
import com.unisinsight.project.exception.Result;
|
||||
|
||||
/**
|
||||
* @author rdpnr_puzhi
|
||||
* @description 针对表【image】的数据库操作Service
|
||||
* @createDate 2025-08-06 11:12:22
|
||||
* @createDate 2025-08-06 18:46:15
|
||||
*/
|
||||
public interface ImageService extends IService<Image> {
|
||||
|
||||
Result selectPage(ImageReq imageReq);
|
||||
}
|
||||
|
|
|
@ -1,13 +1,21 @@
|
|||
package com.unisinsight.project.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.unisinsight.project.entity.dao.UserDeviceGroup;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.unisinsight.project.entity.req.DeleteIdReq;
|
||||
import com.unisinsight.project.entity.req.UserDeviceGroupReq;
|
||||
import com.unisinsight.project.exception.Result;
|
||||
|
||||
/**
|
||||
* @author rdpnr_puzhi
|
||||
* @description 针对表【user_device_group】的数据库操作Service
|
||||
* @createDate 2025-08-06 10:52:20
|
||||
*/
|
||||
* @author rdpnr_puzhi
|
||||
* @description 针对表【user_device_group】的数据库操作Service
|
||||
* @createDate 2025-08-06 18:46:45
|
||||
*/
|
||||
public interface UserDeviceGroupService extends IService<UserDeviceGroup> {
|
||||
|
||||
Result<?> insert(UserDeviceGroupReq groupReq);
|
||||
|
||||
Result<?> delete(DeleteIdReq deleteIdReq);
|
||||
|
||||
Result query(UserDeviceGroupReq groupReq);
|
||||
}
|
||||
|
|
|
@ -20,5 +20,5 @@ public interface UserService extends IService<User> {
|
|||
|
||||
Result<?> delete(DeleteIdReq deleteIdReq);
|
||||
|
||||
Result<?> selectPageUser(UserReq userReq);
|
||||
Result selectPageUser(UserReq userReq);
|
||||
}
|
||||
|
|
|
@ -1,20 +1,69 @@
|
|||
package com.unisinsight.project.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.unisinsight.project.entity.dao.DeviceImageMapping;
|
||||
import com.unisinsight.project.service.DeviceImageMappingService;
|
||||
import com.unisinsight.project.entity.req.DeviceImageMappingReq;
|
||||
import com.unisinsight.project.entity.res.DeviceImageMappingRes;
|
||||
import com.unisinsight.project.exception.BaseErrorCode;
|
||||
import com.unisinsight.project.exception.Result;
|
||||
import com.unisinsight.project.mapper.DeviceImageMappingMapper;
|
||||
import com.unisinsight.project.service.DeviceImageMappingService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author rdpnr_puzhi
|
||||
* @description 针对表【device_image_mapping】的数据库操作Service实现
|
||||
* @createDate 2025-08-06 11:07:16
|
||||
*/
|
||||
@Service
|
||||
public class DeviceImageMappingServiceImpl extends ServiceImpl<DeviceImageMappingMapper, DeviceImageMapping>
|
||||
implements DeviceImageMappingService{
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author rdpnr_puzhi
|
||||
* @description 针对表【device_image_mapping】的数据库操作Service实现
|
||||
* @createDate 2025-08-06 18:44:32
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DeviceImageMappingServiceImpl extends ServiceImpl<DeviceImageMappingMapper, DeviceImageMapping>
|
||||
implements DeviceImageMappingService {
|
||||
|
||||
@Resource
|
||||
private DeviceImageMappingMapper deviceImageMappingMapper;
|
||||
|
||||
@Override
|
||||
public Result<?> insert(DeviceImageMappingReq deviceImageMappingReq) {
|
||||
DeviceImageMapping deviceImageMapping = BeanUtil.copyProperties(deviceImageMappingReq, DeviceImageMapping.class);
|
||||
deviceImageMapping.setCreateUser("admin");
|
||||
int insert = deviceImageMappingMapper.insert(deviceImageMapping);
|
||||
log.info("终端镜像映射新增insert:{}", insert);
|
||||
if (insert == 1) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
return Result.errorResult(BaseErrorCode.HTTP_ERROR_CODE_500);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<?> select(DeviceImageMappingReq deviceImageMappingReq) {
|
||||
DeviceImageMapping deviceImageMapping = BeanUtil.copyProperties(deviceImageMappingReq, DeviceImageMapping.class);
|
||||
QueryWrapper<DeviceImageMapping> wrapper = new QueryWrapper<>();
|
||||
|
||||
wrapper.lambda().eq(DeviceImageMapping::getDeviceId, deviceImageMapping.getDeviceId());
|
||||
|
||||
if (ObjectUtil.isNotEmpty(deviceImageMapping.getDeviceGroupId())) {
|
||||
wrapper.lambda().eq(DeviceImageMapping::getDeviceGroupId, deviceImageMapping.getDeviceGroupId());
|
||||
}
|
||||
List<DeviceImageMapping> deviceUserMappings = deviceImageMappingMapper.selectList(wrapper);
|
||||
log.info("终端镜像映射查询结果:{}", JSONUtil.toJsonStr(deviceUserMappings));
|
||||
if (CollectionUtil.isEmpty(deviceUserMappings)) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
List<DeviceImageMappingRes> deviceImageMappingRes = BeanUtil.copyToList(deviceUserMappings, DeviceImageMappingRes.class);
|
||||
return Result.successResult(deviceImageMappingRes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,20 +1,109 @@
|
|||
package com.unisinsight.project.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.unisinsight.project.entity.dao.Device;
|
||||
import com.unisinsight.project.service.DeviceService;
|
||||
import com.unisinsight.project.entity.req.DeleteIdReq;
|
||||
import com.unisinsight.project.entity.req.DeviceReq;
|
||||
import com.unisinsight.project.entity.res.DeviceRes;
|
||||
import com.unisinsight.project.entity.res.PageResult;
|
||||
import com.unisinsight.project.exception.BaseErrorCode;
|
||||
import com.unisinsight.project.exception.Result;
|
||||
import com.unisinsight.project.mapper.DeviceMapper;
|
||||
import com.unisinsight.project.service.DeviceService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author rdpnr_puzhi
|
||||
* @description 针对表【device】的数据库操作Service实现
|
||||
* @createDate 2025-08-06 11:04:49
|
||||
*/
|
||||
@Service
|
||||
public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device>
|
||||
implements DeviceService{
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author rdpnr_puzhi
|
||||
* @description 针对表【device】的数据库操作Service实现
|
||||
* @createDate 2025-08-06 18:37:55
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device>
|
||||
implements DeviceService {
|
||||
|
||||
@Resource
|
||||
private DeviceMapper deviceMapper;
|
||||
|
||||
@Override
|
||||
public Result<?> insert(DeviceReq deviceReq) {
|
||||
Device device = BeanUtil.copyProperties(deviceReq, Device.class);
|
||||
device.setCreateUser("admin");
|
||||
int insert = deviceMapper.insert(device);
|
||||
log.info("终端新增insert:{}", insert);
|
||||
if (insert == 1) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
return Result.errorResult(BaseErrorCode.HTTP_ERROR_CODE_500);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<?> update(DeviceReq deviceReq) {
|
||||
Device device = BeanUtil.copyProperties(deviceReq, Device.class);
|
||||
device.setUpdateUser("admin");
|
||||
int updated = deviceMapper.updateById(device);
|
||||
log.info("终端修改updated:{}", updated);
|
||||
if (updated == 1) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
return Result.errorResult(BaseErrorCode.HTTP_ERROR_CODE_500);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<?> delete(DeleteIdReq deleteIdReq) {
|
||||
int deleted = deviceMapper.deleteById(deleteIdReq.getId());
|
||||
log.info("终端删除insert:{}", deleted);
|
||||
if (deleted == 1) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
return Result.errorResult(BaseErrorCode.HTTP_ERROR_CODE_500);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<?> selectPageUser(DeviceReq deviceReq) {
|
||||
Page<Device> page = new Page<>(deviceReq.getPageNum(), deviceReq.getPageSize());
|
||||
QueryWrapper<Device> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
if (StringUtils.isNotBlank(deviceReq.getDeviceName())) {
|
||||
queryWrapper.lambda().eq(Device::getDeviceName, deviceReq.getDeviceName());
|
||||
}
|
||||
if (StringUtils.isNotBlank(deviceReq.getDeviceGroupName())) {
|
||||
queryWrapper.lambda().eq(Device::getDeviceGroupName, deviceReq.getDeviceGroupName());
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(deviceReq.getDeviceGroupId())) {
|
||||
queryWrapper.lambda().eq(Device::getDeviceGroupId, deviceReq.getDeviceGroupId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(deviceReq.getIpAddr())) {
|
||||
queryWrapper.lambda().like(Device::getIpAddr, deviceReq.getIpAddr());
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(deviceReq.getDeviceType())) {
|
||||
queryWrapper.lambda().like(Device::getDeviceType, deviceReq.getDeviceType());
|
||||
}
|
||||
|
||||
IPage<Device> userPage = deviceMapper.selectPage(page, queryWrapper);
|
||||
log.info("分页查询终端返回:{}", JSONUtil.toJsonStr(userPage));
|
||||
if (CollectionUtil.isEmpty(userPage.getRecords())) {
|
||||
log.info("分页查询终端返回为空");
|
||||
return Result.successResult();
|
||||
} else {
|
||||
PageResult<DeviceRes> convert = PageResult.convertIPage(userPage, DeviceRes.class);
|
||||
return Result.successResult(convert);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,20 +1,160 @@
|
|||
package com.unisinsight.project.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.unisinsight.project.entity.dao.DeviceImageMapping;
|
||||
import com.unisinsight.project.entity.dao.DeviceUserMapping;
|
||||
import com.unisinsight.project.service.DeviceUserMappingService;
|
||||
import com.unisinsight.project.entity.dao.Image;
|
||||
import com.unisinsight.project.entity.dao.User;
|
||||
import com.unisinsight.project.entity.req.DeviceUserMappingReq;
|
||||
import com.unisinsight.project.entity.req.DeviceUserReq;
|
||||
import com.unisinsight.project.entity.res.DeviceUserMappingRes;
|
||||
import com.unisinsight.project.entity.res.ImageRes;
|
||||
import com.unisinsight.project.exception.BaseErrorCode;
|
||||
import com.unisinsight.project.exception.Result;
|
||||
import com.unisinsight.project.mapper.DeviceImageMappingMapper;
|
||||
import com.unisinsight.project.mapper.DeviceUserMappingMapper;
|
||||
import com.unisinsight.project.mapper.ImageMapper;
|
||||
import com.unisinsight.project.mapper.UserMapper;
|
||||
import com.unisinsight.project.service.DeviceUserMappingService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author rdpnr_puzhi
|
||||
* @description 针对表【device_user_mapping】的数据库操作Service实现
|
||||
* @createDate 2025-08-06 11:07:39
|
||||
*/
|
||||
@Service
|
||||
public class DeviceUserMappingServiceImpl extends ServiceImpl<DeviceUserMappingMapper, DeviceUserMapping>
|
||||
implements DeviceUserMappingService{
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author rdpnr_puzhi
|
||||
* @description 针对表【device_user_mapping】的数据库操作Service实现
|
||||
* @createDate 2025-08-06 18:45:24
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DeviceUserMappingServiceImpl extends ServiceImpl<DeviceUserMappingMapper, DeviceUserMapping>
|
||||
implements DeviceUserMappingService {
|
||||
|
||||
@Resource
|
||||
private DeviceUserMappingMapper deviceUserMappingMapper;
|
||||
|
||||
@Resource
|
||||
private UserMapper userMapper;
|
||||
|
||||
@Resource
|
||||
private ImageMapper imageMapper;
|
||||
|
||||
@Resource
|
||||
private DeviceImageMappingMapper deviceImageMappingMapper;
|
||||
|
||||
@Override
|
||||
public Result<?> insert(DeviceUserMappingReq deviceUserMappingReq) {
|
||||
DeviceUserMapping deviceUserMapping = BeanUtil.copyProperties(deviceUserMappingReq, DeviceUserMapping.class);
|
||||
deviceUserMapping.setCreateUser("admin");
|
||||
int insert = deviceUserMappingMapper.insert(deviceUserMapping);
|
||||
log.info("终端用户映射新增insert:{}", insert);
|
||||
if (insert == 1) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
return Result.errorResult(BaseErrorCode.HTTP_ERROR_CODE_500);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<?> select(DeviceUserMappingReq deviceUserMappingReq) {
|
||||
DeviceUserMapping deviceUserMapping = BeanUtil.copyProperties(deviceUserMappingReq, DeviceUserMapping.class);
|
||||
QueryWrapper<DeviceUserMapping> wrapper = new QueryWrapper<>();
|
||||
|
||||
wrapper.lambda().eq(DeviceUserMapping::getDeviceId, deviceUserMapping.getDeviceId());
|
||||
if (ObjectUtil.isNotEmpty(deviceUserMapping.getType())) {
|
||||
wrapper.lambda().eq(DeviceUserMapping::getType, deviceUserMapping.getType());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(deviceUserMapping.getDeviceGroupId())) {
|
||||
wrapper.lambda().eq(DeviceUserMapping::getDeviceGroupId, deviceUserMapping.getDeviceGroupId());
|
||||
}
|
||||
List<DeviceUserMapping> deviceUserMappings = deviceUserMappingMapper.selectList(wrapper);
|
||||
log.info("终端用户映射查询结果:{}", JSONUtil.toJsonStr(deviceUserMappings));
|
||||
if (CollectionUtil.isEmpty(deviceUserMappings)) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
List<DeviceUserMappingRes> deviceUserMappingRes = BeanUtil.copyToList(deviceUserMappings, DeviceUserMappingRes.class);
|
||||
return Result.successResult(deviceUserMappingRes);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Result<?> loginUser(DeviceUserReq deviceUserReq) {
|
||||
QueryWrapper<DeviceUserMapping> wrapper = new QueryWrapper<>();
|
||||
|
||||
wrapper.lambda().eq(DeviceUserMapping::getDeviceId, deviceUserReq.getDeviceId());
|
||||
|
||||
List<DeviceUserMapping> deviceUserMappings = deviceUserMappingMapper.selectList(wrapper);
|
||||
log.info("用户登录查询映射结果:{}", JSONUtil.toJsonStr(deviceUserMappings));
|
||||
List<User> users = new ArrayList<>();
|
||||
|
||||
List<Long> userIdList = deviceUserMappings.stream().map(DeviceUserMapping::getUserId).collect(Collectors.toList());
|
||||
log.info("用户登录查询用户id结果:{}", JSONUtil.toJsonStr(userIdList));
|
||||
if (CollectionUtil.isNotEmpty(userIdList)) {
|
||||
QueryWrapper<User> groupWrapper = new QueryWrapper<>();
|
||||
String userListStr = StringUtils.join(userIdList, ",");
|
||||
log.info("用户id结果:{}", JSONUtil.toJsonStr(userListStr));
|
||||
groupWrapper.lambda().in(User::getId, userListStr);
|
||||
List<User> userList = userMapper.selectList(groupWrapper);
|
||||
log.info("用户id查询结果:{}", JSONUtil.toJsonStr(userList));
|
||||
if (CollectionUtil.isNotEmpty(userList)) {
|
||||
User user = userList.stream().filter(e -> e.getUserName().equals(deviceUserReq.getUserName())).findAny().orElse(null);
|
||||
users.add(user);
|
||||
}
|
||||
|
||||
}
|
||||
List<Long> groupList = deviceUserMappings.stream().map(DeviceUserMapping::getUserGroupId).collect(Collectors.toList());
|
||||
log.info("用户登录查询用户组id结果:{}", JSONUtil.toJsonStr(groupList));
|
||||
if (CollectionUtil.isNotEmpty(groupList)) {
|
||||
QueryWrapper<User> groupWrapper = new QueryWrapper<>();
|
||||
String groupListStr = StringUtils.join(groupList, ",");
|
||||
log.info("用户组id结果:{}", JSONUtil.toJsonStr(groupListStr));
|
||||
groupWrapper.lambda().in(User::getUserGroupId, groupListStr);
|
||||
List<User> userDeviceGroups = userMapper.selectList(groupWrapper);
|
||||
log.info("用户组id查询结果:{}", JSONUtil.toJsonStr(userDeviceGroups));
|
||||
if (CollectionUtil.isNotEmpty(userDeviceGroups)) {
|
||||
User user = userDeviceGroups.stream().filter(e -> e.getUserName().equals(deviceUserReq.getUserName())).findAny().orElse(null);
|
||||
users.add(user);
|
||||
}
|
||||
}
|
||||
log.info("用户登录查询结果:{}", JSONUtil.toJsonStr(users));
|
||||
if (CollectionUtil.isEmpty(users)) {
|
||||
return Result.errorResultMessage(BaseErrorCode.PARAMS_CHK_ERROR, "用户不存在,请重试");
|
||||
}
|
||||
users = users.stream().distinct().collect(Collectors.toList());
|
||||
|
||||
if (!users.get(0).getPassword().equals(deviceUserReq.getPassword())) {
|
||||
return Result.errorResultMessage(BaseErrorCode.PARAMS_CHK_ERROR, "密码错误,请重新输入");
|
||||
}
|
||||
|
||||
QueryWrapper<DeviceImageMapping> deviceImageMappingQueryWrapper = new QueryWrapper<>();
|
||||
deviceImageMappingQueryWrapper.lambda().eq(DeviceImageMapping::getDeviceId, deviceUserReq.getDeviceId());
|
||||
List<DeviceImageMapping> deviceImageMappings = deviceImageMappingMapper.selectList(deviceImageMappingQueryWrapper);
|
||||
if (CollectionUtil.isEmpty(deviceImageMappings)) {
|
||||
return Result.errorResultMessage(BaseErrorCode.PARAMS_CHK_ERROR, "请先配置终端镜像");
|
||||
}
|
||||
List<Long> imageIdList = deviceImageMappings.stream().map(DeviceImageMapping::getImageId).collect(Collectors.toList());
|
||||
|
||||
QueryWrapper<Image> imageQueryWrapper = new QueryWrapper<>();
|
||||
String imageListStr = StringUtils.join(imageIdList, ",");
|
||||
log.info("用户登录查询镜像id结果:{}", JSONUtil.toJsonStr(imageListStr));
|
||||
imageQueryWrapper.lambda().in(Image::getId, imageListStr);
|
||||
List<Image> images = imageMapper.selectList(imageQueryWrapper);
|
||||
log.info("用户登录查询镜像结果:{}", JSONUtil.toJsonStr(images));
|
||||
List<ImageRes> imageRes = BeanUtil.copyToList(images, ImageRes.class);
|
||||
return Result.successResult(imageRes);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,20 +1,63 @@
|
|||
package com.unisinsight.project.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.unisinsight.project.entity.dao.Image;
|
||||
import com.unisinsight.project.service.ImageService;
|
||||
import com.unisinsight.project.entity.req.ImageReq;
|
||||
import com.unisinsight.project.entity.res.ImageRes;
|
||||
import com.unisinsight.project.entity.res.PageResult;
|
||||
import com.unisinsight.project.exception.Result;
|
||||
import com.unisinsight.project.mapper.ImageMapper;
|
||||
import com.unisinsight.project.service.ImageService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author rdpnr_puzhi
|
||||
* @description 针对表【image】的数据库操作Service实现
|
||||
* @createDate 2025-08-06 11:12:22
|
||||
*/
|
||||
@Service
|
||||
public class ImageServiceImpl extends ServiceImpl<ImageMapper, Image>
|
||||
implements ImageService{
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author rdpnr_puzhi
|
||||
* @description 针对表【image】的数据库操作Service实现
|
||||
* @createDate 2025-08-06 18:46:15
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ImageServiceImpl extends ServiceImpl<ImageMapper, Image>
|
||||
implements ImageService {
|
||||
|
||||
@Resource
|
||||
private ImageMapper imageMapper;
|
||||
|
||||
@Override
|
||||
public Result<?> selectPage(ImageReq imageReq) {
|
||||
Page<Image> page = new Page<>(imageReq.getPageNum(), imageReq.getPageSize());
|
||||
QueryWrapper<Image> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
if (ObjectUtils.isNotEmpty(imageReq.getId())) {
|
||||
queryWrapper.lambda().eq(Image::getId, imageReq.getId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(imageReq.getImageName())) {
|
||||
queryWrapper.lambda().like(Image::getImageName, imageReq.getImageName());
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(imageReq.getImageType())) {
|
||||
queryWrapper.lambda().like(Image::getImageType, imageReq.getImageType());
|
||||
}
|
||||
|
||||
IPage<Image> imageIPage = imageMapper.selectPage(page, queryWrapper);
|
||||
log.info("分页查询镜像返回:{}", JSONUtil.toJsonStr(imageIPage));
|
||||
if (CollectionUtil.isEmpty(imageIPage.getRecords())) {
|
||||
log.info("分页查询镜像返回为空");
|
||||
return Result.successResult();
|
||||
} else {
|
||||
PageResult<ImageRes> convert = PageResult.convertIPage(imageIPage, ImageRes.class);
|
||||
return Result.successResult(convert);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,19 +1,176 @@
|
|||
package com.unisinsight.project.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.unisinsight.project.entity.dao.UserDeviceGroup;
|
||||
import com.unisinsight.project.entity.req.DeleteIdReq;
|
||||
import com.unisinsight.project.entity.req.UserDeviceGroupReq;
|
||||
import com.unisinsight.project.entity.res.UserDeviceGroupRes;
|
||||
import com.unisinsight.project.exception.BaseErrorCode;
|
||||
import com.unisinsight.project.exception.Result;
|
||||
import com.unisinsight.project.mapper.UserDeviceGroupMapper;
|
||||
import com.unisinsight.project.service.UserDeviceGroupService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author rdpnr_puzhi
|
||||
* @description 针对表【user_device_group】的数据库操作Service实现
|
||||
* @createDate 2025-08-06 10:52:20
|
||||
*/
|
||||
* @author rdpnr_puzhi
|
||||
* @description 针对表【user_device_group】的数据库操作Service实现
|
||||
* @createDate 2025-08-06 18:46:45
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class UserDeviceGroupServiceImpl extends ServiceImpl<UserDeviceGroupMapper, UserDeviceGroup>
|
||||
implements UserDeviceGroupService{
|
||||
implements UserDeviceGroupService {
|
||||
|
||||
@Resource
|
||||
private UserDeviceGroupMapper groupMapper;
|
||||
|
||||
@Override
|
||||
public Result<?> insert(UserDeviceGroupReq groupReq) {
|
||||
UserDeviceGroup group = BeanUtil.copyProperties(groupReq, UserDeviceGroup.class);
|
||||
group.setCreateUser("admin");
|
||||
int insert = groupMapper.insert(group);
|
||||
log.info("分组新增insert:{}", insert);
|
||||
if (insert == 1) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
return Result.errorResult(BaseErrorCode.HTTP_ERROR_CODE_500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Result<?> delete(DeleteIdReq deleteIdReq) {
|
||||
int deleted = groupMapper.deleteById(deleteIdReq.getId());
|
||||
log.info("分组删除insert:{}", deleted);
|
||||
if (deleted == 1) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
return Result.errorResult(BaseErrorCode.HTTP_ERROR_CODE_500);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<?> query(UserDeviceGroupReq groupReq) {
|
||||
UserDeviceGroup userDeviceGroup = BeanUtil.copyProperties(groupReq, UserDeviceGroup.class);
|
||||
QueryWrapper<UserDeviceGroup> wrapper = new QueryWrapper<>();
|
||||
if (ObjectUtils.isEmpty(userDeviceGroup.getType())) {
|
||||
log.error("分组类型为空:{}", JSONUtil.toJsonStr(groupReq));
|
||||
return Result.errorResult(BaseErrorCode.PARAMS_CHK_ERROR);
|
||||
}
|
||||
wrapper.lambda().eq(UserDeviceGroup::getType, userDeviceGroup.getType());
|
||||
if (ObjectUtils.isNotEmpty(userDeviceGroup.getId())) {
|
||||
wrapper.lambda().eq(UserDeviceGroup::getId, userDeviceGroup.getId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(userDeviceGroup.getName())) {
|
||||
wrapper.lambda().eq(UserDeviceGroup::getName, userDeviceGroup.getName());
|
||||
}
|
||||
List<UserDeviceGroup> userDeviceGroups = groupMapper.selectList(wrapper);
|
||||
if (CollectionUtil.isEmpty(userDeviceGroups)) {
|
||||
log.error("查询数据为空:{}", JSONUtil.toJsonStr(userDeviceGroups));
|
||||
return Result.successResult();
|
||||
}
|
||||
List<UserDeviceGroupRes> userDeviceGroupRes = BeanUtil.copyToList(userDeviceGroups, UserDeviceGroupRes.class);
|
||||
|
||||
// 组装树结构
|
||||
List<UserDeviceGroupRes> treeResult = buildTreeStructure(userDeviceGroupRes);
|
||||
log.info("分组查询结果:{}", JSONUtil.toJsonStr(treeResult));
|
||||
|
||||
return Result.successResult(treeResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建树形结构
|
||||
*
|
||||
* @param list 所有分组数据
|
||||
* @return 树形结构数据
|
||||
*/
|
||||
private List<UserDeviceGroupRes> buildTreeStructure(List<UserDeviceGroupRes> list) {
|
||||
if (CollectionUtil.isEmpty(list)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
// 创建一个map用于快速查找节点
|
||||
Map<Long, UserDeviceGroupRes> nodeMap = new HashMap<>(list.size());
|
||||
// 根节点列表
|
||||
List<UserDeviceGroupRes> rootNodes = new ArrayList<>();
|
||||
|
||||
// 先将所有节点放入map中并初始化子节点列表
|
||||
for (UserDeviceGroupRes node : list) {
|
||||
nodeMap.put(node.getId(), node);
|
||||
if (node.getChildren() == null) {
|
||||
node.setChildren(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
||||
// 构建树形结构
|
||||
for (UserDeviceGroupRes node : list) {
|
||||
// 根节点条件:parentId为null和id=0(根节点默认页面不显示)
|
||||
if (node.getParentId() == null && node.getId() == 0 || !nodeMap.containsKey(node.getParentId())) {
|
||||
rootNodes.add(node);
|
||||
} else {
|
||||
// 检查是否存在循环引用
|
||||
if (isCircularReference(node, nodeMap)) {
|
||||
log.warn("检测到循环引用,节点ID: {}", node.getId());
|
||||
continue;
|
||||
}
|
||||
|
||||
// 如果不是根节点,找到父节点并添加为子节点
|
||||
UserDeviceGroupRes parent = nodeMap.get(node.getParentId());
|
||||
if (parent != null) {
|
||||
parent.getChildren().add(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return rootNodes;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测是否存在循环引用
|
||||
*
|
||||
* @param node 起始节点
|
||||
* @param nodeMap 节点映射表
|
||||
* @return 是否存在循环引用
|
||||
*/
|
||||
private boolean isCircularReference(UserDeviceGroupRes node, Map<Long, UserDeviceGroupRes> nodeMap) {
|
||||
Set<Long> visited = new HashSet<>();
|
||||
Long currentId = node.getParentId();
|
||||
|
||||
while (currentId != null) {
|
||||
// 如果已访问过该节点,说明存在循环引用
|
||||
if (visited.contains(currentId)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 如果当前节点就是起始节点,说明存在循环引用
|
||||
if (currentId.equals(node.getId())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
visited.add(currentId);
|
||||
UserDeviceGroupRes parent = nodeMap.get(currentId);
|
||||
|
||||
// 如果父节点不存在,结束检测
|
||||
if (parent == null) {
|
||||
break;
|
||||
}
|
||||
|
||||
currentId = parent.getParentId();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.unisinsight.project.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
@ -9,11 +10,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
import com.unisinsight.project.entity.dao.User;
|
||||
import com.unisinsight.project.entity.req.DeleteIdReq;
|
||||
import com.unisinsight.project.entity.req.UserReq;
|
||||
import com.unisinsight.project.entity.res.PageResult;
|
||||
import com.unisinsight.project.entity.res.UserRes;
|
||||
import com.unisinsight.project.exception.BaseErrorCode;
|
||||
import com.unisinsight.project.exception.Result;
|
||||
import com.unisinsight.project.mapper.UserMapper;
|
||||
import com.unisinsight.project.service.UserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -50,7 +54,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User>
|
|||
User user = BeanUtil.copyProperties(userReq, User.class);
|
||||
user.setUpdateUser("admin");
|
||||
int updated = userMapper.updateById(user);
|
||||
log.info("用户修改insert:{}", updated);
|
||||
log.info("用户修改updated:{}", updated);
|
||||
if (updated == 1) {
|
||||
return Result.successResult();
|
||||
} else {
|
||||
|
@ -73,23 +77,30 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User>
|
|||
public Result<?> selectPageUser(UserReq userReq) {
|
||||
|
||||
Page<User> page = new Page<>(userReq.getPageNum(), userReq.getPageSize());
|
||||
|
||||
QueryWrapper<User> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
if (StringUtils.isNoneBlank(userReq.getUserName())) {
|
||||
if (ObjectUtils.isNotEmpty(userReq.getUserGroupId())) {
|
||||
queryWrapper.lambda().eq(User::getUserGroupId, userReq.getUserGroupId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(userReq.getUserName())) {
|
||||
queryWrapper.lambda().like(User::getUserName, userReq.getUserName());
|
||||
}
|
||||
if (StringUtils.isNoneBlank(userReq.getIdentityNo())) {
|
||||
if (StringUtils.isNotBlank(userReq.getIdentityNo())) {
|
||||
queryWrapper.lambda().like(User::getIdentityNo, userReq.getIdentityNo());
|
||||
}
|
||||
if (StringUtils.isNoneBlank(userReq.getCellPhone())) {
|
||||
if (StringUtils.isNotBlank(userReq.getCellPhone())) {
|
||||
queryWrapper.lambda().like(User::getCellPhone, userReq.getCellPhone());
|
||||
}
|
||||
|
||||
IPage<User> userPage = userMapper.selectPage(page, queryWrapper);
|
||||
log.info("分页查询用户返回:{}", JSONUtil.toJsonStr(userPage));
|
||||
|
||||
return Result.successResult(userPage);
|
||||
if (CollectionUtil.isEmpty(userPage.getRecords())){
|
||||
log.info("分页查询用户返回为空");
|
||||
return Result.successResult();
|
||||
}else {
|
||||
PageResult<UserRes> convert = PageResult.convertIPage(userPage, UserRes.class);
|
||||
return Result.successResult(convert);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue