Commit 8e81bfe5 by Jony.L

算力资源重构-更换服务器前修改

parent b55d38ad
package com.luhu.computility.module.compute.controller.app.resourceorder;
import com.luhu.computility.framework.common.pojo.CommonResult;
import com.luhu.computility.framework.common.pojo.PageResult;
import com.luhu.computility.module.compute.controller.app.resourceorder.vo.AppResourceOrderCreateReqVO;
import com.luhu.computility.module.compute.controller.app.resourceorder.vo.AppResourceOrderCreateRespVO;
import com.luhu.computility.module.compute.controller.app.resourceorder.vo.AppResourceOrderPageReqVO;
import com.luhu.computility.module.compute.controller.app.resourceorder.vo.AppResourceOrderRespVO;
import com.luhu.computility.module.compute.service.resourceorder.ResourceOrderService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
......@@ -42,4 +46,22 @@ public class AppResourceOrderController {
return success(true);
}
@GetMapping("/page")
@Operation(summary = "获得用户算力资源订单分页")
public CommonResult<PageResult<AppResourceOrderRespVO>> getUserResourceOrderPage(@Valid AppResourceOrderPageReqVO pageReqVO) {
Long userId = getLoginUserId();
pageReqVO.setUserId(userId);
PageResult<AppResourceOrderRespVO> pageResult = resourceOrderService.getUserResourceOrderPage(pageReqVO);
return success(pageResult);
}
@GetMapping("/get")
@Operation(summary = "获得算力资源订单详情")
@Parameter(name = "id", description = "编号", required = true)
public CommonResult<AppResourceOrderRespVO> getUserResourceOrder(@RequestParam("id") Long id) {
Long userId = getLoginUserId();
AppResourceOrderRespVO orderDetail = resourceOrderService.getUserResourceOrder(userId, id);
return success(orderDetail);
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.luhu.computility.module.compute.controller.app.resourcesku;
import com.luhu.computility.framework.common.pojo.CommonResult;
import com.luhu.computility.framework.common.pojo.PageResult;
import com.luhu.computility.framework.common.util.object.BeanUtils;
import com.luhu.computility.module.compute.controller.app.resourcesku.vo.AppResourceSkuPageReqVO;
import com.luhu.computility.module.compute.controller.app.resourcesku.vo.AppResourceSkuRespVO;
import com.luhu.computility.module.compute.dal.dataobject.resourcesku.ResourceSkuDO;
......@@ -110,18 +111,10 @@ public class AppResourceSkuController {
return success(null);
}
AppResourceSkuRespVO respVO = new AppResourceSkuRespVO();
AppResourceSkuRespVO respVO = BeanUtils.toBean(resourceSpu, AppResourceSkuRespVO.class);
respVO.setId(resourceSku.getId());
respVO.setName(resourceSpu.getName());
respVO.setRemark(resourceSpu.getIntro());
respVO.setPrice(resourceSku.getPaymentPrice());
respVO.setFeeInfo(resourceSku.getDurationDays() + "天");
respVO.setCpu(resourceSpu.getCpu());
respVO.setGpu(resourceSpu.getGpu());
respVO.setRam(resourceSpu.getRam());
respVO.setStorage(resourceSpu.getStorage());
respVO.setIp(resourceSpu.getIp());
respVO.setLocation(resourceSpu.getLocation());
return success(respVO);
}
......
......@@ -10,7 +10,7 @@ import com.luhu.computility.framework.mybatis.core.dataobject.BaseDO;
/**
* 算力资源分类表(仅用于算力服务器分类) DO
*
* @author 呼啦啦
* @author jony
*/
@TableName("compute_resource_category")
@KeySequence("compute_resource_category_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
......
......@@ -10,7 +10,7 @@ import com.luhu.computility.framework.mybatis.core.dataobject.BaseDO;
/**
* 算力资源配置 DO
*
* @author 呼啦啦
* @author jony
*/
@TableName("compute_resource_config")
@KeySequence("compute_resource_config_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
......
......@@ -14,7 +14,7 @@ import com.luhu.computility.framework.mybatis.core.dataobject.BaseDO;
/**
* 算力资源订单 DO
*
* @author 呼啦啦
* @author jony
*/
@TableName("compute_resource_order")
@KeySequence("compute_resource_order_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
......@@ -36,6 +36,10 @@ public class ResourceOrderDO extends BaseDO {
*/
private Long userId;
/**
* 用户IP
*/
private String userIp;
/**
* 算力资源SKU ID
*/
private Long skuId;
......
......@@ -10,7 +10,7 @@ import com.luhu.computility.framework.mybatis.core.dataobject.BaseDO;
/**
* 算力资源SKU表(价格和租赁信息) DO
*
* @author 呼啦啦
* @author jony
*/
@TableName("compute_resource_sku")
@KeySequence("compute_resource_sku_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
......
......@@ -10,7 +10,7 @@ import com.luhu.computility.framework.mybatis.core.dataobject.BaseDO;
/**
* 算力资源SPU表(基础配置信息) DO
*
* @author 呼啦啦
* @author jony
*/
@TableName("compute_resource_spu")
@KeySequence("compute_resource_spu_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
......
......@@ -12,7 +12,7 @@ import com.luhu.computility.module.compute.controller.admin.resourcecategory.vo.
/**
* 算力资源分类表(仅用于算力服务器分类) Mapper
*
* @author 呼啦啦
* @author jony
*/
@Mapper
public interface ResourceCategoryMapper extends BaseMapperX<ResourceCategoryDO> {
......
......@@ -12,7 +12,7 @@ import com.luhu.computility.module.compute.controller.admin.resourceconfig.vo.*;
/**
* 算力资源配置 Mapper
*
* @author 呼啦啦
* @author jony
*/
@Mapper
public interface ResourceConfigMapper extends BaseMapperX<ResourceConfigDO> {
......
......@@ -12,7 +12,7 @@ import com.luhu.computility.module.compute.controller.admin.resourceorder.vo.*;
/**
* 算力资源订单 Mapper
*
* @author 呼啦啦
* @author jony
*/
@Mapper
public interface ResourceOrderMapper extends BaseMapperX<ResourceOrderDO> {
......
......@@ -12,7 +12,7 @@ import com.luhu.computility.module.compute.controller.admin.resourcesku.vo.*;
/**
* 算力资源SKU表(价格和租赁信息) Mapper
*
* @author 呼啦啦
* @author jony
*/
@Mapper
public interface ResourceSkuMapper extends BaseMapperX<ResourceSkuDO> {
......
......@@ -15,7 +15,7 @@ import com.luhu.computility.module.compute.controller.admin.resourcespu.vo.*;
/**
* 算力资源SPU表(基础配置信息) Mapper
*
* @author 呼啦啦
* @author jony
*/
@Mapper
public interface ResourceSpuMapper extends BaseMapperX<ResourceSpuDO> {
......
......@@ -10,7 +10,7 @@ import com.luhu.computility.framework.common.pojo.PageParam;
/**
* 算力资源分类表(仅用于算力服务器分类) Service 接口
*
* @author 呼啦啦
* @author jony
*/
public interface ResourceCategoryService {
......
......@@ -20,7 +20,7 @@ import static com.luhu.computility.module.compute.enums.ResourceEnableStatus.ENA
/**
* 算力资源分类表(仅用于算力服务器分类) Service 实现类
*
* @author 呼啦啦
* @author jony
*/
@Service
@Validated
......
......@@ -10,7 +10,7 @@ import com.luhu.computility.framework.common.pojo.PageParam;
/**
* 算力资源配置 Service 接口
*
* @author 呼啦啦
* @author jony
*/
public interface ResourceConfigService {
......
......@@ -21,7 +21,7 @@ import static com.luhu.computility.module.compute.enums.ResourceEnableStatus.ENA
/**
* 算力资源配置 Service 实现类
*
* @author 呼啦啦
* @author jony
*/
@Service
@Validated
......
......@@ -5,6 +5,8 @@ import javax.validation.*;
import com.luhu.computility.module.compute.controller.admin.resourceorder.vo.*;
import com.luhu.computility.module.compute.controller.app.resourceorder.vo.AppResourceOrderCreateReqVO;
import com.luhu.computility.module.compute.controller.app.resourceorder.vo.AppResourceOrderCreateRespVO;
import com.luhu.computility.module.compute.controller.app.resourceorder.vo.AppResourceOrderPageReqVO;
import com.luhu.computility.module.compute.controller.app.resourceorder.vo.AppResourceOrderRespVO;
import com.luhu.computility.module.compute.dal.dataobject.resourceorder.ResourceOrderDO;
import com.luhu.computility.framework.common.pojo.PageResult;
import com.luhu.computility.framework.common.pojo.PageParam;
......@@ -12,7 +14,7 @@ import com.luhu.computility.framework.common.pojo.PageParam;
/**
* 算力资源订单 Service 接口
*
* @author 呼啦啦
* @author jony
*/
public interface ResourceOrderService {
......@@ -86,4 +88,21 @@ public interface ResourceOrderService {
*/
void cancelOrder(Long userId, Long orderId);
/**
* 获得用户算力资源订单分页
*
* @param pageReqVO 分页查询
* @return 算力资源订单分页
*/
PageResult<AppResourceOrderRespVO> getUserResourceOrderPage(AppResourceOrderPageReqVO pageReqVO);
/**
* 获得用户算力资源订单详情
*
* @param userId 用户ID
* @param id 订单ID
* @return 算力资源订单详情
*/
AppResourceOrderRespVO getUserResourceOrder(Long userId, Long id);
}
\ No newline at end of file
......@@ -10,7 +10,7 @@ import com.luhu.computility.framework.common.pojo.PageParam;
/**
* 算力资源SKU表(价格和租赁信息) Service 接口
*
* @author 呼啦啦
* @author jony
*/
public interface ResourceSkuService {
......
......@@ -26,7 +26,7 @@ import static com.luhu.computility.framework.common.enums.CommonDeleteStatusEnum
/**
* 算力资源SKU表(价格和租赁信息) Service 实现类
*
* @author 呼啦啦
* @author jony
*/
@Service
@Validated
......
......@@ -10,7 +10,7 @@ import com.luhu.computility.framework.common.pojo.PageParam;
/**
* 算力资源SPU表(基础配置信息) Service 接口
*
* @author 呼啦啦
* @author jony
*/
public interface ResourceSpuService {
......
......@@ -26,7 +26,7 @@ import static com.luhu.computility.framework.common.enums.CommonDeleteStatusEnum
/**
* 算力资源SPU表(基础配置信息) Service 实现类
*
* @author 呼啦啦
* @author jony
*/
@Service
@Validated
......
......@@ -42,9 +42,13 @@ spring:
primary: master
datasource:
master:
url: jdbc:mysql://43.139.100.220:13306/new_computility?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
# 重点加了 catalog=new_computility,强制绑定数据库目录
url: jdbc:mysql://8.136.9.68:3306/new_computility?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&catalog=new_computility
username: root
password: D7kaJdNdLsjzXGhD
password: Luchuan@123
#url: jdbc:mysql://43.139.100.220:13306/new_computility?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
#username: root
#password: D7kaJdNdLsjzXGhD
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
redis:
......@@ -161,9 +165,9 @@ computility:
captcha:
enable: false # 本地环境,暂时关闭图片验证码,方便登录等接口的测试;
pay:
order-notify-url: https://phsl.lijinqi.com/admin-api/pay/notify/order # 支付渠道的【支付】回调地址
refund-notify-url: https://phsl.lijinqi.com/admin-api/pay/notify/refund # 支付渠道的【退款】回调地址
transfer-notify-url: https://phsl.lijinqi.com/admin-api/pay/notify/transfer # 支付渠道的【转账】回调地址
order-notify-url: https://phslgld.hnluchuan.com/admin-api/pay/notify/order # 支付渠道的【支付】回调地址
refund-notify-url: https://phslgld.hnluchuan.com/admin-api/pay/notify/refund # 支付渠道的【退款】回调地址
transfer-notify-url: https://phslgld.hnluchuan.com/admin-api/pay/notify/transfer # 支付渠道的【转账】回调地址
access-log: # 访问日志的配置项
enable: true
demo: false # 开启演示模式
......
......@@ -55,12 +55,17 @@ spring:
primary: master
datasource:
master:
url: jdbc:mysql://43.139.100.220:13306/new_computility?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
#url: jdbc:mysql://localhost/new_computility?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
#username: root
#password: 159357 # D7kaJdNdLsjzXGhD
#url: jdbc:mysql://43.139.100.220:13306/new_computility?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
#username: root
#password: D7kaJdNdLsjzXGhD
url: jdbc:mysql://8.136.9.68:3306/new_computility?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例
username: root
password: D7kaJdNdLsjzXGhD
password: Luchuan@123
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
redis:
host: 127.0.0.1 # 地址
......
......@@ -362,6 +362,9 @@ computility:
receive-expire-time: 14d # 收货的过期时间
comment-expire-time: 7d # 评论的过期时间
status-sync-to-wxa-enable: true # 是否同步订单状态到微信小程序
compute:
order:
pay-expire-time: 30m # 支付的过期时间,30分钟
express:
client: kd_100
......
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