BeanUtil.java 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. package nju.seec.SEECdemo.util;
  2. import nju.seec.SEECdemo.data.entity.ResourceConfig;
  3. import nju.seec.SEECdemo.logic.api.k8s.model.CpuQuantity;
  4. import nju.seec.SEECdemo.logic.api.k8s.model.StorageQuantity;
  5. import nju.seec.SEECdemo.logic.vo.projecttemplate.ProjectTemplate;
  6. import org.springframework.context.annotation.Bean;
  7. import org.springframework.stereotype.Component;
  8. @Component
  9. public class BeanUtil {
  10. /**
  11. * 软工二的项目模板
  12. * @return
  13. */
  14. @Bean
  15. public ProjectTemplate seecIITemplate() {
  16. ProjectTemplate projectTemplate = new ProjectTemplate();
  17. ResourceConfig resourceConfig = new ResourceConfig();
  18. resourceConfig.setDefaultCPU(new CpuQuantity(40));
  19. resourceConfig.setMaxCPU(new CpuQuantity(50));
  20. resourceConfig.setDefaultMemory(new StorageQuantity(500));
  21. resourceConfig.setMaxMemory(new StorageQuantity(600));
  22. resourceConfig.setDefaultStorage(StorageQuantity.EMPTY);
  23. resourceConfig.setMaxStorage(StorageQuantity.EMPTY);
  24. projectTemplate.setDefaultResourceConfig(resourceConfig);
  25. projectTemplate.setName("SeecII");
  26. projectTemplate.setDescription("SeecII-demo");
  27. return projectTemplate;
  28. }
  29. }