update
This commit is contained in:
@@ -65,12 +65,7 @@
|
||||
<orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.8.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.aliyun:tea-openapi:0.0.19" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.aliyun:tea-util:0.2.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.aliyun:credentials-java:0.2.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.ini4j:ini4j:0.5.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jacoco:org.jacoco.agent:runtime:0.8.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.3.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.activation:javax.activation-api:1.2.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-core:2.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.aliyun:openapiutil:0.1.9" level="project" />
|
||||
@@ -120,5 +115,24 @@
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.aliyun.oss:aliyun-sdk-oss:3.13.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jdom:jdom2:2.0.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.codehaus.jettison:jettison:1.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-core:4.5.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.3.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.activation:javax.activation-api:1.2.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jacoco:org.jacoco.agent:runtime:0.8.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.ini4j:ini4j:0.5.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.opentracing:opentracing-api:0.33.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.opentracing:opentracing-util:0.33.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.opentracing:opentracing-noop:0.33.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-ram:3.1.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.aliyun:aliyun-java-sdk-kms:2.11.0" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -25,6 +25,12 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun.oss</groupId>
|
||||
<artifactId>aliyun-sdk-oss</artifactId>
|
||||
<version>3.13.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
|
||||
@@ -41,7 +41,7 @@ public class TokenValidateFilter implements Filter {
|
||||
private static List<String> patternList =
|
||||
|
||||
Lists.newArrayList("/web/check/ok","/check/ok",
|
||||
"/partner/pc/doc.html","/partner/pc/v2/api-docs","/**/test/**","/partner/pc/feiShuLogin",
|
||||
"/partner/pc/doc.html","/partner/pc/v2/api-docs","/**/test/**","/partner/pc/feiShuLogin","/partner/pc/oss/getUploadFileConfig",
|
||||
"/**/swagger*/**", "/**/webjars/**");
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.github.pagehelper.PageInfo;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -172,7 +171,6 @@ public class DeskController {
|
||||
public ResponseResult<PartnerSummaryInfoVO> queryPartnerIntentApplyInfo(@PathVariable(value = "enterpriseId", required = false) String enterpriseId,
|
||||
@RequestParam(value = "lineId",required = false)Long lineId){
|
||||
|
||||
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.cool.store.controller;
|
||||
|
||||
import com.aliyun.oss.OSSClient;
|
||||
import com.aliyun.oss.common.utils.BinaryUtil;
|
||||
import com.aliyun.oss.model.MatchMode;
|
||||
import com.aliyun.oss.model.PolicyConditions;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: OssClientController
|
||||
* @Description:
|
||||
* @date 2023-06-01 11:25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping({"/oss"})
|
||||
@Slf4j
|
||||
public class OssClientController {
|
||||
|
||||
@GetMapping("/getUploadFileConfig")
|
||||
public ResponseResult getUploadFileConfig(){
|
||||
// 请填写您的AccessKeyId。
|
||||
String accessId = "LTAI5tKSnAbkEbmT6CeBwNN3";
|
||||
// 请填写您的AccessKeySecret。
|
||||
String accessKey = "PbXOzUFwAvZ2K5zIawwa7NAJE2pFXS";
|
||||
// 请填写您的 endpoint。
|
||||
String endpoint = "oss-cn-shanghai.aliyuncs.com";
|
||||
// 请填写您的 bucketname 。
|
||||
String bucket = "vec-coolstore";
|
||||
// host的格式为 bucketname.endpoint
|
||||
String host = "http://" + bucket + "." + endpoint;
|
||||
// callbackUrl为 上传回调服务器的URL,请将下面的IP和Port配置为您自己的真实信息。
|
||||
String dir = "user-dir-prefix/"; // 用户上传文件时指定的前缀。
|
||||
|
||||
OSSClient client = new OSSClient(endpoint, accessId, accessKey);
|
||||
try {
|
||||
long expireTime = 30;
|
||||
long expireEndTime = System.currentTimeMillis() + expireTime * 1000;
|
||||
Date expiration = new Date(expireEndTime);
|
||||
PolicyConditions policyConds = new PolicyConditions();
|
||||
policyConds.addConditionItem(PolicyConditions.COND_CONTENT_LENGTH_RANGE, 0, 1048576000);
|
||||
policyConds.addConditionItem(MatchMode.StartWith, PolicyConditions.COND_KEY, dir);
|
||||
String postPolicy = client.generatePostPolicy(expiration, policyConds);
|
||||
byte[] binaryData = postPolicy.getBytes("utf-8");
|
||||
String encodedPolicy = BinaryUtil.toBase64String(binaryData);
|
||||
String postSignature = client.calculatePostSignature(postPolicy);
|
||||
Map<String, String> respMap = new LinkedHashMap<String, String>();
|
||||
respMap.put("accessid", accessId);
|
||||
respMap.put("policy", encodedPolicy);
|
||||
respMap.put("signature", postSignature);
|
||||
respMap.put("dir", dir);
|
||||
respMap.put("host", host);
|
||||
respMap.put("expire", String.valueOf(expireEndTime / 1000));
|
||||
return ResponseResult.success(respMap);
|
||||
}catch (Exception e){
|
||||
log.info("exception", e);
|
||||
}
|
||||
return ResponseResult.success();
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,12 @@
|
||||
package com.cool.store.controller;
|
||||
|
||||
import com.cool.store.entity.EnterpriseConfigDO;
|
||||
import com.cool.store.enums.RocketMqTagEnum;
|
||||
import com.cool.store.mq.producer.SimpleMessageService;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.EnterpriseConfigService;
|
||||
import com.cool.store.utils.UUIDUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -15,16 +20,27 @@ import javax.annotation.Resource;
|
||||
* @Description:
|
||||
* @date 2023-05-26 11:32
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("test/")
|
||||
public class TestController {
|
||||
|
||||
@Resource
|
||||
private EnterpriseConfigService enterpriseConfigService;
|
||||
@Resource
|
||||
private SimpleMessageService simpleMessageService;
|
||||
|
||||
@GetMapping("/selectByEnterpriseId")
|
||||
public EnterpriseConfigDO selectByEnterpriseId(@RequestParam("enterpriseId") String enterpriseId){
|
||||
return enterpriseConfigService.selectByEnterpriseId(enterpriseId);
|
||||
}
|
||||
|
||||
@GetMapping("/sendMq")
|
||||
public ResponseResult sendMq(){
|
||||
String msg = UUIDUtils.get8UUID();
|
||||
log.info("msg:{}", msg);
|
||||
simpleMessageService.send(msg, RocketMqTagEnum.TEST);
|
||||
return ResponseResult.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -45,6 +45,6 @@ isv.domain = https://abstore-isv.coolstore.cn
|
||||
#rocketmq \u914D\u7F6E
|
||||
rocketmq.accessKey=zK2oVEz4G1ts23d2
|
||||
rocketmq.secretKey=0UstLCS0mh2ASgBh
|
||||
rocketmq.nameSrvAdder=http://rmq-cn-9lb38l1rx04-vpc.cn-hangzhou.rmq.aliyuncs.com:8080
|
||||
rocketmq.nameSrvAdder=http://rmq-cn-9lb38l1rx04.cn-hangzhou.rmq.aliyuncs.com:8080
|
||||
rocketmq.topic=simple_message
|
||||
rocketmq.orderTopic=order_message
|
||||
Reference in New Issue
Block a user