From 5cdc843d9fce09488f11a8355b10f58976860446 Mon Sep 17 00:00:00 2001 From: cloudroam <cloudroam> Date: 星期四, 29 五月 2025 11:35:27 +0800 Subject: [PATCH] 1.地图api配置 2.小程序id修改 --- src/main/java/com/mzl/flower/config/TengxunMapProperties.java | 2 ++ src/main/java/com/mzl/flower/web/customer/HomeCustomerController.java | 10 +++++++--- src/main/java/com/mzl/flower/config/ResourceServerConfig.java | 2 ++ src/main/java/com/mzl/flower/dto/request/film/FilmWorksDTO.java | 12 ++++++++++++ src/main/java/com/mzl/flower/entity/film/FilmWorks.java | 7 +++++++ src/main/java/com/mzl/flower/dto/response/film/FilmWorksVO.java | 7 +++++++ src/main/resources/application-test.yml | 2 +- src/main/resources/application.yml | 16 ++++++++++------ 8 files changed, 48 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/mzl/flower/config/ResourceServerConfig.java b/src/main/java/com/mzl/flower/config/ResourceServerConfig.java index 3fc7fe1..7b8a330 100644 --- a/src/main/java/com/mzl/flower/config/ResourceServerConfig.java +++ b/src/main/java/com/mzl/flower/config/ResourceServerConfig.java @@ -75,6 +75,8 @@ // 短信 .antMatchers("/v2/tos/sms/**").permitAll() + .antMatchers("/api/film/category/list").permitAll() + .antMatchers("/api/**").authenticated();//配置访问控制,必须认证过后才可以访问 } diff --git a/src/main/java/com/mzl/flower/config/TengxunMapProperties.java b/src/main/java/com/mzl/flower/config/TengxunMapProperties.java index 9800a52..4093587 100644 --- a/src/main/java/com/mzl/flower/config/TengxunMapProperties.java +++ b/src/main/java/com/mzl/flower/config/TengxunMapProperties.java @@ -14,4 +14,6 @@ */ private String administrativeDivisionsUrl; + private String apiKey; + } diff --git a/src/main/java/com/mzl/flower/dto/request/film/FilmWorksDTO.java b/src/main/java/com/mzl/flower/dto/request/film/FilmWorksDTO.java index 5508927..f3c850d 100644 --- a/src/main/java/com/mzl/flower/dto/request/film/FilmWorksDTO.java +++ b/src/main/java/com/mzl/flower/dto/request/film/FilmWorksDTO.java @@ -110,5 +110,17 @@ */ private Integer shareCount; + private String coverTitle; + + private String tag; + + // 生成的文章内容 + private String filmContent; + + + // 生成的图片 + private String filmPictures; + + } diff --git a/src/main/java/com/mzl/flower/dto/response/film/FilmWorksVO.java b/src/main/java/com/mzl/flower/dto/response/film/FilmWorksVO.java index 5567ef5..4cb8789 100644 --- a/src/main/java/com/mzl/flower/dto/response/film/FilmWorksVO.java +++ b/src/main/java/com/mzl/flower/dto/response/film/FilmWorksVO.java @@ -137,6 +137,13 @@ private LocalDateTime createTime; + // 生成的文章内容 + private String filmContent; + + + // 生成的图片 + private String filmPictures; + } diff --git a/src/main/java/com/mzl/flower/entity/film/FilmWorks.java b/src/main/java/com/mzl/flower/entity/film/FilmWorks.java index 0983338..3da1250 100644 --- a/src/main/java/com/mzl/flower/entity/film/FilmWorks.java +++ b/src/main/java/com/mzl/flower/entity/film/FilmWorks.java @@ -127,6 +127,13 @@ private String tag; + // 生成的文章内容 + private String filmContent; + + + // 生成的图片 + private String filmPictures; + } diff --git a/src/main/java/com/mzl/flower/web/customer/HomeCustomerController.java b/src/main/java/com/mzl/flower/web/customer/HomeCustomerController.java index 156870a..77c53d0 100644 --- a/src/main/java/com/mzl/flower/web/customer/HomeCustomerController.java +++ b/src/main/java/com/mzl/flower/web/customer/HomeCustomerController.java @@ -5,6 +5,7 @@ import com.mzl.flower.base.BaseController; import com.mzl.flower.base.R; import com.mzl.flower.base.ReturnDataDTO; +import com.mzl.flower.config.TengxunMapProperties; import com.mzl.flower.dto.request.flower.FlowerCategoryQueryDTO; import com.mzl.flower.dto.response.flower.*; import com.mzl.flower.service.flower.FlowerCategoryService; @@ -39,6 +40,9 @@ @Autowired private FlowerCategoryService categoryService; + @Autowired + private TengxunMapProperties tengxunMapProperties; + @GetMapping("/category/price/ave") @ApiOperation(value = "获取商品分类均价") public ResponseEntity<ReturnDataDTO<List<FlowerCategoryDailyDTO>>> getHomeCategoryDaily(Page page){ @@ -48,9 +52,9 @@ @GetMapping("/address/parse") @ApiOperation(value = "解析经纬度") public ResponseEntity<ReturnDataDTO<?>> getAddress(String location) throws Exception { - String requestPath = "https://apis.map.qq.com/ws/geocoder/v1/?key=GSBBZ-CJA3U-NNDVH-GE65N-6FIF6-ZGBCU&get_poi=1&location="; - String pp = URLEncoder.encode(location, "utf-8"); - requestPath += pp; + String key = tengxunMapProperties.getApiKey(); + String locationTmp = URLEncoder.encode(location, "utf-8"); + String requestPath = String.format("https://apis.map.qq.com/ws/geocoder/v1/?key=%s&get_poi=1&location=%s", key, locationTmp); JSONObject json = HttpUtil.doRequest(HttpMethod.GET.name(), requestPath, "json", new HashMap<>(), new HashMap<>(), new HashMap<>(), new HashMap<>()); return returnData(R.SUCCESS.getCode(), json); } diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index 50cf388..c70b3e0 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -3,7 +3,7 @@ active: test,swagger datasource: type: com.alibaba.druid.pool.DruidDataSource - url: jdbc:mysql://47.96.225.205:3306/smart_message?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2b8&allowMultiQueries=true&connectionCollation=utf8mb4_unicode_ci + url: jdbc:mysql://47.96.225.205:3306/film_message?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2b8&allowMultiQueries=true&connectionCollation=utf8mb4_unicode_ci username: root password: CloudRoam druid: diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index b7a9bb2..f116a33 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,5 +1,5 @@ server: - port: 8080 + port: 8888 servlet: context-path: /flower @@ -84,8 +84,10 @@ wx: miniapp: - appid: wx1441324401626290 #小程序appId 花店端 - secret: bab595ac75f60eb33567511111a569a7 #secret花店端 +# appid: wx1441324401626290 #小程序appId 花店端 +# secret: bab595ac75f60eb33567511111a569a7 #secret花店端 + appid: wxf2e5534be77e3a80 #小程序appId 花店端 + secret: 74b901f68dc1c277f1309811cb6eaab3 #secret花店端 msgDataFormat: JSON mp: app-id: xxx #公众号appId @@ -94,8 +96,10 @@ wechat: merchantId: 1661512517 customer: - appid: wx1441324401626290 #小程序appId - secret: bab595ac75f60eb33567511111a569a7 #secret +# appid: wx1441324401626290 #小程序appId +# secret: bab595ac75f60eb33567511111a569a7 #secret + appid: wxf2e5534be77e3a80 #小程序appId + secret: 74b901f68dc1c277f1309811cb6eaab3 #secret partner: appid: wx6d0ecc4e18710458 #小程序appId secret: 22afb006e9b94ee97c47bbfded9151eb #secret @@ -110,7 +114,7 @@ map: tengxun: # apiKey: GSBBZ-CJA3U-NNDVH-GE65N-6FIF6-ZGBCU - apiKey: PRFBZ-INBLB-PYEU6-JCKUM-AYD7V-V7BIF + apiKey: D7OBZ-FPLEZ-U4UXA-7LVCZ-P2XF7-ICFOH # 新政区划接口url administrative_divisions_url : https://apis.map.qq.com/ws/district/v1/list?key=${map.tengxun.apiKey}&&struct_type=1 gaode: -- Gitblit v1.9.3