Browse Source

Merge branch 'cpq-dev' of wangfan/adweb3-server into master

chenpeiqing 2 weeks ago
parent
commit
fae34eccc4

+ 4 - 4
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/site/service/SelfWebSiteService.java

@@ -224,10 +224,10 @@ public class SelfWebSiteService {
     try {
       // 执行临时服务器shell脚本,基于临时站点创建模板
       String cmd =
-          "sh /opt/adweb3/shell/create_v3_wp_template.sh "
-              + adwebTheme.getCode()
+          "sh /opt/adweb3/shell/auto-wptemplate "
+              + adwebSite.getCode()
               + " "
-              + adwebSite.getCode();
+              + adwebTheme.getCode();
 
       AdwebTheme finalAdwebTheme = adwebTheme;
       shellService.createShareSiteByPwd(
@@ -246,7 +246,7 @@ public class SelfWebSiteService {
 
                 // 临时站点创建成功
                 String domain = finalAdwebTheme.getCode() + "." + tempDomain;
-                finalAdwebTheme.setDomain(domain);
+                finalAdwebTheme.setDomain("https://" + domain);
                 finalAdwebTheme.setStatus(1); // 创建模板成功
                 themeService.updateById(finalAdwebTheme);
 

+ 6 - 2
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/theme/controller/AdwebThemeController.java

@@ -76,13 +76,16 @@ public class AdwebThemeController extends JeecgController<AdwebTheme, IAdwebThem
   @Operation(summary = "adweb主题库-添加")
   @PostMapping(value = "/add")
   public Result<String> add(@RequestBody AdwebThemeParam adwebThemeParam) {
+    String tpCode = adwebThemeParam.getCode() + "tp";
+
+    // TODO 验证tpcode唯一,不能重复
+    // TODO 验证有效模板数量不超过50个
 
     AdwebTheme adwebTheme = new AdwebTheme();
     BeanUtil.copyProperties(adwebThemeParam, adwebTheme);
-    adwebTheme.setCode(adwebThemeParam.getCode() + "tp");
+    adwebTheme.setCode(tpCode);
     adwebTheme.setPutaway(1);
     adwebThemeService.save(adwebTheme);
-
     if (StringUtils.isNotBlank(adwebThemeParam.getCode())) {
       AdwebSite adwebSite =
           adwebSiteService.getOne(
@@ -114,6 +117,7 @@ public class AdwebThemeController extends JeecgController<AdwebTheme, IAdwebThem
       value = "/edit",
       method = {RequestMethod.PUT, RequestMethod.POST})
   public Result<String> edit(@RequestBody AdwebTheme adwebTheme) {
+    // TODO 这里自动写入数据,并可以创建模板站点
     adwebThemeService.updateById(adwebTheme);
     return Result.OK("编辑成功!");
   }