DataDashboardTest.java 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package com.tzld.longarticle.recommend.server;
  2. import com.alibaba.fastjson.JSONObject;
  3. import com.tzld.longarticle.recommend.server.model.vo.IntermediateIndicatorsExport;
  4. import com.tzld.longarticle.recommend.server.model.vo.NewSortStrategyExport;
  5. import com.tzld.longarticle.recommend.server.service.recommend.DataDashboardService;
  6. import com.tzld.longarticle.recommend.server.util.DateUtils;
  7. import com.tzld.longarticle.recommend.server.util.feishu.FeiShu;
  8. import lombok.extern.slf4j.Slf4j;
  9. import org.junit.jupiter.api.Test;
  10. import org.springframework.boot.test.context.SpringBootTest;
  11. import org.springframework.data.util.Pair;
  12. import org.springframework.http.HttpHeaders;
  13. import javax.annotation.Resource;
  14. import java.util.List;
  15. @SpringBootTest(classes = Application.class)
  16. @Slf4j
  17. public class DataDashboardTest {
  18. @Resource
  19. DataDashboardService dataDashboardService;
  20. @Test
  21. public void test() {
  22. List<IntermediateIndicatorsExport> result = dataDashboardService.intermediateIndicatorsData("20241225");
  23. log.info(JSONObject.toJSONString(result));
  24. }
  25. @Test
  26. public void newSortStrategyData() {
  27. List<NewSortStrategyExport> result = dataDashboardService.newSortStrategyData("20241222",
  28. "20241223", "9", 0);
  29. log.info(JSONObject.toJSONString(result));
  30. }
  31. @Test
  32. public void producePlanAuditExport() {
  33. List<String> dateStrList = DateUtils.getBeforeDays(null, null, 86);
  34. dataDashboardService.producePlanAuditExport(dateStrList);
  35. }
  36. @Test
  37. public void delFeishuSheet() {
  38. List<String> delDateStrList = DateUtils.getBeforeDays(null, null, 14);
  39. Pair<String, Integer> token = FeiShu.requestAccessToken();
  40. HttpHeaders httpHeaders = new HttpHeaders();
  41. httpHeaders.add("Authorization", "Bearer " + token.getFirst());
  42. dataDashboardService.delFeishuSheet(httpHeaders, "7d4e12", 2, delDateStrList);
  43. }
  44. }