Commit 1f47e2f0 by renyizhao

前端显示服务器ip 初始账号 初始密码

parent 950495a2
...@@ -72,6 +72,12 @@ public class AppResourceOrderSnapshotSaveReqVO { ...@@ -72,6 +72,12 @@ public class AppResourceOrderSnapshotSaveReqVO {
@NotBlank(message = "服务器IP不能为空") @NotBlank(message = "服务器IP不能为空")
private String ip; private String ip;
@Schema(description = "服务器初始用户名", example = "root")
private String initUsername;
@Schema(description = "服务器初始密码", example = "password123")
private String initPassword;
@Schema(description = "SPU名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "GPU服务器A型") @Schema(description = "SPU名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "GPU服务器A型")
@NotBlank(message = "SPU名称不能为空") @NotBlank(message = "SPU名称不能为空")
private String spuName; private String spuName;
......
...@@ -94,6 +94,16 @@ public class ResourceOrderSnapshotDO extends BaseDO { ...@@ -94,6 +94,16 @@ public class ResourceOrderSnapshotDO extends BaseDO {
private String ip; private String ip;
/** /**
* 服务器初始用户名快照
*/
private String initUsername;
/**
* 服务器初始密码快照
*/
private String initPassword;
/**
* SPU名称快照 * SPU名称快照
*/ */
private String spuName; private String spuName;
......
...@@ -455,6 +455,8 @@ public class ResourceOrderServiceImpl implements ResourceOrderService { ...@@ -455,6 +455,8 @@ public class ResourceOrderServiceImpl implements ResourceOrderService {
respVO.setPowerSupply(snapshot.getPowerSupply()); respVO.setPowerSupply(snapshot.getPowerSupply());
respVO.setNic(snapshot.getNic()); respVO.setNic(snapshot.getNic());
respVO.setIp(snapshot.getIp()); respVO.setIp(snapshot.getIp());
respVO.setInitUsername(snapshot.getInitUsername());
respVO.setInitPassword(snapshot.getInitPassword());
respVO.setSkuName(snapshot.getSpuName() + " - " + snapshot.getDurationDays() + "天"); respVO.setSkuName(snapshot.getSpuName() + " - " + snapshot.getDurationDays() + "天");
// 快照中没有的字段(分类、位置)需要从SPU获取 // 快照中没有的字段(分类、位置)需要从SPU获取
...@@ -489,6 +491,8 @@ public class ResourceOrderServiceImpl implements ResourceOrderService { ...@@ -489,6 +491,8 @@ public class ResourceOrderServiceImpl implements ResourceOrderService {
respVO.setNic(spu.getNic()); respVO.setNic(spu.getNic());
respVO.setIp(spu.getIp()); respVO.setIp(spu.getIp());
respVO.setLocation(spu.getLocation()); respVO.setLocation(spu.getLocation());
respVO.setInitUsername(spu.getInitUsername());
respVO.setInitPassword(spu.getInitPassword());
respVO.setSkuName(spu.getName() + " - " + sku.getDurationDays() + "天"); respVO.setSkuName(spu.getName() + " - " + sku.getDurationDays() + "天");
// 设置分类名称 // 设置分类名称
...@@ -856,6 +860,8 @@ public class ResourceOrderServiceImpl implements ResourceOrderService { ...@@ -856,6 +860,8 @@ public class ResourceOrderServiceImpl implements ResourceOrderService {
createReqVO.setMemoryCapacity(spu.getMemoryCapacity()); createReqVO.setMemoryCapacity(spu.getMemoryCapacity());
createReqVO.setLocation(spu.getLocation()); createReqVO.setLocation(spu.getLocation());
createReqVO.setIp(spu.getIp()); createReqVO.setIp(spu.getIp());
createReqVO.setInitUsername(spu.getInitUsername());
createReqVO.setInitPassword(spu.getInitPassword());
createReqVO.setSpuName(spu.getName()); createReqVO.setSpuName(spu.getName());
createReqVO.setDurationDays(sku.getDurationDays()); createReqVO.setDurationDays(sku.getDurationDays());
createReqVO.setRentStartTime(order.getRentStartTime()); createReqVO.setRentStartTime(order.getRentStartTime());
......
-- ============================================================
-- 算力资源订单硬件配置快照:新增服务器初始用户名 / 密码 字段
-- 适用数据库:MySQL 5.7+ / 8.0
-- 适用表: compute_resource_order_snapshot
-- 创建时间: 2026-07-29
-- 说明: 用于"我的资源 - 订单详情"展示服务器登录凭证,
-- 沿用快照设计避免 SPU 改密后影响历史订单
-- ============================================================
USE `new_computility`;
ALTER TABLE `compute_resource_order_snapshot`
ADD COLUMN `init_username` VARCHAR(64) NULL DEFAULT NULL
COMMENT '服务器初始用户名(快照)'
AFTER `ip`,
ADD COLUMN `init_password` VARCHAR(128) NULL DEFAULT NULL
COMMENT '服务器初始密码(快照)'
AFTER `init_username`;
-- 验证:
-- SHOW COLUMNS FROM `compute_resource_order_snapshot` LIKE 'init_%';
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment