ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TAppUserSign.java
@@ -3,6 +3,7 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.core.web.domain.BasePojo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -39,6 +40,7 @@ @ApiModelProperty(value = "签到天") @TableField("sign_day") @JsonFormat(pattern = "dd", timezone = "GMT+8") private LocalDate signDay; @ApiModelProperty(value = "奖励积分") ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/TInviteUser.java
@@ -31,7 +31,7 @@ @ApiModelProperty(value = "主键") @TableId(value = "id", type = IdType.AUTO) private Integer id; private Long id; @ApiModelProperty(value = "用户id") @TableField("app_user_id") ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/OrderFallbackFactory.java
@@ -55,6 +55,11 @@ return R.fail("订单创建" + cause.getMessage()); } @Override public R callBack(String code, String outTradeNo) { return R.fail("支付回调" + cause.getMessage()); } @Override public R<TActivityVO> activityStatistics(TActivityStatisticsQuery dto) { ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/TNotice.java
@@ -12,6 +12,7 @@ import lombok.EqualsAndHashCode; import java.io.Serializable; import java.time.LocalDate; import java.time.LocalDateTime; /** @@ -40,13 +41,13 @@ @ApiModelProperty(value = "开始时间") @TableField("start_time") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") private LocalDateTime startTime; @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") private LocalDate startTime; @ApiModelProperty(value = "结束时间") @TableField("end_time") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") private LocalDateTime endTime; @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") private LocalDate endTime; ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/AuthFilter.java
@@ -155,7 +155,7 @@ Long old_timestamp = Long.valueOf(o.toString()); Long new_timestamp = Long.valueOf(timestamp); //两个请求时间差小于1秒,判定为重复提交 if((new_timestamp - old_timestamp) <= 1000){ if((new_timestamp - old_timestamp) <= 500){ throw new RuntimeException("重复提交"); }else{ cacheMap.put(url, timestamp); ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/RequestParamGlobalFilter.java
@@ -52,13 +52,13 @@ public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) { ServerHttpRequest request = exchange.getRequest(); ServerHttpRequest.Builder mutate = request.mutate(); HttpMethod method = request.getMethod(); if(method != HttpMethod.POST){ return chain.filter(exchange.mutate().request(mutate.build()).build()); } // 跳过不需要验证的路径 String url = request.getURI().getPath(); if (StringUtils.matches(url, ignoreWhite.getWhites())) { return chain.filter(exchange); } HttpMethod method = request.getMethod(); if(method != HttpMethod.POST){ return chain.filter(exchange); } ServerHttpRequestDecorator httpRequestDecorator = requestDecorator(exchange); @@ -104,6 +104,6 @@ @Override public int getOrder() { return HIGHEST_PRECEDENCE; return -500; } } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/TAppUserController.java
@@ -805,9 +805,19 @@ @ApiOperation(value = "获取车辆品牌", tags = {"小程序-个人中心-车辆"}) @GetMapping(value = "/user/car/getBrands") public R getBrands() throws Exception { public R getBrands(String name) throws Exception { String brand = CarBrandUtil.getBrand(); return R.ok(brand); JSONObject jsonObject = JSON.parseObject(brand); JSONArray data = jsonObject.getJSONArray("data"); return R.ok(data); } @ApiOperation(value = "根据品牌获取车型", tags = {"小程序-个人中心-车辆"}) @GetMapping(value = "/user/car/getModel") public R getModel(String id) throws Exception { String modelById = CarBrandUtil.getModelById(id); return R.ok(modelById); } } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/carBrand/CarBrandUtil.java
@@ -49,9 +49,64 @@ // Print the body of the response. HttpEntity resEntity = response.getEntity(); if (resEntity != null) { LOGGER.info("Processing Body with name: {} and value: {}", System.getProperty("line.separator"), EntityUtils.toString(resEntity, "UTF-8")); // LOGGER.info("Processing Body with name: {} and value: {}", System.getProperty("line.separator"), // EntityUtils.toString(resEntity, "UTF-8")); String string = EntityUtils.toString(resEntity, "UTF-8"); return string; } } catch (Exception e) { LOGGER.error(e.getMessage()); } finally { if (client != null) { client.close(); } } return ""; } public static String getModelById(String brandId) throws Exception { // Create a new request. Request httpClientRequest = new Request(); try { // Set the request parameters. // AppKey, AppSecrect, Method and Url are required parameters. // Directly writing AK/SK in code is risky. For security, encrypt your AK/SK and store them in the configuration file or environment variables. // In this example, the AK/SK are stored in environment variables for identity authentication. // Before running this example, set environment variables HUAWEICLOUD_SDK_AK and HUAWEICLOUD_SDK_SK. httpClientRequest.setKey("9a4a2b69afe141718f6843c5d39961ec"); httpClientRequest.setSecret("541845f206324bbc933065b44fc98c47"); httpClientRequest.setMethod("POST"); // Set a request URL in the format of https://{Endpoint}/{URI}. httpClientRequest.setUrl("https://vehiclequery.apistore.huaweicloud.com/vehicle/query/series"); httpClientRequest.addHeader("Content-Type", "text/plain"); httpClientRequest.addQueryStringParam("brandId",brandId); // Set a body for http request. // httpClientRequest.setBody("put your request body here"); } catch (Exception e) { // LOGGER.error(e.getMessage()); return ""; } CloseableHttpClient client = null; try { // Sign the request. HttpRequestBase signedRequest = Client.sign(httpClientRequest, Constant.SIGNATURE_ALGORITHM_SDK_HMAC_SHA256); if (Constant.DO_VERIFY) { // creat httpClient and verify ssl certificate HostName.setUrlHostName(httpClientRequest.getHost()); client = (CloseableHttpClient) SSLCipherSuiteUtil.createHttpClientWithVerify(Constant.INTERNATIONAL_PROTOCOL); } else { // creat httpClient and do not verify ssl certificate client = (CloseableHttpClient) SSLCipherSuiteUtil.createHttpClient(Constant.INTERNATIONAL_PROTOCOL); } HttpResponse response = client.execute(signedRequest); // Print the body of the response. HttpEntity resEntity = response.getEntity(); if (resEntity != null) { // LOGGER.info("Processing Body with name: {} and value: {}", System.getProperty("line.separator"), // EntityUtils.toString(resEntity, "UTF-8")); String string = EntityUtils.toString(resEntity, "UTF-8"); return string; } } catch (Exception e) { LOGGER.error(e.getMessage()); ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/util/carBrand/SSLCipherSuiteUtil.java
@@ -4,7 +4,6 @@ package com.ruoyi.account.util.carBrand; import okhttp3.OkHttpClient; import org.apache.http.client.HttpClient; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.impl.client.CloseableHttpClient; @@ -15,6 +14,7 @@ import org.openeuler.BGMProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import okhttp3.OkHttpClient; import javax.net.ssl.*; import java.net.HttpURLConnection;