|
@@ -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 组装查询条件
|