feat: impl consumer provide
Signed-off-by: devad <cossjie@foxmail.com>
This commit is contained in:
parent
4dd186d23d
commit
097e0d103f
|
@ -33,3 +33,5 @@ build/
|
|||
.vscode/
|
||||
|
||||
.mvn/
|
||||
|
||||
logs/
|
||||
|
|
14
pom.xml
14
pom.xml
|
@ -41,11 +41,23 @@
|
|||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.mybatis.spring.boot/mybatis-spring-boot-starter -->
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>2.3.1</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.8</version>
|
||||
<version>5.8.18</version>
|
||||
</dependency>
|
||||
|
||||
<!-- mybatis-plus -->
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
### 分页查询所有系统镜像
|
||||
GET http://localhost:8080/image/pageList?page=10&size=7
|
||||
|
||||
### 根据系统名称查询镜像
|
||||
GET http://localhost:8080/image/selectBySystemName?systemName=Debian
|
||||
|
||||
### 查询所有系统名称列表
|
||||
GET http://localhost:8080/image/systemNameList
|
||||
|
||||
### 分页查询计算服务列表
|
||||
GET http://localhost:8080/provide/pageList?page=1&size=3&computingResourceId=9
|
||||
|
||||
### 根据id查询计算服务详情
|
||||
GET http://localhost:8080/provide/detail?id=1
|
||||
|
||||
### 服务发布
|
||||
POST http://localhost:8080/provide/create
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"id": 2,
|
||||
"name": "异腾广州智算:最大512P、最小200P",
|
||||
"domain": "智算",
|
||||
"business": "智算",
|
||||
"computingResourceId": 9,
|
||||
"computingCardId": 19,
|
||||
"computeNum": 28,
|
||||
"memory": 256,
|
||||
"vram": 32,
|
||||
"computingCenterId": 2,
|
||||
"chargeType": 1,
|
||||
"userId": null,
|
||||
"systemDiskCategory": 0,
|
||||
"systemDiskSize": 100,
|
||||
"internetMaxBandwidthOut": 100,
|
||||
"imageType": 0,
|
||||
"imageId": null,
|
||||
"priceUnit": 3,
|
||||
"durationPrice": 7.20,
|
||||
"type": 0,
|
||||
"description": null,
|
||||
"clickNum": 0,
|
||||
"status": true,
|
||||
"version": 1,
|
||||
"deleted": 0,
|
||||
"createTime": "2023-07-30T19:56:56",
|
||||
"updateTime": null,
|
||||
"computingResourceName": "NPU",
|
||||
"computingCenterName": "异腾广州智算",
|
||||
"computingCardName": "ASIC"
|
||||
}
|
||||
|
||||
### 根据id查询需求详细数据
|
||||
GET http://localhost:8080/consumer/detail?id=2
|
||||
|
||||
### 分页查询需求列表
|
||||
GET http://localhost:8080/consumer/pageList?page=1&size=10
|
||||
|
||||
### 发布需求
|
||||
POST http://localhost:8080/consumer/create
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"id": 1,
|
||||
"name": "GPU/NPU 200 P",
|
||||
"domain": null,
|
||||
"business": null,
|
||||
"computingResourceId": 9,
|
||||
"computingCardId": 20,
|
||||
"computeNum": 24,
|
||||
"memory": 128,
|
||||
"vram": 16,
|
||||
"computingCenterId": 2,
|
||||
"chargeType": 0,
|
||||
"userId": null,
|
||||
"systemDiskCategory": 0,
|
||||
"systemDiskSize": 1000,
|
||||
"internetMaxBandwidthOut": 1000,
|
||||
"imageType": 0,
|
||||
"imageId": null,
|
||||
"amount": 10,
|
||||
"priceUnit": 1,
|
||||
"durationAmount": 2,
|
||||
"type": 0,
|
||||
"description": null,
|
||||
"dockingPerson": null,
|
||||
"dockingPhone": null,
|
||||
"consumerStatus": 0,
|
||||
"clickNum": 1,
|
||||
"status": true,
|
||||
"version": 2,
|
||||
"deleted": 0,
|
||||
"createTime": "2023-07-30T19:56:56",
|
||||
"updateTime": "2023-07-30T23:32:02",
|
||||
"computingResourceName": "NPU",
|
||||
"computingCenterName": "异腾广州智算",
|
||||
"computingCardName": "Ascend 910"
|
||||
}
|
|
@ -1,109 +0,0 @@
|
|||
//package net.jointcloud.negotiation;
|
||||
//
|
||||
//import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
//import com.baomidou.mybatisplus.annotation.IdType;
|
||||
//import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException;
|
||||
//import com.baomidou.mybatisplus.generator.AutoGenerator;
|
||||
//import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
|
||||
//import com.baomidou.mybatisplus.generator.config.GlobalConfig;
|
||||
//import com.baomidou.mybatisplus.generator.config.PackageConfig;
|
||||
//import com.baomidou.mybatisplus.generator.config.StrategyConfig;
|
||||
//import com.baomidou.mybatisplus.generator.config.po.TableFill;
|
||||
//import com.baomidou.mybatisplus.generator.config.rules.DateType;
|
||||
//import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
|
||||
//import org.apache.commons.lang3.StringUtils;
|
||||
//
|
||||
//import java.util.ArrayList;
|
||||
//import java.util.Scanner;
|
||||
//
|
||||
//public class CodeGenerator {
|
||||
//
|
||||
//
|
||||
// public static String scanner(String tip) {
|
||||
// Scanner scanner = new Scanner(System.in);
|
||||
// StringBuilder help = new StringBuilder();
|
||||
// help.append("请输入" + tip + ":");
|
||||
// System.out.println(help.toString());
|
||||
// if (scanner.hasNext()) {
|
||||
// String ipt = scanner.next();
|
||||
// if (StringUtils.isNotBlank(ipt)) {
|
||||
// return ipt;
|
||||
// }
|
||||
// }
|
||||
// throw new MybatisPlusException("请输入正确的" + tip + "!");
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// public static void main(String[] args) {
|
||||
// // 代码生成器
|
||||
// AutoGenerator mpg = new AutoGenerator();
|
||||
//
|
||||
// // 全局配置
|
||||
// GlobalConfig gc = new GlobalConfig();
|
||||
// String projectPath = System.getProperty("user.dir");
|
||||
// gc.setOutputDir(projectPath + "/src/main/java");//设置代码生成路径
|
||||
// gc.setFileOverride(true);//是否覆盖以前文件
|
||||
// gc.setOpen(false);//是否打开生成目录
|
||||
// gc.setAuthor("jcce");//设置项目作者名称
|
||||
// gc.setIdType(IdType.AUTO);//设置主键策略
|
||||
// gc.setBaseResultMap(true);//生成基本ResultMap
|
||||
// gc.setBaseColumnList(true);//生成基本ColumnList
|
||||
// gc.setServiceName("%sService");//去掉服务默认前缀
|
||||
// gc.setDateType(DateType.ONLY_DATE);//设置时间类型
|
||||
// mpg.setGlobalConfig(gc);
|
||||
//
|
||||
// // 数据源配置
|
||||
// DataSourceConfig dsc = new DataSourceConfig();
|
||||
// dsc.setUrl("jdbc:mysql://10.101.15.7:3306/shaoguan?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8");
|
||||
// dsc.setDriverName("com.mysql.cj.jdbc.Driver");
|
||||
// dsc.setUsername("root");
|
||||
// dsc.setPassword("uJpLd6u-J?HC1");
|
||||
// mpg.setDataSource(dsc);
|
||||
//
|
||||
// // 包配置
|
||||
// PackageConfig pc = new PackageConfig();
|
||||
// pc.setParent("net.jointcloud.negotiation");
|
||||
// pc.setMapper("mapper");
|
||||
// pc.setXml("mapper.xml");
|
||||
// pc.setEntity("pojo");
|
||||
// pc.setService("service");
|
||||
// pc.setServiceImpl("service.impl");
|
||||
// pc.setController("controller");
|
||||
// mpg.setPackageInfo(pc);
|
||||
//
|
||||
// // 策略配置
|
||||
// StrategyConfig sc = new StrategyConfig();
|
||||
// sc.setNaming(NamingStrategy.underline_to_camel);
|
||||
// sc.setColumnNaming(NamingStrategy.underline_to_camel);
|
||||
// sc.setEntityLombokModel(true);//自动lombok
|
||||
// sc.setRestControllerStyle(true);
|
||||
// sc.setControllerMappingHyphenStyle(true);
|
||||
//
|
||||
// sc.setLogicDeleteFieldName("deleted");//设置逻辑删除
|
||||
//
|
||||
// //设置自动填充配置
|
||||
// TableFill gmt_create = new TableFill("create_time", FieldFill.INSERT);
|
||||
// TableFill gmt_modified = new TableFill("update_time", FieldFill.INSERT_UPDATE);
|
||||
// ArrayList<TableFill> tableFills=new ArrayList<>();
|
||||
// tableFills.add(gmt_create);
|
||||
// tableFills.add(gmt_modified);
|
||||
// sc.setTableFillList(tableFills);
|
||||
//
|
||||
// //乐观锁
|
||||
// sc.setVersionFieldName("version");
|
||||
// sc.setRestControllerStyle(true);//驼峰命名
|
||||
//
|
||||
//
|
||||
//
|
||||
// // sc.setTablePrefix("tbl_"); 设置表名前缀
|
||||
// sc.setInclude(scanner("表名,多个英文逗号分割").split(","));
|
||||
// mpg.setStrategy(sc);
|
||||
//
|
||||
// // 生成代码
|
||||
// mpg.execute();
|
||||
// }
|
||||
//
|
||||
//}
|
|
@ -24,12 +24,12 @@ public class CodeGeneratorNew {
|
|||
// 包配置
|
||||
.packageConfig(builder -> {
|
||||
builder.parent("net.jointcloud.negotiation") // 设置父包名
|
||||
.pathInfo(Collections.singletonMap(OutputFile.xml, System.getProperty("user.dir") + "/src/main/resources/mappers")); // 设置mapperXml生成路径
|
||||
.pathInfo(Collections.singletonMap(OutputFile.xml, System.getProperty("user.dir") + "/src/main/resources/mapper")); // 设置mapperXml生成路径
|
||||
})
|
||||
|
||||
// 策略配置
|
||||
.strategyConfig(builder -> {
|
||||
builder.addInclude("card,computing_power_type,consumer,dictionary,image,provide") // 设置需要生成的表名
|
||||
builder.addInclude("provide") // 设置需要生成的表名
|
||||
// Entity 策略配置
|
||||
.entityBuilder()
|
||||
.enableLombok() //开启 Lombok
|
||||
|
@ -55,6 +55,7 @@ public class CodeGeneratorNew {
|
|||
// Controller 策略配置
|
||||
.controllerBuilder()
|
||||
.enableFileOverride() // 覆盖已生成文件
|
||||
.enableRestStyle() //开启生成@RestController 控制器
|
||||
|
||||
;
|
||||
})
|
||||
|
|
|
@ -1,30 +1,36 @@
|
|||
package net.jointcloud.negotiation.config;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.DbType;
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
/**
|
||||
* MyBatisPlus配置类
|
||||
*/
|
||||
@MapperScan("net.jointcloud.negotiation.mapper")
|
||||
@EnableTransactionManagement
|
||||
@Configuration
|
||||
public class MyBatisPlusConfig {
|
||||
|
||||
/**
|
||||
* 注册乐观锁插件
|
||||
* 注册插件
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||
//乐观锁插件
|
||||
interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());
|
||||
|
||||
//分页插件
|
||||
PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();
|
||||
paginationInnerInterceptor.setOptimizeJoin(true);
|
||||
paginationInnerInterceptor.setDbType(DbType.MYSQL);
|
||||
paginationInnerInterceptor.setOverflow(true);
|
||||
|
||||
interceptor.addInnerInterceptor(paginationInnerInterceptor);
|
||||
|
||||
return interceptor;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package net.jointcloud.negotiation.config.constant;
|
||||
|
||||
public class Constant {
|
||||
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package net.jointcloud.negotiation.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 卡类型表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/cardEntity")
|
||||
public class CardController {
|
||||
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package net.jointcloud.negotiation.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 算力类型表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/computingPowerTypeEntity")
|
||||
public class ComputingPowerTypeController {
|
||||
|
||||
}
|
|
@ -1,7 +1,20 @@
|
|||
package net.jointcloud.negotiation.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import net.jointcloud.negotiation.domain.dto.ConsumerDto;
|
||||
import net.jointcloud.negotiation.domain.dto.ConsumerReq;
|
||||
import net.jointcloud.negotiation.domain.entity.ConsumerEntity;
|
||||
import net.jointcloud.negotiation.domain.vo.CommonPage;
|
||||
import net.jointcloud.negotiation.domain.vo.ConsumerVo;
|
||||
import net.jointcloud.negotiation.domain.vo.Result;
|
||||
import net.jointcloud.negotiation.service.ConsumerService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -9,10 +22,63 @@ import org.springframework.stereotype.Controller;
|
|||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
* @since 2023-07-30 07:15:07
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/consumerEntity")
|
||||
@RestController
|
||||
@RequestMapping("/consumer")
|
||||
public class ConsumerController {
|
||||
|
||||
@Autowired
|
||||
private ConsumerService consumerService;
|
||||
|
||||
/**
|
||||
* 根据id查询需求详细数据
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("detail")
|
||||
public Result<ConsumerVo> detail(Long id) {
|
||||
return Result.success(this.consumerService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询需求列表
|
||||
*
|
||||
* @param consumerReq
|
||||
* @param pageable
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "pageList")
|
||||
public Result<CommonPage<ConsumerVo>> lists(ConsumerReq consumerReq, Pageable pageable) {
|
||||
IPage<ConsumerVo> iPage = consumerService.pageList(consumerReq, new Page<>(pageable.getPageNumber(), pageable.getPageSize()));
|
||||
return Result.success(CommonPage.restPage(iPage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 需求发布
|
||||
*
|
||||
* @param consumerDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/create")
|
||||
public Result<Void> create(@Valid @RequestBody ConsumerDto consumerDto) {
|
||||
ConsumerEntity entity = new ConsumerEntity();
|
||||
BeanUtils.copyProperties(consumerDto, entity);
|
||||
entity.setId(null);
|
||||
consumerService.save(entity);
|
||||
return Result.success();
|
||||
}
|
||||
//
|
||||
// /**
|
||||
// * 根据需求id,查询计算服务推荐列表
|
||||
// *
|
||||
// * @param ConsumerId
|
||||
// * @return
|
||||
// */
|
||||
// @GetMapping("/getRecommend")
|
||||
// public Result<List<CalculationProvideVo>> geRecommend(@Valid @NotNull(message = "需求id不能为空") Long ConsumerId) {
|
||||
// //TODO 生成服务推荐列表 暂时只显示TOP10推荐数据
|
||||
// return Result.success(calculationProvideService.generateRecommend(ConsumerId, PageRequest.of(1, 10)));
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
package net.jointcloud.negotiation.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 扩展类型字典表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/dictionaryEntity")
|
||||
public class DictionaryController {
|
||||
|
||||
}
|
|
@ -1,7 +1,19 @@
|
|||
package net.jointcloud.negotiation.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import net.jointcloud.negotiation.domain.entity.ImageEntity;
|
||||
import net.jointcloud.negotiation.domain.vo.CommonPage;
|
||||
import net.jointcloud.negotiation.domain.vo.Result;
|
||||
import net.jointcloud.negotiation.service.ImageService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -11,8 +23,58 @@ import org.springframework.stereotype.Controller;
|
|||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/imageEntity")
|
||||
@RestController
|
||||
@RequestMapping("/image")
|
||||
public class ImageController {
|
||||
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Autowired
|
||||
private ImageService imageService;
|
||||
|
||||
/**
|
||||
* 通过主键查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 单条数据
|
||||
*/
|
||||
@GetMapping("detail")
|
||||
public Result<ImageEntity> selectOne(Long id) {
|
||||
return Result.success(this.imageService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询所有系统镜像
|
||||
*
|
||||
* @param pageable
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("pageList")
|
||||
public Result<CommonPage<ImageEntity>> list(Pageable pageable) {
|
||||
Page<ImageEntity> mapPage = new Page<>(pageable.getPageNumber(), pageable.getPageSize(), true);
|
||||
IPage<ImageEntity> mapIPage = imageService.selectByPage(mapPage, new QueryWrapper<>());
|
||||
return Result.success(CommonPage.restPage(mapIPage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有系统名称列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("systemNameList")
|
||||
public Result<List<Object>> systemNameList() {
|
||||
return Result.success(imageService.selectSystemNameGroup());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据系统名称查询镜像
|
||||
*
|
||||
* @param systemName
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("selectBySystemName")
|
||||
public Result<List<ImageEntity>> selectBySystemName(String systemName) {
|
||||
return Result.success(imageService.selectBySystemName(systemName));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,21 @@
|
|||
package net.jointcloud.negotiation.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import net.jointcloud.negotiation.domain.dto.ProvideDto;
|
||||
import net.jointcloud.negotiation.domain.dto.ProvideReq;
|
||||
import net.jointcloud.negotiation.domain.entity.ProvideEntity;
|
||||
import net.jointcloud.negotiation.domain.vo.CommonPage;
|
||||
import net.jointcloud.negotiation.domain.vo.ProvideVo;
|
||||
import net.jointcloud.negotiation.domain.vo.Result;
|
||||
import net.jointcloud.negotiation.mapper.ProvideMapper;
|
||||
import net.jointcloud.negotiation.service.ProvideService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -9,10 +23,56 @@ import org.springframework.stereotype.Controller;
|
|||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
* @since 2023-07-30 09:49:48
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/provideEntity")
|
||||
@RestController
|
||||
@RequestMapping("/provide")
|
||||
public class ProvideController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Autowired
|
||||
private ProvideService provideService;
|
||||
|
||||
@Autowired
|
||||
private ProvideMapper provideMapper;
|
||||
|
||||
/**
|
||||
* 根据id查询计算服务详情
|
||||
*
|
||||
* @param id 服务id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("detail")
|
||||
public Result<ProvideVo> detail(Long id) {
|
||||
return Result.success(this.provideService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询计算服务列表
|
||||
*
|
||||
* @param
|
||||
* @param pageable
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "pageList")
|
||||
public Result<CommonPage<ProvideVo>> list(ProvideReq provideReq, Pageable pageable) {
|
||||
IPage<ProvideVo> iPage = provideService.pageList(provideReq, new Page<>(pageable.getPageNumber(), pageable.getPageSize()));
|
||||
return Result.success(CommonPage.restPage(iPage));
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务发布
|
||||
*
|
||||
* @param provideDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/create")
|
||||
public Result<Void> create(@Valid @RequestBody ProvideDto provideDto) {
|
||||
ProvideEntity provideEntity = new ProvideEntity();
|
||||
BeanUtils.copyProperties(provideDto, provideEntity);
|
||||
provideEntity.setId(null);
|
||||
provideService.save(provideEntity);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
package net.jointcloud.negotiation.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-30 07:15:07
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/sysDictEntity")
|
||||
public class SysDictController {
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package net.jointcloud.negotiation.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-30 07:15:07
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/sysDictItemEntity")
|
||||
public class SysDictItemController {
|
||||
|
||||
}
|
|
@ -0,0 +1,186 @@
|
|||
package net.jointcloud.negotiation.domain.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 需求表
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-30 08:29:09
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("consumer")
|
||||
public class ConsumerDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 需求名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 领域
|
||||
*/
|
||||
private String domain;
|
||||
|
||||
/**
|
||||
* 行业
|
||||
*/
|
||||
private String business;
|
||||
|
||||
/**
|
||||
* 计算资源(字典项表对应id)
|
||||
*/
|
||||
private Long computingResourceId;
|
||||
|
||||
/**
|
||||
* 卡类型(字典项表对应id)
|
||||
*/
|
||||
private Long computingCardId;
|
||||
|
||||
/**
|
||||
* 卡数/核数
|
||||
*/
|
||||
private Integer computeNum;
|
||||
|
||||
/**
|
||||
* 内存大小
|
||||
*/
|
||||
private Integer memory;
|
||||
|
||||
/**
|
||||
* 显存大小
|
||||
*/
|
||||
private Integer vram;
|
||||
|
||||
/**
|
||||
* 算力中心(字典项表对应id)
|
||||
*/
|
||||
private Long computingCenterId;
|
||||
|
||||
/**
|
||||
* 费用类型:0->PrePaid(包年包月);1->PostPaid(按量付费);2->SpotWithPriceLimit(抢占式实例)
|
||||
*/
|
||||
private Byte chargeType;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 系统磁盘类别:0->cloud_efficiency(高效云盘);1->cloud_essd(ESSD云盘);2->cloud_ssd(ssd云盘);
|
||||
*/
|
||||
private Byte systemDiskCategory;
|
||||
|
||||
/**
|
||||
* 系统磁盘配置
|
||||
*/
|
||||
private Integer systemDiskSize;
|
||||
|
||||
/**
|
||||
* 带宽峰值
|
||||
*/
|
||||
private Integer internetMaxBandwidthOut;
|
||||
|
||||
/**
|
||||
* 镜像类型:0->public(公共);1->custom(自定义);2->shared(共享);3->market(市场);
|
||||
*/
|
||||
private Byte imageType;
|
||||
|
||||
/**
|
||||
* 镜像id
|
||||
*/
|
||||
private Long imageId;
|
||||
|
||||
/**
|
||||
* 服务器数量
|
||||
*/
|
||||
private Integer amount;
|
||||
|
||||
/**
|
||||
* 时长单位:0->Week(周);1->Month(月);2->Year(年);3->Hour(时);
|
||||
*/
|
||||
private Byte priceUnit;
|
||||
|
||||
/**
|
||||
* 购买时长数量
|
||||
*/
|
||||
private Integer durationAmount;
|
||||
|
||||
/**
|
||||
* 需求类型:0->算力需求;
|
||||
*/
|
||||
private Byte type;
|
||||
|
||||
/**
|
||||
* 需求描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 对接联系人
|
||||
*/
|
||||
private String dockingPerson;
|
||||
|
||||
/**
|
||||
* 对接联系方式
|
||||
*/
|
||||
private String dockingPhone;
|
||||
|
||||
/**
|
||||
* 需求状态:0->unsold(未成交);1->done(已成交);
|
||||
*/
|
||||
private Byte consumerStatus;
|
||||
|
||||
/**
|
||||
* 浏览次数
|
||||
*/
|
||||
private Long clickNum;
|
||||
|
||||
/**
|
||||
* 是否可用:0->disable;1->available;
|
||||
*/
|
||||
private Boolean status;
|
||||
|
||||
/**
|
||||
* 乐观锁
|
||||
*/
|
||||
@Version
|
||||
private Integer version;
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
}
|
|
@ -0,0 +1,186 @@
|
|||
package net.jointcloud.negotiation.domain.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 需求表
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-30 08:29:09
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("consumer")
|
||||
public class ConsumerReq implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 需求名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 领域
|
||||
*/
|
||||
private String domain;
|
||||
|
||||
/**
|
||||
* 行业
|
||||
*/
|
||||
private String business;
|
||||
|
||||
/**
|
||||
* 计算资源(字典项表对应id)
|
||||
*/
|
||||
private Long computingResourceId;
|
||||
|
||||
/**
|
||||
* 卡类型(字典项表对应id)
|
||||
*/
|
||||
private Long computingCardId;
|
||||
|
||||
/**
|
||||
* 卡数/核数
|
||||
*/
|
||||
private Integer computeNum;
|
||||
|
||||
/**
|
||||
* 内存大小
|
||||
*/
|
||||
private Integer memory;
|
||||
|
||||
/**
|
||||
* 显存大小
|
||||
*/
|
||||
private Integer vram;
|
||||
|
||||
/**
|
||||
* 算力中心(字典项表对应id)
|
||||
*/
|
||||
private Long computingCenterId;
|
||||
|
||||
/**
|
||||
* 费用类型:0->PrePaid(包年包月);1->PostPaid(按量付费);2->SpotWithPriceLimit(抢占式实例)
|
||||
*/
|
||||
private Byte chargeType;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 系统磁盘类别:0->cloud_efficiency(高效云盘);1->cloud_essd(ESSD云盘);2->cloud_ssd(ssd云盘);
|
||||
*/
|
||||
private Byte systemDiskCategory;
|
||||
|
||||
/**
|
||||
* 系统磁盘配置
|
||||
*/
|
||||
private Integer systemDiskSize;
|
||||
|
||||
/**
|
||||
* 带宽峰值
|
||||
*/
|
||||
private Integer internetMaxBandwidthOut;
|
||||
|
||||
/**
|
||||
* 镜像类型:0->public(公共);1->custom(自定义);2->shared(共享);3->market(市场);
|
||||
*/
|
||||
private Byte imageType;
|
||||
|
||||
/**
|
||||
* 镜像id
|
||||
*/
|
||||
private Long imageId;
|
||||
|
||||
/**
|
||||
* 服务器数量
|
||||
*/
|
||||
private Integer amount;
|
||||
|
||||
/**
|
||||
* 时长单位:0->Week(周);1->Month(月);2->Year(年);3->Hour(时);
|
||||
*/
|
||||
private Byte priceUnit;
|
||||
|
||||
/**
|
||||
* 购买时长数量
|
||||
*/
|
||||
private Integer durationAmount;
|
||||
|
||||
/**
|
||||
* 需求类型:0->算力需求;
|
||||
*/
|
||||
private Byte type;
|
||||
|
||||
/**
|
||||
* 需求描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 对接联系人
|
||||
*/
|
||||
private String dockingPerson;
|
||||
|
||||
/**
|
||||
* 对接联系方式
|
||||
*/
|
||||
private String dockingPhone;
|
||||
|
||||
/**
|
||||
* 需求状态:0->unsold(未成交);1->done(已成交);
|
||||
*/
|
||||
private Byte consumerStatus;
|
||||
|
||||
/**
|
||||
* 浏览次数
|
||||
*/
|
||||
private Long clickNum;
|
||||
|
||||
/**
|
||||
* 是否可用:0->disable;1->available;
|
||||
*/
|
||||
private Boolean status;
|
||||
|
||||
/**
|
||||
* 乐观锁
|
||||
*/
|
||||
@Version
|
||||
private Integer version;
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
}
|
|
@ -0,0 +1,167 @@
|
|||
package net.jointcloud.negotiation.domain.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务供应表
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-30 09:49:48
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("provide")
|
||||
public class ProvideDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 需求名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 领域
|
||||
*/
|
||||
private String domain;
|
||||
|
||||
/**
|
||||
* 行业
|
||||
*/
|
||||
private String business;
|
||||
|
||||
/**
|
||||
* 计算资源(字典项表对应id)
|
||||
*/
|
||||
private Long computingResourceId;
|
||||
|
||||
/**
|
||||
* 卡类型(字典项表对应id)
|
||||
*/
|
||||
private Long computingCardId;
|
||||
|
||||
/**
|
||||
* 卡数/核数
|
||||
*/
|
||||
private Integer computeNum;
|
||||
|
||||
/**
|
||||
* 内存大小
|
||||
*/
|
||||
private Integer memory;
|
||||
|
||||
/**
|
||||
* 显存大小
|
||||
*/
|
||||
private Integer vram;
|
||||
|
||||
/**
|
||||
* 算力中心(字典项表对应id)
|
||||
*/
|
||||
private Long computingCenterId;
|
||||
|
||||
/**
|
||||
* 费用类型:0->PrePaid(包年包月);1->PostPaid(按量付费);2->SpotWithPriceLimit(抢占式实例)
|
||||
*/
|
||||
private Byte chargeType;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 系统磁盘类别:0->cloud_efficiency(高效云盘);1->cloud_essd(ESSD云盘);2->cloud_ssd(ssd云盘);
|
||||
*/
|
||||
private Integer systemDiskCategory;
|
||||
|
||||
/**
|
||||
* 系统磁盘配置
|
||||
*/
|
||||
private Integer systemDiskSize;
|
||||
|
||||
/**
|
||||
* 带宽峰值
|
||||
*/
|
||||
private Integer internetMaxBandwidthOut;
|
||||
|
||||
/**
|
||||
* 镜像类型:0->public(公共);1->custom(自定义);2->shared(共享);3->market(市场);
|
||||
*/
|
||||
private Byte imageType;
|
||||
|
||||
/**
|
||||
* 镜像id
|
||||
*/
|
||||
private Long imageId;
|
||||
|
||||
/**
|
||||
* 时长单位:0->Week(周);1->Month(月);2->Year(年);3->Hour(时);
|
||||
*/
|
||||
private Byte priceUnit;
|
||||
|
||||
/**
|
||||
* 时长单价(费用:时长单价×时长)
|
||||
*/
|
||||
private BigDecimal durationPrice;
|
||||
|
||||
/**
|
||||
* 需求类型:0->算力需求;
|
||||
*/
|
||||
private Byte type;
|
||||
|
||||
/**
|
||||
* 适用场景、相关描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 浏览次数
|
||||
*/
|
||||
private Long clickNum;
|
||||
|
||||
/**
|
||||
* 是否可用:0->disable;1->available;
|
||||
*/
|
||||
private Boolean status;
|
||||
|
||||
/**
|
||||
* 乐观锁
|
||||
*/
|
||||
@Version
|
||||
private Integer version;
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
}
|
|
@ -0,0 +1,160 @@
|
|||
package net.jointcloud.negotiation.domain.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务供应表
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-30 09:49:48
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
public class ProvideReq implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 需求名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 领域
|
||||
*/
|
||||
private String domain;
|
||||
|
||||
/**
|
||||
* 行业
|
||||
*/
|
||||
private String business;
|
||||
|
||||
/**
|
||||
* 计算资源(字典项表对应id)
|
||||
*/
|
||||
private Long computingResourceId;
|
||||
|
||||
/**
|
||||
* 卡类型(字典项表对应id)
|
||||
*/
|
||||
private Long computingCardId;
|
||||
|
||||
/**
|
||||
* 卡数/核数
|
||||
*/
|
||||
private Integer computeNum;
|
||||
|
||||
/**
|
||||
* 内存大小
|
||||
*/
|
||||
private Integer memory;
|
||||
|
||||
/**
|
||||
* 显存大小
|
||||
*/
|
||||
private Integer vram;
|
||||
|
||||
/**
|
||||
* 算力中心(字典项表对应id)
|
||||
*/
|
||||
private Long computingCenterId;
|
||||
|
||||
/**
|
||||
* 费用类型:0->PrePaid(包年包月);1->PostPaid(按量付费);2->SpotWithPriceLimit(抢占式实例)
|
||||
*/
|
||||
private Byte chargeType;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 系统磁盘类别:0->cloud_efficiency(高效云盘);1->cloud_essd(ESSD云盘);2->cloud_ssd(ssd云盘);
|
||||
*/
|
||||
private Integer systemDiskCategory;
|
||||
|
||||
/**
|
||||
* 系统磁盘配置
|
||||
*/
|
||||
private Integer systemDiskSize;
|
||||
|
||||
/**
|
||||
* 带宽峰值
|
||||
*/
|
||||
private Integer internetMaxBandwidthOut;
|
||||
|
||||
/**
|
||||
* 镜像类型:0->public(公共);1->custom(自定义);2->shared(共享);3->market(市场);
|
||||
*/
|
||||
private Byte imageType;
|
||||
|
||||
/**
|
||||
* 镜像id
|
||||
*/
|
||||
private Long imageId;
|
||||
|
||||
/**
|
||||
* 时长单位:0->Week(周);1->Month(月);2->Year(年);3->Hour(时);
|
||||
*/
|
||||
private Byte priceUnit;
|
||||
|
||||
/**
|
||||
* 时长单价(费用:时长单价×时长)
|
||||
*/
|
||||
private BigDecimal durationPrice;
|
||||
|
||||
/**
|
||||
* 需求类型:0->算力需求;
|
||||
*/
|
||||
private Byte type;
|
||||
|
||||
/**
|
||||
* 适用场景、相关描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 浏览次数
|
||||
*/
|
||||
private Long clickNum;
|
||||
|
||||
/**
|
||||
* 是否可用:0->disable;1->available;
|
||||
*/
|
||||
private Boolean status;
|
||||
|
||||
/**
|
||||
* 乐观锁
|
||||
*/
|
||||
@Version
|
||||
private Integer version;
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package net.jointcloud.negotiation.entity;
|
||||
package net.jointcloud.negotiation.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
|
@ -19,7 +19,7 @@ import lombok.experimental.Accessors;
|
|||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
* @since 2023-07-30 08:29:09
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
@ -48,37 +48,37 @@ public class ConsumerEntity implements Serializable {
|
|||
/**
|
||||
* 行业
|
||||
*/
|
||||
private String industry;
|
||||
private String business;
|
||||
|
||||
/**
|
||||
* 计算资源
|
||||
* 计算资源(字典项表对应id)
|
||||
*/
|
||||
private Long computeTypeId;
|
||||
private Long computingResourceId;
|
||||
|
||||
/**
|
||||
* 卡类型
|
||||
* 卡类型(字典项表对应id)
|
||||
*/
|
||||
private Long cardTypeId;
|
||||
private Long computingCardId;
|
||||
|
||||
/**
|
||||
* 卡数/核数
|
||||
*/
|
||||
private Short computeNum;
|
||||
private Integer computeNum;
|
||||
|
||||
/**
|
||||
* 内存大小
|
||||
*/
|
||||
private Short memory;
|
||||
private Integer memory;
|
||||
|
||||
/**
|
||||
* 显存大小
|
||||
*/
|
||||
private Short vram;
|
||||
private Integer vram;
|
||||
|
||||
/**
|
||||
* 算力中心
|
||||
* 算力中心(字典项表对应id)
|
||||
*/
|
||||
private Long centreId;
|
||||
private Long computingCenterId;
|
||||
|
||||
/**
|
||||
* 费用类型:0->PrePaid(包年包月);1->PostPaid(按量付费);2->SpotWithPriceLimit(抢占式实例)
|
||||
|
@ -98,12 +98,12 @@ public class ConsumerEntity implements Serializable {
|
|||
/**
|
||||
* 系统磁盘配置
|
||||
*/
|
||||
private Short systemDiskSize;
|
||||
private Integer systemDiskSize;
|
||||
|
||||
/**
|
||||
* 带宽峰值
|
||||
*/
|
||||
private Byte internetMaxBandwidthOut;
|
||||
private Integer internetMaxBandwidthOut;
|
||||
|
||||
/**
|
||||
* 镜像类型:0->public(公共);1->custom(自定义);2->shared(共享);3->market(市场);
|
||||
|
@ -118,7 +118,7 @@ public class ConsumerEntity implements Serializable {
|
|||
/**
|
||||
* 服务器数量
|
||||
*/
|
||||
private Byte amount;
|
||||
private Integer amount;
|
||||
|
||||
/**
|
||||
* 时长单位:0->Week(周);1->Month(月);2->Year(年);3->Hour(时);
|
||||
|
@ -128,18 +128,13 @@ public class ConsumerEntity implements Serializable {
|
|||
/**
|
||||
* 购买时长数量
|
||||
*/
|
||||
private Byte durationAmount;
|
||||
private Integer durationAmount;
|
||||
|
||||
/**
|
||||
* 需求类型:0->算力需求;
|
||||
*/
|
||||
private Byte type;
|
||||
|
||||
/**
|
||||
* 行业类型id
|
||||
*/
|
||||
private Long industryTypeId;
|
||||
|
||||
/**
|
||||
* 需求描述
|
||||
*/
|
||||
|
@ -158,18 +153,18 @@ public class ConsumerEntity implements Serializable {
|
|||
/**
|
||||
* 需求状态:0->unsold(未成交);1->done(已成交);
|
||||
*/
|
||||
private Byte demandStatus;
|
||||
|
||||
/**
|
||||
* 是否可用:0->disable;1->available;
|
||||
*/
|
||||
private Boolean status;
|
||||
private Byte consumerStatus;
|
||||
|
||||
/**
|
||||
* 浏览次数
|
||||
*/
|
||||
private Long clickNum;
|
||||
|
||||
/**
|
||||
* 是否可用:0->disable;1->available;
|
||||
*/
|
||||
private Boolean status;
|
||||
|
||||
/**
|
||||
* 乐观锁
|
||||
*/
|
|
@ -1,25 +1,20 @@
|
|||
package net.jointcloud.negotiation.entity;
|
||||
package net.jointcloud.negotiation.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.Version;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务器镜像
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
* @since 2023-07-30 08:29:09
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
|
@ -1,26 +1,21 @@
|
|||
package net.jointcloud.negotiation.entity;
|
||||
package net.jointcloud.negotiation.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.Version;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务供应表
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
* @since 2023-07-30 09:49:48
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
@ -42,34 +37,44 @@ public class ProvideEntity implements Serializable {
|
|||
private String name;
|
||||
|
||||
/**
|
||||
* 计算资源
|
||||
* 领域
|
||||
*/
|
||||
private Long computeTypeId;
|
||||
private String domain;
|
||||
|
||||
/**
|
||||
* 卡类型
|
||||
* 行业
|
||||
*/
|
||||
private Long cardTypeId;
|
||||
private String business;
|
||||
|
||||
/**
|
||||
* 计算资源(字典项表对应id)
|
||||
*/
|
||||
private Long computingResourceId;
|
||||
|
||||
/**
|
||||
* 卡类型(字典项表对应id)
|
||||
*/
|
||||
private Long computingCardId;
|
||||
|
||||
/**
|
||||
* 卡数/核数
|
||||
*/
|
||||
private Short computeNum;
|
||||
private Integer computeNum;
|
||||
|
||||
/**
|
||||
* 内存大小
|
||||
*/
|
||||
private Short memory;
|
||||
private Integer memory;
|
||||
|
||||
/**
|
||||
* 显存大小
|
||||
*/
|
||||
private Short vram;
|
||||
private Integer vram;
|
||||
|
||||
/**
|
||||
* 算力中心
|
||||
* 算力中心(字典项表对应id)
|
||||
*/
|
||||
private Long centreId;
|
||||
private Long computingCenterId;
|
||||
|
||||
/**
|
||||
* 费用类型:0->PrePaid(包年包月);1->PostPaid(按量付费);2->SpotWithPriceLimit(抢占式实例)
|
||||
|
@ -84,17 +89,17 @@ public class ProvideEntity implements Serializable {
|
|||
/**
|
||||
* 系统磁盘类别:0->cloud_efficiency(高效云盘);1->cloud_essd(ESSD云盘);2->cloud_ssd(ssd云盘);
|
||||
*/
|
||||
private Byte systemDiskCategory;
|
||||
private Integer systemDiskCategory;
|
||||
|
||||
/**
|
||||
* 系统磁盘配置
|
||||
*/
|
||||
private Short systemDiskSize;
|
||||
private Integer systemDiskSize;
|
||||
|
||||
/**
|
||||
* 带宽峰值
|
||||
*/
|
||||
private Byte internetMaxBandwidthOut;
|
||||
private Integer internetMaxBandwidthOut;
|
||||
|
||||
/**
|
||||
* 镜像类型:0->public(公共);1->custom(自定义);2->shared(共享);3->market(市场);
|
||||
|
@ -121,26 +126,21 @@ public class ProvideEntity implements Serializable {
|
|||
*/
|
||||
private Byte type;
|
||||
|
||||
/**
|
||||
* 行业类型id
|
||||
*/
|
||||
private Long industryType;
|
||||
|
||||
/**
|
||||
* 适用场景、相关描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 是否可用:0->disable;1->available;
|
||||
*/
|
||||
private Boolean status;
|
||||
|
||||
/**
|
||||
* 浏览次数
|
||||
*/
|
||||
private Long clickNum;
|
||||
|
||||
/**
|
||||
* 是否可用:0->disable;1->available;
|
||||
*/
|
||||
private Boolean status;
|
||||
|
||||
/**
|
||||
* 乐观锁
|
||||
*/
|
|
@ -1,4 +1,4 @@
|
|||
package net.jointcloud.negotiation.entity;
|
||||
package net.jointcloud.negotiation.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
|
@ -15,17 +15,17 @@ import lombok.experimental.Accessors;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* 扩展类型字典表
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
* @since 2023-07-30 08:29:09
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("dictionary")
|
||||
public class DictionaryEntity implements Serializable {
|
||||
@TableName("sys_dict")
|
||||
public class SysDictEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
@ -36,19 +36,24 @@ public class DictionaryEntity implements Serializable {
|
|||
private Long id;
|
||||
|
||||
/**
|
||||
* 字典key
|
||||
* 字典名称
|
||||
*/
|
||||
private String dictionaryKey;
|
||||
private String dictName;
|
||||
|
||||
/**
|
||||
* 字典value
|
||||
* 字典编码
|
||||
*/
|
||||
private String dictionaryValue;
|
||||
private String dictCode;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
* 描述
|
||||
*/
|
||||
private String type;
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 字典类型0为string,1为number
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 是否可用:0->disable;1->available;
|
||||
|
@ -67,6 +72,11 @@ public class DictionaryEntity implements Serializable {
|
|||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
|
@ -74,7 +84,12 @@ public class DictionaryEntity implements Serializable {
|
|||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
|
@ -1,4 +1,4 @@
|
|||
package net.jointcloud.negotiation.entity;
|
||||
package net.jointcloud.negotiation.domain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
|
@ -15,17 +15,17 @@ import lombok.experimental.Accessors;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* 卡类型表
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
* @since 2023-07-30 08:29:09
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("card")
|
||||
public class CardEntity implements Serializable {
|
||||
@TableName("sys_dict_item")
|
||||
public class SysDictItemEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
@ -36,19 +36,44 @@ public class CardEntity implements Serializable {
|
|||
private Long id;
|
||||
|
||||
/**
|
||||
* 计算类型id
|
||||
* 字典id
|
||||
*/
|
||||
private String computeId;
|
||||
private Long dictId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
* 字典项文本
|
||||
*/
|
||||
private String name;
|
||||
private String itemText;
|
||||
|
||||
/**
|
||||
* 字典项值
|
||||
*/
|
||||
private String itemValue;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sortOrder;
|
||||
|
||||
/**
|
||||
* 字典类型0为string,1为number
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 父id
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 是否可用:0->disable;1->available;
|
||||
*/
|
||||
private Boolean status;
|
||||
private Byte status;
|
||||
|
||||
/**
|
||||
* 乐观锁
|
||||
|
@ -62,15 +87,13 @@ public class CardEntity implements Serializable {
|
|||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
private String updateBy;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
package net.jointcloud.negotiation.domain.vo;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springframework.data.domain.Page;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分页数据封装类
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
*/
|
||||
public class CommonPage<T> {
|
||||
/**
|
||||
* 当前页
|
||||
*/
|
||||
private Integer pageNum;
|
||||
/**
|
||||
* 每页显示条数,默认 10
|
||||
*/
|
||||
private Integer pageSize;
|
||||
|
||||
/**
|
||||
* 总页数
|
||||
*/
|
||||
private Integer totalPage;
|
||||
|
||||
/**
|
||||
* 总数
|
||||
*/
|
||||
private Long total;
|
||||
|
||||
/**
|
||||
* 查询数据列表
|
||||
*/
|
||||
private List<T> list;
|
||||
|
||||
/**
|
||||
* 将mybatis-plus分页后的list转为分页信息
|
||||
*/
|
||||
public static <T> CommonPage<T> restPage(IPage<T> ipage) {
|
||||
CommonPage<T> result = new CommonPage<>();
|
||||
result.setTotalPage((int) ipage.getPages());
|
||||
result.setPageNum((int) ipage.getCurrent());
|
||||
result.setPageSize((int) ipage.getSize());
|
||||
result.setTotal(ipage.getTotal());
|
||||
result.setList(ipage.getRecords());
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将SpringData分页后的list转为分页信息
|
||||
*/
|
||||
public static <T> CommonPage<T> restPage(Page<T> pageInfo) {
|
||||
CommonPage<T> result = new CommonPage<>();
|
||||
result.setTotalPage(pageInfo.getTotalPages());
|
||||
result.setPageNum(pageInfo.getNumber());
|
||||
result.setPageSize(pageInfo.getSize());
|
||||
result.setTotal(pageInfo.getTotalElements());
|
||||
result.setList(pageInfo.getContent());
|
||||
return result;
|
||||
}
|
||||
|
||||
public Integer getPageNum() {
|
||||
return pageNum;
|
||||
}
|
||||
|
||||
public void setPageNum(Integer pageNum) {
|
||||
this.pageNum = pageNum;
|
||||
}
|
||||
|
||||
public Integer getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public Integer getTotalPage() {
|
||||
return totalPage;
|
||||
}
|
||||
|
||||
public void setTotalPage(Integer totalPage) {
|
||||
this.totalPage = totalPage;
|
||||
}
|
||||
|
||||
public List<T> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<T> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
public Long getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(Long total) {
|
||||
this.total = total;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,201 @@
|
|||
package net.jointcloud.negotiation.domain.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 需求表
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-30 08:29:09
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("consumer")
|
||||
public class ConsumerVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 需求名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 领域
|
||||
*/
|
||||
private String domain;
|
||||
|
||||
/**
|
||||
* 行业
|
||||
*/
|
||||
private String business;
|
||||
|
||||
/**
|
||||
* 计算资源(字典项表对应id)
|
||||
*/
|
||||
private Long computingResourceId;
|
||||
|
||||
/**
|
||||
* 卡类型(字典项表对应id)
|
||||
*/
|
||||
private Long computingCardId;
|
||||
|
||||
/**
|
||||
* 卡数/核数
|
||||
*/
|
||||
private Integer computeNum;
|
||||
|
||||
/**
|
||||
* 内存大小
|
||||
*/
|
||||
private Integer memory;
|
||||
|
||||
/**
|
||||
* 显存大小
|
||||
*/
|
||||
private Integer vram;
|
||||
|
||||
/**
|
||||
* 算力中心(字典项表对应id)
|
||||
*/
|
||||
private Long computingCenterId;
|
||||
|
||||
/**
|
||||
* 费用类型:0->PrePaid(包年包月);1->PostPaid(按量付费);2->SpotWithPriceLimit(抢占式实例)
|
||||
*/
|
||||
private Byte chargeType;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 系统磁盘类别:0->cloud_efficiency(高效云盘);1->cloud_essd(ESSD云盘);2->cloud_ssd(ssd云盘);
|
||||
*/
|
||||
private Byte systemDiskCategory;
|
||||
|
||||
/**
|
||||
* 系统磁盘配置
|
||||
*/
|
||||
private Integer systemDiskSize;
|
||||
|
||||
/**
|
||||
* 带宽峰值
|
||||
*/
|
||||
private Integer internetMaxBandwidthOut;
|
||||
|
||||
/**
|
||||
* 镜像类型:0->public(公共);1->custom(自定义);2->shared(共享);3->market(市场);
|
||||
*/
|
||||
private Byte imageType;
|
||||
|
||||
/**
|
||||
* 镜像id
|
||||
*/
|
||||
private Long imageId;
|
||||
|
||||
/**
|
||||
* 服务器数量
|
||||
*/
|
||||
private Integer amount;
|
||||
|
||||
/**
|
||||
* 时长单位:0->Week(周);1->Month(月);2->Year(年);3->Hour(时);
|
||||
*/
|
||||
private Byte priceUnit;
|
||||
|
||||
/**
|
||||
* 购买时长数量
|
||||
*/
|
||||
private Integer durationAmount;
|
||||
|
||||
/**
|
||||
* 需求类型:0->算力需求;
|
||||
*/
|
||||
private Byte type;
|
||||
|
||||
/**
|
||||
* 需求描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 对接联系人
|
||||
*/
|
||||
private String dockingPerson;
|
||||
|
||||
/**
|
||||
* 对接联系方式
|
||||
*/
|
||||
private String dockingPhone;
|
||||
|
||||
/**
|
||||
* 需求状态:0->unsold(未成交);1->done(已成交);
|
||||
*/
|
||||
private Byte consumerStatus;
|
||||
|
||||
/**
|
||||
* 浏览次数
|
||||
*/
|
||||
private Long clickNum;
|
||||
|
||||
/**
|
||||
* 是否可用:0->disable;1->available;
|
||||
*/
|
||||
private Boolean status;
|
||||
|
||||
/**
|
||||
* 乐观锁
|
||||
*/
|
||||
@Version
|
||||
private Integer version;
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 计算资源名称
|
||||
*/
|
||||
private String computingResourceName;
|
||||
|
||||
/**
|
||||
* 算力中心名称
|
||||
*/
|
||||
private String computingCenterName;
|
||||
|
||||
/**
|
||||
* 卡类型
|
||||
*/
|
||||
private String computingCardName;
|
||||
}
|
|
@ -0,0 +1,181 @@
|
|||
package net.jointcloud.negotiation.domain.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务供应Dto
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class ProvideVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 需求名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 领域
|
||||
*/
|
||||
private String domain;
|
||||
|
||||
/**
|
||||
* 行业
|
||||
*/
|
||||
private String business;
|
||||
|
||||
/**
|
||||
* 计算资源(字典项表对应id)
|
||||
*/
|
||||
private Long computingResourceId;
|
||||
|
||||
/**
|
||||
* 卡类型(字典项表对应id)
|
||||
*/
|
||||
private Long computingCardId;
|
||||
|
||||
/**
|
||||
* 卡数/核数
|
||||
*/
|
||||
private Integer computeNum;
|
||||
|
||||
/**
|
||||
* 内存大小
|
||||
*/
|
||||
private Integer memory;
|
||||
|
||||
/**
|
||||
* 显存大小
|
||||
*/
|
||||
private Integer vram;
|
||||
|
||||
/**
|
||||
* 算力中心(字典项表对应id)
|
||||
*/
|
||||
private Long computingCenterId;
|
||||
|
||||
/**
|
||||
* 费用类型:0->PrePaid(包年包月);1->PostPaid(按量付费);2->SpotWithPriceLimit(抢占式实例)
|
||||
*/
|
||||
private Byte chargeType;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 系统磁盘类别:0->cloud_efficiency(高效云盘);1->cloud_essd(ESSD云盘);2->cloud_ssd(ssd云盘);
|
||||
*/
|
||||
private Integer systemDiskCategory;
|
||||
|
||||
/**
|
||||
* 系统磁盘配置
|
||||
*/
|
||||
private Integer systemDiskSize;
|
||||
|
||||
/**
|
||||
* 带宽峰值
|
||||
*/
|
||||
private Integer internetMaxBandwidthOut;
|
||||
|
||||
/**
|
||||
* 镜像类型:0->public(公共);1->custom(自定义);2->shared(共享);3->market(市场);
|
||||
*/
|
||||
private Byte imageType;
|
||||
|
||||
/**
|
||||
* 镜像id
|
||||
*/
|
||||
private Long imageId;
|
||||
|
||||
/**
|
||||
* 时长单位:0->Week(周);1->Month(月);2->Year(年);3->Hour(时);
|
||||
*/
|
||||
private Byte priceUnit;
|
||||
|
||||
/**
|
||||
* 时长单价(费用:时长单价×时长)
|
||||
*/
|
||||
private BigDecimal durationPrice;
|
||||
|
||||
/**
|
||||
* 需求类型:0->算力需求;
|
||||
*/
|
||||
private Byte type;
|
||||
|
||||
/**
|
||||
* 适用场景、相关描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 浏览次数
|
||||
*/
|
||||
private Long clickNum;
|
||||
|
||||
/**
|
||||
* 是否可用:0->disable;1->available;
|
||||
*/
|
||||
private Boolean status;
|
||||
|
||||
/**
|
||||
* 乐观锁
|
||||
*/
|
||||
@Version
|
||||
private Integer version;
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 计算资源名称
|
||||
*/
|
||||
private String computingResourceName;
|
||||
|
||||
/**
|
||||
* 算力中心名称
|
||||
*/
|
||||
private String computingCenterName;
|
||||
|
||||
/**
|
||||
* 卡类型
|
||||
*/
|
||||
private String computingCardName;
|
||||
}
|
|
@ -0,0 +1,114 @@
|
|||
package net.jointcloud.negotiation.domain.vo;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
import java.util.StringJoiner;
|
||||
|
||||
public class Result<T> {
|
||||
/**
|
||||
* 业务错误码
|
||||
*/
|
||||
private Integer code;
|
||||
/**
|
||||
* 信息描述
|
||||
*/
|
||||
private String message;
|
||||
/**
|
||||
* 返回参数
|
||||
*/
|
||||
private T data;
|
||||
|
||||
protected Result() {
|
||||
}
|
||||
|
||||
private Result(HttpStatus httpStatus, T data) {
|
||||
this.code = httpStatus.value();
|
||||
this.message = httpStatus.getReasonPhrase();
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
private Result(Integer code, String message, T data) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务成功返回业务代码和描述信息
|
||||
*/
|
||||
public static Result<Void> success() {
|
||||
return new Result<>(HttpStatus.OK, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务成功返回业务代码,描述和返回的参数
|
||||
*/
|
||||
public static <T> Result<T> success(T data) {
|
||||
return new Result<>(HttpStatus.OK, data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 业务成功返回业务代码,描述和返回的参数
|
||||
*/
|
||||
public static <T> Result<T> success(Integer code, String message, T data) {
|
||||
return new Result<>(code, message, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务异常返回业务代码和描述信息
|
||||
*/
|
||||
public static <T> Result<T> failure() {
|
||||
return new Result<>(HttpStatus.INTERNAL_SERVER_ERROR, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务异常返回业务代码,描述和返回的参数
|
||||
*/
|
||||
public static <T> Result<T> failure(Integer code, String message) {
|
||||
return failure(code, message, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务异常返回业务代码,描述和返回的参数
|
||||
*/
|
||||
public static <T> Result<T> failure(Integer code, String message, T data) {
|
||||
|
||||
return new Result<>(code, message, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 未登录返回结果
|
||||
*/
|
||||
public static <T> Result<T> unauthorized(T data) {
|
||||
return new Result<>(HttpStatus.UNAUTHORIZED.value(), "暂未登录或token已经过期", data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 未授权返回结果
|
||||
*/
|
||||
public static <T> Result<T> forbidden(T data) {
|
||||
return new Result<T>(HttpStatus.FORBIDDEN.value(), "没有相关权限", data);
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new StringJoiner(", ", Result.class.getSimpleName() + "[", "]")
|
||||
.add("code=" + code)
|
||||
.add("message='" + message + "'")
|
||||
.add("data=" + data)
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
package net.jointcloud.negotiation.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.Version;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 算力类型表
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("computing_power_type")
|
||||
public class ComputingPowerTypeEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 是否可用:0->disable;1->available;
|
||||
*/
|
||||
private Boolean status;
|
||||
|
||||
/**
|
||||
* 乐观锁
|
||||
*/
|
||||
@Version
|
||||
private Integer version;
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package net.jointcloud.negotiation.mapper;
|
||||
|
||||
import net.jointcloud.negotiation.entity.CardEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 卡类型表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
*/
|
||||
public interface CardMapper extends BaseMapper<CardEntity> {
|
||||
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package net.jointcloud.negotiation.mapper;
|
||||
|
||||
import net.jointcloud.negotiation.entity.ComputingPowerTypeEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 算力类型表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
*/
|
||||
public interface ComputingPowerTypeMapper extends BaseMapper<ComputingPowerTypeEntity> {
|
||||
|
||||
}
|
|
@ -1,7 +1,12 @@
|
|||
package net.jointcloud.negotiation.mapper;
|
||||
|
||||
import net.jointcloud.negotiation.entity.ConsumerEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import net.jointcloud.negotiation.domain.dto.ConsumerReq;
|
||||
import net.jointcloud.negotiation.domain.entity.ConsumerEntity;
|
||||
import net.jointcloud.negotiation.domain.vo.ConsumerVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -9,8 +14,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
* @since 2023-07-30 08:29:09
|
||||
*/
|
||||
public interface ConsumerMapper extends BaseMapper<ConsumerEntity> {
|
||||
|
||||
IPage<ConsumerVo> selectConsumerPage(Page<?> page, @Param("req") ConsumerReq consumerReq);
|
||||
ConsumerVo queryById(Long id);
|
||||
}
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
package net.jointcloud.negotiation.mapper;
|
||||
|
||||
import net.jointcloud.negotiation.entity.DictionaryEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 扩展类型字典表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
*/
|
||||
public interface DictionaryMapper extends BaseMapper<DictionaryEntity> {
|
||||
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
package net.jointcloud.negotiation.mapper;
|
||||
|
||||
import net.jointcloud.negotiation.entity.ImageEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import net.jointcloud.negotiation.domain.entity.ImageEntity;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -9,8 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
* @since 2023-07-30 08:29:09
|
||||
*/
|
||||
public interface ImageMapper extends BaseMapper<ImageEntity> {
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
package net.jointcloud.negotiation.mapper;
|
||||
|
||||
import net.jointcloud.negotiation.entity.ProvideEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import net.jointcloud.negotiation.domain.dto.ProvideReq;
|
||||
import net.jointcloud.negotiation.domain.entity.ProvideEntity;
|
||||
import net.jointcloud.negotiation.domain.vo.ProvideVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -9,8 +14,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
* @since 2023-07-30 08:29:09
|
||||
*/
|
||||
public interface ProvideMapper extends BaseMapper<ProvideEntity> {
|
||||
IPage<ProvideVo> selectProvidePage(Page<?> page, @Param("provideReq") ProvideReq provideReq);
|
||||
|
||||
ProvideVo queryById(Long id);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
package net.jointcloud.negotiation.mapper;
|
||||
|
||||
import net.jointcloud.negotiation.domain.entity.SysDictItemEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-30 08:29:09
|
||||
*/
|
||||
public interface SysDictItemMapper extends BaseMapper<SysDictItemEntity> {
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package net.jointcloud.negotiation.mapper;
|
||||
|
||||
import net.jointcloud.negotiation.domain.entity.SysDictEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-30 08:29:09
|
||||
*/
|
||||
public interface SysDictMapper extends BaseMapper<SysDictEntity> {
|
||||
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package net.jointcloud.negotiation.service;
|
||||
|
||||
import net.jointcloud.negotiation.entity.CardEntity;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 卡类型表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
*/
|
||||
public interface CardService extends IService<CardEntity> {
|
||||
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package net.jointcloud.negotiation.service;
|
||||
|
||||
import net.jointcloud.negotiation.entity.ComputingPowerTypeEntity;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 算力类型表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
*/
|
||||
public interface ComputingPowerTypeService extends IService<ComputingPowerTypeEntity> {
|
||||
|
||||
}
|
|
@ -1,7 +1,11 @@
|
|||
package net.jointcloud.negotiation.service;
|
||||
|
||||
import net.jointcloud.negotiation.entity.ConsumerEntity;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import net.jointcloud.negotiation.domain.dto.ConsumerReq;
|
||||
import net.jointcloud.negotiation.domain.entity.ConsumerEntity;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import net.jointcloud.negotiation.domain.vo.ConsumerVo;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -13,4 +17,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
*/
|
||||
public interface ConsumerService extends IService<ConsumerEntity> {
|
||||
|
||||
IPage<ConsumerVo> pageList(ConsumerReq consumerReq, Page<?> objectPage);
|
||||
|
||||
ConsumerVo queryById(Long id);
|
||||
}
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
package net.jointcloud.negotiation.service;
|
||||
|
||||
import net.jointcloud.negotiation.entity.DictionaryEntity;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 扩展类型字典表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
*/
|
||||
public interface DictionaryService extends IService<DictionaryEntity> {
|
||||
|
||||
}
|
|
@ -1,7 +1,12 @@
|
|||
package net.jointcloud.negotiation.service;
|
||||
|
||||
import net.jointcloud.negotiation.entity.ImageEntity;
|
||||
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.IService;
|
||||
import net.jointcloud.negotiation.domain.entity.ImageEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -13,4 +18,21 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
*/
|
||||
public interface ImageService extends IService<ImageEntity> {
|
||||
|
||||
/**
|
||||
* 查询所有系统名称列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<Object> selectSystemNameGroup();
|
||||
|
||||
/**
|
||||
* 根据系统名称查询镜像
|
||||
*
|
||||
* @param systemName
|
||||
* @return
|
||||
*/
|
||||
List<ImageEntity> selectBySystemName(String systemName);
|
||||
|
||||
// 简单分页查询:条件构造器QueryWrapper
|
||||
IPage<ImageEntity> selectByPage(Page<ImageEntity> page, QueryWrapper<ImageEntity> queryWrapper);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
package net.jointcloud.negotiation.service;
|
||||
|
||||
import net.jointcloud.negotiation.entity.ProvideEntity;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import net.jointcloud.negotiation.domain.dto.ProvideReq;
|
||||
import net.jointcloud.negotiation.domain.entity.ProvideEntity;
|
||||
import net.jointcloud.negotiation.domain.vo.ProvideVo;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -9,8 +13,10 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
* @since 2023-07-30 09:49:48
|
||||
*/
|
||||
public interface ProvideService extends IService<ProvideEntity> {
|
||||
IPage<ProvideVo> pageList(ProvideReq provideReq, Page<?> page);
|
||||
|
||||
ProvideVo queryById(Long id);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
package net.jointcloud.negotiation.service;
|
||||
|
||||
import net.jointcloud.negotiation.domain.entity.SysDictItemEntity;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-30 07:15:07
|
||||
*/
|
||||
public interface SysDictItemService extends IService<SysDictItemEntity> {
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package net.jointcloud.negotiation.service;
|
||||
|
||||
import net.jointcloud.negotiation.domain.entity.SysDictEntity;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-30 07:15:07
|
||||
*/
|
||||
public interface SysDictService extends IService<SysDictEntity> {
|
||||
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package net.jointcloud.negotiation.service.impl;
|
||||
|
||||
import net.jointcloud.negotiation.entity.CardEntity;
|
||||
import net.jointcloud.negotiation.mapper.CardMapper;
|
||||
import net.jointcloud.negotiation.service.CardService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 卡类型表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
*/
|
||||
@Service
|
||||
public class CardServiceImpl extends ServiceImpl<CardMapper, CardEntity> implements CardService {
|
||||
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package net.jointcloud.negotiation.service.impl;
|
||||
|
||||
import net.jointcloud.negotiation.entity.ComputingPowerTypeEntity;
|
||||
import net.jointcloud.negotiation.mapper.ComputingPowerTypeMapper;
|
||||
import net.jointcloud.negotiation.service.ComputingPowerTypeService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 算力类型表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
*/
|
||||
@Service
|
||||
public class ComputingPowerTypeServiceImpl extends ServiceImpl<ComputingPowerTypeMapper, ComputingPowerTypeEntity> implements ComputingPowerTypeService {
|
||||
|
||||
}
|
|
@ -1,9 +1,15 @@
|
|||
package net.jointcloud.negotiation.service.impl;
|
||||
|
||||
import net.jointcloud.negotiation.entity.ConsumerEntity;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import net.jointcloud.negotiation.domain.dto.ConsumerReq;
|
||||
import net.jointcloud.negotiation.domain.entity.ConsumerEntity;
|
||||
import net.jointcloud.negotiation.domain.vo.ConsumerVo;
|
||||
import net.jointcloud.negotiation.mapper.ConsumerMapper;
|
||||
import net.jointcloud.negotiation.service.ConsumerService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
|
@ -16,5 +22,27 @@ import org.springframework.stereotype.Service;
|
|||
*/
|
||||
@Service
|
||||
public class ConsumerServiceImpl extends ServiceImpl<ConsumerMapper, ConsumerEntity> implements ConsumerService {
|
||||
@Autowired
|
||||
private ConsumerMapper consumerMapper;
|
||||
private static final Object LOCK = new Object();
|
||||
@Override
|
||||
public IPage<ConsumerVo> pageList(ConsumerReq consumerReq, Page<?> objectPage) {
|
||||
return consumerMapper.selectConsumerPage(objectPage, consumerReq);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConsumerVo queryById(Long id) {
|
||||
synchronized (LOCK) {
|
||||
ConsumerVo vo = consumerMapper.queryById(id);
|
||||
ConsumerEntity entity = new ConsumerEntity();
|
||||
if (vo != null) {
|
||||
Long clickNum = vo.getClickNum()+1;
|
||||
BeanUtils.copyProperties(vo, entity);
|
||||
entity.setClickNum(clickNum);
|
||||
consumerMapper.updateById(entity);
|
||||
vo.setClickNum(clickNum);
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
package net.jointcloud.negotiation.service.impl;
|
||||
|
||||
import net.jointcloud.negotiation.entity.DictionaryEntity;
|
||||
import net.jointcloud.negotiation.mapper.DictionaryMapper;
|
||||
import net.jointcloud.negotiation.service.DictionaryService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 扩展类型字典表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
*/
|
||||
@Service
|
||||
public class DictionaryServiceImpl extends ServiceImpl<DictionaryMapper, DictionaryEntity> implements DictionaryService {
|
||||
|
||||
}
|
|
@ -1,11 +1,19 @@
|
|||
package net.jointcloud.negotiation.service.impl;
|
||||
|
||||
import net.jointcloud.negotiation.entity.ImageEntity;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import net.jointcloud.negotiation.domain.entity.ImageEntity;
|
||||
import net.jointcloud.negotiation.mapper.ImageMapper;
|
||||
import net.jointcloud.negotiation.service.ImageService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务器镜像 服务实现类
|
||||
|
@ -17,4 +25,26 @@ import org.springframework.stereotype.Service;
|
|||
@Service
|
||||
public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> implements ImageService {
|
||||
|
||||
@Autowired
|
||||
private ImageMapper imageMapper;
|
||||
|
||||
@Override
|
||||
public List<Object> selectSystemNameGroup() {
|
||||
LambdaQueryWrapper<ImageEntity> imageEntityLambdaQueryWrapper = Wrappers.lambdaQuery(ImageEntity.class);
|
||||
imageEntityLambdaQueryWrapper.select(ImageEntity::getSystemName);
|
||||
imageEntityLambdaQueryWrapper.groupBy(ImageEntity::getSystemName);
|
||||
return imageMapper.selectObjs(imageEntityLambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ImageEntity> selectBySystemName(String systemName) {
|
||||
LambdaQueryWrapper<ImageEntity> imageLambdaQueryWrapper = Wrappers.lambdaQuery();
|
||||
imageLambdaQueryWrapper.eq(ImageEntity::getSystemName, systemName);
|
||||
return imageMapper.selectList(imageLambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<ImageEntity> selectByPage(Page<ImageEntity> page, QueryWrapper<ImageEntity> queryWrapper) {
|
||||
return imageMapper.selectPage(page, queryWrapper);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
package net.jointcloud.negotiation.service.impl;
|
||||
|
||||
import net.jointcloud.negotiation.entity.ProvideEntity;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import net.jointcloud.negotiation.domain.dto.ProvideReq;
|
||||
import net.jointcloud.negotiation.domain.entity.ProvideEntity;
|
||||
import net.jointcloud.negotiation.domain.vo.ProvideVo;
|
||||
import net.jointcloud.negotiation.mapper.ProvideMapper;
|
||||
import net.jointcloud.negotiation.service.ProvideService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
|
@ -12,9 +18,33 @@ import org.springframework.stereotype.Service;
|
|||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-28 06:24:50
|
||||
* @since 2023-07-30 09:49:48
|
||||
*/
|
||||
@Service
|
||||
public class ProvideServiceImpl extends ServiceImpl<ProvideMapper, ProvideEntity> implements ProvideService {
|
||||
private static final Object LOCK = new Object();
|
||||
|
||||
@Autowired
|
||||
private ProvideMapper provideMapper;
|
||||
|
||||
public IPage<ProvideVo> pageList(ProvideReq provideReq, Page<?> page) {
|
||||
return provideMapper.selectProvidePage(page, provideReq);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProvideVo queryById(Long id) {
|
||||
synchronized (LOCK) {
|
||||
ProvideVo provideVo = provideMapper.queryById(id);
|
||||
|
||||
ProvideEntity provideEntity = new ProvideEntity();
|
||||
if (provideVo != null) {
|
||||
Long clickNum = provideVo.getClickNum()+1;
|
||||
BeanUtils.copyProperties(provideVo, provideEntity);
|
||||
provideEntity.setClickNum(clickNum);
|
||||
provideMapper.updateById(provideEntity);
|
||||
provideVo.setClickNum(clickNum);
|
||||
}
|
||||
return provideVo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
package net.jointcloud.negotiation.service.impl;
|
||||
|
||||
import net.jointcloud.negotiation.domain.entity.SysDictItemEntity;
|
||||
import net.jointcloud.negotiation.mapper.SysDictItemMapper;
|
||||
import net.jointcloud.negotiation.service.SysDictItemService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-30 07:15:07
|
||||
*/
|
||||
@Service
|
||||
public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDictItemEntity> implements SysDictItemService {
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package net.jointcloud.negotiation.service.impl;
|
||||
|
||||
import net.jointcloud.negotiation.domain.entity.SysDictEntity;
|
||||
import net.jointcloud.negotiation.mapper.SysDictMapper;
|
||||
import net.jointcloud.negotiation.service.SysDictService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author jointcloud
|
||||
* @since 2023-07-30 07:15:07
|
||||
*/
|
||||
@Service
|
||||
public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDictEntity> implements SysDictService {
|
||||
|
||||
}
|
|
@ -10,8 +10,7 @@ spring:
|
|||
username: root
|
||||
password: uJpLd6u-J?HC1
|
||||
redis:
|
||||
host: jcce-redis-master.jcce-system.svc.cluster.local
|
||||
password: redisPW123
|
||||
host: 127.0.0.1
|
||||
database: 0
|
||||
timeout: 5000ms
|
||||
lettuce:
|
||||
|
@ -22,29 +21,15 @@ spring:
|
|||
min-idle: 0
|
||||
time-between-eviction-runs: 1s
|
||||
|
||||
|
||||
redis:
|
||||
database: mall
|
||||
key:
|
||||
admin: 'ums:admin'
|
||||
authCode: 'ums:authCode'
|
||||
orderId: 'oms:orderId'
|
||||
member: 'ums:member'
|
||||
expire:
|
||||
authCode: 90 # ???????
|
||||
common: 86400 # 24??
|
||||
|
||||
rocketmq:
|
||||
name-server: 10.101.15.7:9876
|
||||
producer:
|
||||
group: mallprovider
|
||||
|
||||
ledger:
|
||||
order-chain-url: http://106.12.209.189:8080/contract/orderCoChain
|
||||
provider: 'provider:count'
|
||||
consumer: 'consumer:orderId'
|
||||
|
||||
logging:
|
||||
level:
|
||||
com.jointcloud.jcce: info
|
||||
net.jointcloud.negotiation: debug
|
||||
config: classpath:logback-jcc.xml
|
||||
file:
|
||||
path: logs/@project.name@-@project.version@
|
||||
|
@ -52,6 +37,6 @@ logging:
|
|||
mybatis-plus:
|
||||
global-config:
|
||||
db-config:
|
||||
logic-delete-field: flag # ????????????(since 3.3.0,????????????2)
|
||||
logic-delete-value: 1 # ??????(??? 1)
|
||||
logic-not-delete-value: 0 # ??????(??? 0)
|
||||
logic-delete-field: flag # 全局逻辑删除的实体字段名(since 3.3.0,配置后可以忽略不配置步骤2)
|
||||
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
|
||||
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
|
|
@ -0,0 +1,86 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.jointcloud.negotiation.mapper.ConsumerMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="net.jointcloud.negotiation.domain.entity.ConsumerEntity">
|
||||
<id column="id" property="id" />
|
||||
<result column="name" property="name" />
|
||||
<result column="domain" property="domain" />
|
||||
<result column="business" property="business" />
|
||||
<result column="computing_resource_id" property="computingResourceId" />
|
||||
<result column="computing_card_id" property="computingCardId" />
|
||||
<result column="compute_num" property="computeNum" />
|
||||
<result column="memory" property="memory" />
|
||||
<result column="vram" property="vram" />
|
||||
<result column="computing_center_id" property="computingCenterId" />
|
||||
<result column="charge_type" property="chargeType" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="system_disk_category" property="systemDiskCategory" />
|
||||
<result column="system_disk_size" property="systemDiskSize" />
|
||||
<result column="internet_max_bandwidth_out" property="internetMaxBandwidthOut" />
|
||||
<result column="image_type" property="imageType" />
|
||||
<result column="image_id" property="imageId" />
|
||||
<result column="amount" property="amount" />
|
||||
<result column="price_unit" property="priceUnit" />
|
||||
<result column="duration_amount" property="durationAmount" />
|
||||
<result column="type" property="type" />
|
||||
<result column="description" property="description" />
|
||||
<result column="docking_person" property="dockingPerson" />
|
||||
<result column="docking_phone" property="dockingPhone" />
|
||||
<result column="consumer_status" property="consumerStatus" />
|
||||
<result column="click_num" property="clickNum" />
|
||||
<result column="status" property="status" />
|
||||
<result column="version" property="version" />
|
||||
<result column="deleted" property="deleted" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ConsumerVoResultMap" type="net.jointcloud.negotiation.domain.vo.ConsumerVo" extends="BaseResultMap">
|
||||
<result column="computingResourceName" jdbcType="VARCHAR" property="computingResourceName"/>
|
||||
<result column="computingCenterName" jdbcType="VARCHAR" property="computingCenterName"/>
|
||||
<result column="computingCardName" jdbcType="VARCHAR" property="computingCardName"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, name, domain, business, computing_resource_id, computing_card_id, compute_num, memory, vram, computing_center_id, charge_type, user_id, system_disk_category, system_disk_size, internet_max_bandwidth_out, image_type, image_id, amount, price_unit, duration_amount, type, description, docking_person, docking_phone, consumer_status, click_num, status, version, deleted, create_time, update_time
|
||||
</sql>
|
||||
|
||||
<select id="selectConsumerPage" parameterType="net.jointcloud.negotiation.domain.dto.ConsumerReq"
|
||||
resultMap="ConsumerVoResultMap">
|
||||
select p.*,
|
||||
resource_item.item_text as computingResourceName,
|
||||
center_item.item_text as computingCenterName,
|
||||
card_item.item_text as computingCardName
|
||||
from consumer p
|
||||
join sys_dict_item resource_item on p.computing_resource_id = resource_item.id
|
||||
join sys_dict_item center_item on p.computing_center_id = center_item.id
|
||||
join sys_dict_item card_item on p.computing_card_id = card_item.id
|
||||
<where>
|
||||
<if test="req.computingResourceId != null">
|
||||
and p.computing_resource_id = #{req.computingResourceId}
|
||||
</if>
|
||||
<if test="req.computingCenterId != null ">
|
||||
and p.computing_center_id = #{req.computingResourceId.name,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="req.name != null">
|
||||
and p.name = #{req.computingResourceId.name,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</where>
|
||||
order by p.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="queryById" resultType="net.jointcloud.negotiation.domain.vo.ConsumerVo">
|
||||
select p.*,
|
||||
resource_item.item_text as computingResourceName,
|
||||
center_item.item_text as computingCenterName,
|
||||
card_item.item_text as computingCardName
|
||||
from consumer p
|
||||
join sys_dict_item resource_item on p.computing_resource_id = resource_item.id
|
||||
join sys_dict_item center_item on p.computing_center_id = center_item.id
|
||||
join sys_dict_item card_item on p.computing_card_id = card_item.id
|
||||
where p.id = #{id,jdbcType=VARCHAR}
|
||||
</select>
|
||||
</mapper>
|
|
@ -3,7 +3,7 @@
|
|||
<mapper namespace="net.jointcloud.negotiation.mapper.ImageMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="net.jointcloud.negotiation.entity.ImageEntity">
|
||||
<resultMap id="BaseResultMap" type="net.jointcloud.negotiation.domain.entity.ImageEntity">
|
||||
<id column="id" property="id" />
|
||||
<result column="image_id" property="imageId" />
|
||||
<result column="image_name" property="imageName" />
|
||||
|
@ -26,5 +26,4 @@
|
|||
<sql id="Base_Column_List">
|
||||
id, image_id, image_name, image_type, system_name, os_name, os_name_en, status, architecture, os_type, image_version, description, version, deleted, create_time, update_time
|
||||
</sql>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,83 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.jointcloud.negotiation.mapper.ProvideMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="net.jointcloud.negotiation.domain.entity.ProvideEntity">
|
||||
<id column="id" property="id" />
|
||||
<result column="name" property="name" />
|
||||
<result column="domain" property="domain" />
|
||||
<result column="business" property="business" />
|
||||
<result column="computing_resource_id" property="computingResourceId" />
|
||||
<result column="computing_card_id" property="computingCardId" />
|
||||
<result column="compute_num" property="computeNum" />
|
||||
<result column="memory" property="memory" />
|
||||
<result column="vram" property="vram" />
|
||||
<result column="computing_center_id" property="computingCenterId" />
|
||||
<result column="charge_type" property="chargeType" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="system_disk_category" property="systemDiskCategory" />
|
||||
<result column="system_disk_size" property="systemDiskSize" />
|
||||
<result column="internet_max_bandwidth_out" property="internetMaxBandwidthOut" />
|
||||
<result column="image_type" property="imageType" />
|
||||
<result column="image_id" property="imageId" />
|
||||
<result column="price_unit" property="priceUnit" />
|
||||
<result column="duration_price" property="durationPrice" />
|
||||
<result column="type" property="type" />
|
||||
<result column="description" property="description" />
|
||||
<result column="click_num" property="clickNum" />
|
||||
<result column="status" property="status" />
|
||||
<result column="version" property="version" />
|
||||
<result column="deleted" property="deleted" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ProvideVoResultMap" type="net.jointcloud.negotiation.domain.vo.ProvideVo" extends="BaseResultMap">
|
||||
<result column="computingResourceName" jdbcType="VARCHAR" property="computingResourceName"/>
|
||||
<result column="computingCenterName" jdbcType="VARCHAR" property="computingCenterName"/>
|
||||
<result column="computingCardName" jdbcType="VARCHAR" property="computingCardName"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, name, domain, business, computing_resource_id, computing_card_id, compute_num, memory, vram, computing_center_id, charge_type, user_id, system_disk_category, system_disk_size, internet_max_bandwidth_out, image_type, image_id, price_unit, duration_price, type, description, click_num, status, version, deleted, create_time, update_time
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="selectProvidePage" parameterType="net.jointcloud.negotiation.domain.dto.ProvideReq"
|
||||
resultMap="ProvideVoResultMap">
|
||||
select p.*,
|
||||
resource_item.item_text as computingResourceName,
|
||||
center_item.item_text as computingCenterName,
|
||||
card_item.item_text as computingCardName
|
||||
from provide p
|
||||
join sys_dict_item resource_item on p.computing_resource_id = resource_item.id
|
||||
join sys_dict_item center_item on p.computing_center_id = center_item.id
|
||||
join sys_dict_item card_item on p.computing_card_id = card_item.id
|
||||
<where>
|
||||
<if test="provideReq.computingResourceId != null">
|
||||
and p.computing_resource_id = #{provideReq.computingResourceId}
|
||||
</if>
|
||||
<if test="provideReq.computingCenterId != null ">
|
||||
and p.computing_center_id = #{provideReq.computingResourceId.name,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="provideReq.name != null">
|
||||
and p.name = #{provideReq.computingResourceId.name,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</where>
|
||||
order by p.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="queryById" resultMap="ProvideVoResultMap">
|
||||
select p.*,
|
||||
resource_item.item_text as computingResourceName,
|
||||
center_item.item_text as computingCenterName,
|
||||
card_item.item_text as computingCardName
|
||||
from provide p
|
||||
join sys_dict_item resource_item on p.computing_resource_id = resource_item.id
|
||||
join sys_dict_item center_item on p.computing_center_id = center_item.id
|
||||
join sys_dict_item card_item on p.computing_card_id = card_item.id
|
||||
where p.id = #{id,jdbcType=VARCHAR}
|
||||
</select>
|
||||
</mapper>
|
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.jointcloud.negotiation.mapper.SysDictItemMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="net.jointcloud.negotiation.domain.entity.SysDictItemEntity">
|
||||
<id column="id" property="id" />
|
||||
<result column="dict_id" property="dictId" />
|
||||
<result column="item_text" property="itemText" />
|
||||
<result column="item_value" property="itemValue" />
|
||||
<result column="description" property="description" />
|
||||
<result column="sort_order" property="sortOrder" />
|
||||
<result column="type" property="type" />
|
||||
<result column="parent_id" property="parentId" />
|
||||
<result column="status" property="status" />
|
||||
<result column="version" property="version" />
|
||||
<result column="deleted" property="deleted" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, dict_id, item_text, item_value, description, sort_order, type, parent_id, status, version, deleted, create_by, create_time, update_by, update_time
|
||||
</sql>
|
||||
|
||||
</mapper>
|
|
@ -1,23 +1,26 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.jointcloud.negotiation.mapper.DictionaryMapper">
|
||||
<mapper namespace="net.jointcloud.negotiation.mapper.SysDictMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="net.jointcloud.negotiation.entity.DictionaryEntity">
|
||||
<resultMap id="BaseResultMap" type="net.jointcloud.negotiation.domain.entity.SysDictEntity">
|
||||
<id column="id" property="id" />
|
||||
<result column="dictionary_key" property="dictionaryKey" />
|
||||
<result column="dictionary_value" property="dictionaryValue" />
|
||||
<result column="dict_name" property="dictName" />
|
||||
<result column="dict_code" property="dictCode" />
|
||||
<result column="description" property="description" />
|
||||
<result column="type" property="type" />
|
||||
<result column="status" property="status" />
|
||||
<result column="version" property="version" />
|
||||
<result column="deleted" property="deleted" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, dictionary_key, dictionary_value, type, status, version, deleted, create_time, update_time
|
||||
id, dict_name, dict_code, description, type, status, version, deleted, create_by, create_time, update_by, update_time
|
||||
</sql>
|
||||
|
||||
</mapper>
|
|
@ -1,22 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.jointcloud.negotiation.mapper.CardMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="net.jointcloud.negotiation.entity.CardEntity">
|
||||
<id column="id" property="id" />
|
||||
<result column="compute_id" property="computeId" />
|
||||
<result column="name" property="name" />
|
||||
<result column="status" property="status" />
|
||||
<result column="version" property="version" />
|
||||
<result column="deleted" property="deleted" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="create_time" property="createTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, compute_id, name, status, version, deleted, update_time, create_time
|
||||
</sql>
|
||||
|
||||
</mapper>
|
|
@ -1,21 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.jointcloud.negotiation.mapper.ComputingPowerTypeMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="net.jointcloud.negotiation.entity.ComputingPowerTypeEntity">
|
||||
<id column="id" property="id" />
|
||||
<result column="name" property="name" />
|
||||
<result column="status" property="status" />
|
||||
<result column="version" property="version" />
|
||||
<result column="deleted" property="deleted" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, name, status, version, deleted, create_time, update_time
|
||||
</sql>
|
||||
|
||||
</mapper>
|
|
@ -1,46 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.jointcloud.negotiation.mapper.ConsumerMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="net.jointcloud.negotiation.entity.ConsumerEntity">
|
||||
<id column="id" property="id" />
|
||||
<result column="name" property="name" />
|
||||
<result column="domain" property="domain" />
|
||||
<result column="industry" property="industry" />
|
||||
<result column="compute_type_id" property="computeTypeId" />
|
||||
<result column="card_type_id" property="cardTypeId" />
|
||||
<result column="compute_num" property="computeNum" />
|
||||
<result column="memory" property="memory" />
|
||||
<result column="vram" property="vram" />
|
||||
<result column="centre_id" property="centreId" />
|
||||
<result column="charge_type" property="chargeType" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="system_disk_category" property="systemDiskCategory" />
|
||||
<result column="system_disk_size" property="systemDiskSize" />
|
||||
<result column="internet_max_bandwidth_out" property="internetMaxBandwidthOut" />
|
||||
<result column="image_type" property="imageType" />
|
||||
<result column="image_id" property="imageId" />
|
||||
<result column="amount" property="amount" />
|
||||
<result column="price_unit" property="priceUnit" />
|
||||
<result column="duration_amount" property="durationAmount" />
|
||||
<result column="type" property="type" />
|
||||
<result column="industry_type_id" property="industryTypeId" />
|
||||
<result column="description" property="description" />
|
||||
<result column="docking_person" property="dockingPerson" />
|
||||
<result column="docking_phone" property="dockingPhone" />
|
||||
<result column="demand_status" property="demandStatus" />
|
||||
<result column="status" property="status" />
|
||||
<result column="click_num" property="clickNum" />
|
||||
<result column="version" property="version" />
|
||||
<result column="deleted" property="deleted" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, name, domain, industry, compute_type_id, card_type_id, compute_num, memory, vram, centre_id, charge_type, user_id, system_disk_category, system_disk_size, internet_max_bandwidth_out, image_type, image_id, amount, price_unit, duration_amount, type, industry_type_id, description, docking_person, docking_phone, demand_status, status, click_num, version, deleted, create_time, update_time
|
||||
</sql>
|
||||
|
||||
</mapper>
|
|
@ -1,40 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="net.jointcloud.negotiation.mapper.ProvideMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="net.jointcloud.negotiation.entity.ProvideEntity">
|
||||
<id column="id" property="id" />
|
||||
<result column="name" property="name" />
|
||||
<result column="compute_type_id" property="computeTypeId" />
|
||||
<result column="card_type_id" property="cardTypeId" />
|
||||
<result column="compute_num" property="computeNum" />
|
||||
<result column="memory" property="memory" />
|
||||
<result column="vram" property="vram" />
|
||||
<result column="centre_id" property="centreId" />
|
||||
<result column="charge_type" property="chargeType" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="system_disk_category" property="systemDiskCategory" />
|
||||
<result column="system_disk_size" property="systemDiskSize" />
|
||||
<result column="internet_max_bandwidth_out" property="internetMaxBandwidthOut" />
|
||||
<result column="image_type" property="imageType" />
|
||||
<result column="image_id" property="imageId" />
|
||||
<result column="price_unit" property="priceUnit" />
|
||||
<result column="duration_price" property="durationPrice" />
|
||||
<result column="type" property="type" />
|
||||
<result column="industry_type" property="industryType" />
|
||||
<result column="description" property="description" />
|
||||
<result column="status" property="status" />
|
||||
<result column="click_num" property="clickNum" />
|
||||
<result column="version" property="version" />
|
||||
<result column="deleted" property="deleted" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, name, compute_type_id, card_type_id, compute_num, memory, vram, centre_id, charge_type, user_id, system_disk_category, system_disk_size, internet_max_bandwidth_out, image_type, image_id, price_unit, duration_price, type, industry_type, description, status, click_num, version, deleted, create_time, update_time
|
||||
</sql>
|
||||
|
||||
</mapper>
|
|
@ -1,36 +0,0 @@
|
|||
package net.jointcloud.negotiation;
|
||||
|
||||
import net.jointcloud.negotiation.entity.ComputingPowerTypeEntity;
|
||||
import net.jointcloud.negotiation.service.ComputingPowerTypeService;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest
|
||||
class ComputingPowerTypeServiceTest {
|
||||
|
||||
@Autowired
|
||||
private ComputingPowerTypeService computingPowerTypeService;
|
||||
|
||||
@Test
|
||||
void testSave() {
|
||||
|
||||
ComputingPowerTypeEntity computingPowerType = new ComputingPowerTypeEntity();
|
||||
computingPowerType.setName("jointcloud");
|
||||
|
||||
|
||||
boolean flag = computingPowerTypeService.save(computingPowerType);
|
||||
System.out.println(flag);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testUpdate() {
|
||||
|
||||
ComputingPowerTypeEntity computingPowerType = new ComputingPowerTypeEntity();
|
||||
computingPowerType.setName("jointcloud-tt");
|
||||
computingPowerType.setId(1L);
|
||||
|
||||
boolean flag = computingPowerTypeService.updateById(computingPowerType);
|
||||
System.out.println(flag);
|
||||
}
|
||||
}
|
|
@ -1,13 +1,11 @@
|
|||
package net.jointcloud.negotiation;
|
||||
|
||||
import net.jointcloud.negotiation.entity.ImageEntity;
|
||||
import net.jointcloud.negotiation.domain.entity.ImageEntity;
|
||||
import net.jointcloud.negotiation.service.ImageService;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
@SpringBootTest
|
||||
class ImageServiceTest {
|
||||
|
||||
|
|
Loading…
Reference in New Issue