Pārlūkot izejas kodu

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

zhangqiang 21 stundas atpakaļ
vecāks
revīzija
aabfd3a325

+ 20 - 5
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/controller/SeoKeywordsController.java

@@ -25,10 +25,13 @@ import org.jeecg.common.system.api.ISysBaseAPI;
 import org.jeecg.common.system.base.controller.JeecgController;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.config.security.utils.SecureUtil;
+import org.jeecg.modules.adweb.common.constant.AdwebConstant;
 import org.jeecg.modules.adweb.seo.dto.AvesApiSearchKeywordsDTO;
 import org.jeecg.modules.adweb.seo.entity.SeoKeywords;
 import org.jeecg.modules.adweb.seo.service.ISeoKeywordsRankService;
 import org.jeecg.modules.adweb.seo.service.ISeoKeywordsService;
+import org.jeecg.modules.adweb.site.entity.AdwebSite;
+import org.jeecg.modules.adweb.site.service.IAdwebSiteService;
 import org.jeecg.modules.system.entity.SysUser;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.entity.ExportParams;
@@ -58,6 +61,8 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
 
     @Autowired private ISysBaseAPI sysBaseAPI;
 
+    @Autowired private IAdwebSiteService adwebSiteService;
+
     /**
      * 分页列表查询
      *
@@ -103,9 +108,19 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
      */
     @AutoLog(value = "关键词-添加")
     @Operation(summary = "关键词-添加")
-    @PreAuthorize("@jps.requiresPermissions('serp:seo_keywords:add')")
+    @PreAuthorize("@jps.requiresPermissions('keywords:seo_keywords:add')")
     @PostMapping(value = "/add")
     public Result<String> add(@RequestBody SeoKeywords seoKeywords) {
+        AdwebSite siteByCode = adwebSiteService.getSiteByCode(seoKeywords.getSiteCode());
+        if (siteByCode == null) {
+            return Result.error("未找到对应站点");
+        }
+        seoKeywords.setAppKey(AdwebConstant.APPKEY);
+        // 根据siteCode获取站点域名
+        String domain = siteByCode.getDomain();
+        seoKeywords.setDomain(domain);
+        seoKeywords.setStatus(1);
+        seoKeywords.setLang("en");
         seoKeywordsService.save(seoKeywords);
         return Result.OK("添加成功!");
     }
@@ -118,7 +133,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
      */
     @AutoLog(value = "关键词-编辑")
     @Operation(summary = "关键词-编辑")
-    @PreAuthorize("@jps.requiresPermissions('serp:seo_keywords:edit')")
+    @PreAuthorize("@jps.requiresPermissions('keywords:seo_keywords:edit')")
     @RequestMapping(
             value = "/edit",
             method = {RequestMethod.PUT, RequestMethod.POST})
@@ -135,7 +150,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
      */
     @AutoLog(value = "关键词-通过id删除")
     @Operation(summary = "关键词-通过id删除")
-    @PreAuthorize("@jps.requiresPermissions('serp:seo_keywords:delete')")
+    @PreAuthorize("@jps.requiresPermissions('keywords:seo_keywords:delete')")
     @DeleteMapping(value = "/delete")
     public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
         seoKeywordsService.removeById(id);
@@ -150,7 +165,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
      */
     @AutoLog(value = "关键词-批量删除")
     @Operation(summary = "关键词-批量删除")
-    @PreAuthorize("@jps.requiresPermissions('serp:seo_keywords:deleteBatch')")
+    @PreAuthorize("@jps.requiresPermissions('keywords:seo_keywords:deleteBatch')")
     @DeleteMapping(value = "/deleteBatch")
     public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
         this.seoKeywordsService.removeByIds(Arrays.asList(ids.split(",")));
@@ -179,7 +194,7 @@ public class SeoKeywordsController extends JeecgController<SeoKeywords, ISeoKeyw
      *
      * @param request
      */
-    @PreAuthorize("@jps.requiresPermissions('serp:seo_keywords:exportXls')")
+    @PreAuthorize("@jps.requiresPermissions('keywords:seo_keywords:exportXls')")
     @RequestMapping(value = "/exportXls")
     public ModelAndView exportXls(HttpServletRequest request) throws Exception {
         // Step.1 组装查询条件

+ 2 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/adweb/seo/entity/SeoKeywords.java

@@ -9,6 +9,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
+import org.jeecg.common.aspect.annotation.Dict;
 import org.jeecgframework.poi.excel.annotation.Excel;
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -101,6 +102,7 @@ public class SeoKeywords implements Serializable {
 	/**关键词类型(1:指定;2:长尾)*/
 	@Excel(name = "关键词类型(1:指定;2:长尾)", width = 15)
     @Schema(description = "关键词类型(1:指定;2:长尾)")
+    @Dict(dicCode = "keyword_type")
     private Integer keywordType;
 	/**最近一次搜索排名*/
 	@Excel(name = "最近一次搜索排名", width = 15)

+ 2 - 2
jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml

@@ -230,9 +230,9 @@ jeecg:
     app: http://localhost:8051
   path:
     #文件上传根目录 设置
-    upload: D:/Advich/Project/Adweb3.0
+    upload: D:/ProjectsCode/adweb3-server/upload
     #webapp文件路径
-    webapp: D:/Advich/Project/Adweb3.0
+    webapp: D:/ProjectsCode/adweb3-server/upload
   #阿里云oss存储和大鱼短信秘钥配置
   oss:
     accessKey: ??