diff --git a/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-api/pom.xml b/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-api/pom.xml index 0839221..f398531 100644 --- a/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-api/pom.xml +++ b/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-api/pom.xml @@ -21,6 +21,11 @@ cdp-tool-xhs-service 1.0-SNAPSHOT + + + + + com.baiye cdp-tool-xhs-core diff --git a/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-api/src/main/java/com/baiye/controller/CityInfoController.java b/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-api/src/main/java/com/baiye/controller/CityInfoController.java index a96139b..bbbe1b6 100644 --- a/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-api/src/main/java/com/baiye/controller/CityInfoController.java +++ b/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-api/src/main/java/com/baiye/controller/CityInfoController.java @@ -33,7 +33,7 @@ public class CityInfoController { @PostMapping("/add") @ApiOperation("导入城市") @Inner(value = false) - public Result addCity(@RequestParam(value = "file", required = false) MultipartFile file) { - return cityInfoService.addCity(file); + public Result addCity(@RequestParam(value = "file", required = false) MultipartFile file, @RequestParam(value = "type") Integer type) { + return cityInfoService.addCity(file, type); } } diff --git a/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-api/src/main/java/com/baiye/controller/LinkWatchController.java b/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-api/src/main/java/com/baiye/controller/LinkWatchController.java new file mode 100644 index 0000000..9163b71 --- /dev/null +++ b/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-api/src/main/java/com/baiye/controller/LinkWatchController.java @@ -0,0 +1,52 @@ +package com.baiye.controller; + +import com.baiye.annotation.Inner; +import com.baiye.core.base.api.Result; +import com.baiye.dto.LinkWatchDTO; +import com.baiye.service.LinkWatchService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +/** + * @author wjt + * @date 2023/3/28 + */ +@RestController +@RequestMapping("/link/watch") +@RequiredArgsConstructor +@Api(tags = "xhs定时统计") +public class LinkWatchController { + + private final LinkWatchService linkWatchService; + + @PostMapping("/create") + @ApiOperation("添加链接监听信息") + @Inner(value = false) + public Result create(@RequestBody @Validated LinkWatchDTO linkWatchDTO) { + return linkWatchService.create(linkWatchDTO); + } + + @GetMapping("/query") + @ApiOperation("查看统计的链接列表") + @Inner(value = false) + public Result query() { + return linkWatchService.query(); + } + + @GetMapping("/report") + @ApiOperation("查看链接监听统计") + @Inner(value = false) + public Result report(@RequestParam("link") String link) { + return linkWatchService.report(link); + } + + @GetMapping("/test") + @ApiOperation("查看链接监听统计") + @Inner(value = false) + public Result test(@RequestParam("link") String link, @RequestParam("param") String param) { + return Result.data(linkWatchService.test(link, param)); + } +} diff --git a/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-api/src/main/java/com/baiye/controller/ResourceController.java b/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-api/src/main/java/com/baiye/controller/ResourceController.java deleted file mode 100644 index bd122be..0000000 --- a/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-api/src/main/java/com/baiye/controller/ResourceController.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.baiye.controller; - -import cn.hutool.json.JSONUtil; -import com.baiye.core.base.api.Result; -import com.baiye.core.page.PageResult; -import com.baiye.dto.SourceDTO; -import com.baiye.query.SourceQuery; -import com.baiye.service.SourceService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.data.domain.Pageable; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -/** - * @author jt - */ -@Slf4j -@RestController -@RequiredArgsConstructor -@RequestMapping("/xhs/source") -@Api(tags = "小红书素材包管理") -public class ResourceController { - - private final SourceService sourceService; - - @GetMapping("/query") - @ApiOperation("资源包查询") - public PageResult querySource(SourceQuery sourceQuery, Pageable pageable) { - return sourceService.querySource(sourceQuery, pageable); - } - - @PostMapping("/add") - @ApiOperation("新增素材包") - public Result addSource(@RequestParam(value = "file",required = false) MultipartFile file, @RequestParam("sourceDTO") String sourceDTO) { - return sourceService.addSource(file, JSONUtil.toBean(sourceDTO, SourceDTO.class)); - } - - @DeleteMapping("/delete") - @ApiOperation("删除素材包") - public Result deleteSource(@RequestParam(value = "id") Long id) { - return sourceService.deleteSource(id); - } - - @GetMapping("/status") - @ApiOperation("修改素材包状态") - public Result changeStatus(@RequestParam(value = "id") Long id) { - return sourceService.changeStatus(id); - } - - @GetMapping("/isRepeat") - @ApiOperation("验证名称重复") - public Result isRepeatSourceName(@RequestParam(value = "sourceName") String sourceName) { - Boolean repeatSourceName = sourceService.isRepeatSourceName(sourceName); - return Result.data(repeatSourceName); - } -} diff --git a/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-api/src/main/java/com/baiye/controller/ResourceOrganizeController.java b/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-api/src/main/java/com/baiye/controller/ResourceOrganizeController.java deleted file mode 100644 index 622db62..0000000 --- a/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-api/src/main/java/com/baiye/controller/ResourceOrganizeController.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.baiye.controller; - -import com.baiye.core.base.api.Result; -import com.baiye.dto.SourceOrganizeDTO; -import com.baiye.query.SourceOrganizeQuery; -import com.baiye.service.SourceOrganizeService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -/** - * @author jt - */ -@Slf4j -@RestController -@RequiredArgsConstructor -@RequestMapping("/xhs/source/organize") -@Api(tags = "小红书资源组管理") -public class ResourceOrganizeController { - - private final SourceOrganizeService sourceOrganizeService; - - @GetMapping("/query") - @ApiOperation("资源组管理") - public Result querySourceOrganize(SourceOrganizeQuery sourceOrganizeQuery) { - return sourceOrganizeService.querySourceOrganize(sourceOrganizeQuery); - } - - @PostMapping("/add") - @ApiOperation("新增组") - public Result addSourceOrganize(@RequestBody @Validated SourceOrganizeDTO sourceOrganizeDTO) { - return sourceOrganizeService.addSourceOrganize(sourceOrganizeDTO); - } - - @DeleteMapping("/delete") - private Result deleteSourceOrganize(Long id) { - return sourceOrganizeService.deleteSourceOrganize(id); - } - - @GetMapping("/isRepeat") - @ApiOperation("验证名称重复") - public Result isRepeatSourceName(@RequestParam(value = "sourceOrganizeName") String sourceOrganizeName) { - Boolean repeatSourceName = sourceOrganizeService.isRepeatSourceOrganizeName(sourceOrganizeName); - return Result.data(repeatSourceName); - } -} diff --git a/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-api/src/main/java/com/baiye/controller/ResourceVariableController.java b/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-api/src/main/java/com/baiye/controller/ResourceVariableController.java deleted file mode 100644 index a71b290..0000000 --- a/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-api/src/main/java/com/baiye/controller/ResourceVariableController.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.baiye.controller; - -import com.baiye.core.base.api.Result; -import com.baiye.dto.OperateVariableDTO; -import com.baiye.dto.SourceVariableDTO; -import com.baiye.query.SourceVariableQuery; -import com.baiye.service.ResourceVariableService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * @author jt - */ -@Slf4j -@RestController -@RequiredArgsConstructor -@RequestMapping("/xhs/source/variable") -@Api(tags = "小红书资源变量管理") -public class ResourceVariableController { - private final ResourceVariableService resourceVariableService; - - @GetMapping("/query") - @ApiOperation("查询变量") - public Result queryResourceVariable(SourceVariableQuery sourceVariableQuery) { - return resourceVariableService.queryResourceVariable(sourceVariableQuery); - } - - @PostMapping("/add") - @ApiOperation("新增变量") - public Result addResourceVariable(@RequestBody @Validated OperateVariableDTO operateVariableDTO) { - return resourceVariableService.addResourceVariable(operateVariableDTO); - } - - @DeleteMapping("/delete") - @ApiOperation("删除变量") - public Result deleteResourceVariable(Long id) { - return resourceVariableService.deleteResourceVariable(id); - } - -// @PostMapping("/update") -// @ApiOperation("修改变量") -// public Result updateResourceVariable(@RequestBody List sourceVariableDTO) { -// return resourceVariableService.updateResourceVariable(sourceVariableDTO); -// } -} diff --git a/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-api/src/main/java/com/baiye/controller/SmartWriteController.java b/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-api/src/main/java/com/baiye/controller/SmartWriteController.java deleted file mode 100644 index 8bdd5d3..0000000 --- a/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-api/src/main/java/com/baiye/controller/SmartWriteController.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.baiye.controller; - -import com.baiye.annotation.Inner; -import com.baiye.core.base.api.Result; -import com.baiye.dto.SmartWriteDTO; -import com.baiye.service.SmartWriteService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletResponse; - -/** - * @author jt - */ -@Slf4j -@RestController -@RequiredArgsConstructor -@RequestMapping("/xhs/smart") -@Api(tags = "小红书智能文案") -public class SmartWriteController { - - private final SmartWriteService smartWriteService; - - @PostMapping("/create") - @ApiOperation("智能文案生成") - public Result smartCreate(@RequestBody SmartWriteDTO smartWriteDTO) { - return smartWriteService.smartCreate(smartWriteDTO); - } - - @PostMapping("/write") - @ApiOperation("智能文案导出") - public void smartWrite(HttpServletResponse response, @RequestBody SmartWriteDTO smartWriteDTO) { - smartWriteService.smartWrite(response, smartWriteDTO); - } -} diff --git a/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-core/src/main/java/com/baiye/dao/SourceMapper.java b/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-core/src/main/java/com/baiye/dao/LinkReportMapper.java similarity index 51% rename from cdp-tools/cdp-tool-xhs/cdp-tool-xhs-core/src/main/java/com/baiye/dao/SourceMapper.java rename to cdp-tools/cdp-tool-xhs/cdp-tool-xhs-core/src/main/java/com/baiye/dao/LinkReportMapper.java index de7486c..6b73254 100644 --- a/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-core/src/main/java/com/baiye/dao/SourceMapper.java +++ b/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-core/src/main/java/com/baiye/dao/LinkReportMapper.java @@ -1,12 +1,13 @@ package com.baiye.dao; -import com.baiye.entity.Source; +import com.baiye.entity.LinkReport; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; /** - * @author jt + * @author wjt + * @date 2023/3/31 */ @Mapper -public interface SourceMapper extends BaseMapper { +public interface LinkReportMapper extends BaseMapper { } diff --git a/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-core/src/main/java/com/baiye/dao/LinkWatchMapper.java b/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-core/src/main/java/com/baiye/dao/LinkWatchMapper.java new file mode 100644 index 0000000..466997c --- /dev/null +++ b/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-core/src/main/java/com/baiye/dao/LinkWatchMapper.java @@ -0,0 +1,17 @@ +package com.baiye.dao; + +import com.baiye.entity.LinkWatch; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author wjt + * @date 2023/3/28 + */ +@Mapper +public interface LinkWatchMapper extends BaseMapper { + void insertAll(@Param("list") List list); +} diff --git a/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-core/src/main/java/com/baiye/dao/SchedulingJobMapper.java b/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-core/src/main/java/com/baiye/dao/SchedulingJobMapper.java new file mode 100644 index 0000000..531e5a8 --- /dev/null +++ b/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-core/src/main/java/com/baiye/dao/SchedulingJobMapper.java @@ -0,0 +1,18 @@ +package com.baiye.dao; + +import com.baiye.entity.LinkWatch; +import com.baiye.entity.SchedulingJob; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author wjt + * @date 2023/3/30 + */ +@Mapper +public interface SchedulingJobMapper extends BaseMapper { + void insertAll(@Param("list") List list); +} diff --git a/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-core/src/main/java/com/baiye/dao/SourceOrganizeMapper.java b/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-core/src/main/java/com/baiye/dao/SourceOrganizeMapper.java deleted file mode 100644 index 34c844c..0000000 --- a/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-core/src/main/java/com/baiye/dao/SourceOrganizeMapper.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.baiye.dao; - -import com.baiye.entity.SourceOrganize; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; - -/** - * @author jt - */ -@Mapper -public interface SourceOrganizeMapper extends BaseMapper { -} diff --git a/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-core/src/main/java/com/baiye/dao/TemplateMapper.java b/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-core/src/main/java/com/baiye/dao/TemplateMapper.java deleted file mode 100644 index 96f7dd6..0000000 --- a/cdp-tools/cdp-tool-xhs/cdp-tool-xhs-core/src/main/java/com/baiye/dao/TemplateMapper.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.baiye.dao; - -import com.baiye.entity.Template; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * @author jt - */ -@Mapper -public interface TemplateMapper extends BaseMapper