13 changed files with 98 additions and 50 deletions
@ -0,0 +1,17 @@ |
|||
package com.bnyer.img.config; |
|||
|
|||
import org.springframework.context.annotation.Bean; |
|||
import org.springframework.context.annotation.Configuration; |
|||
import org.springframework.web.client.RestTemplate; |
|||
|
|||
/** |
|||
* @author chengkun |
|||
* @date 2022/4/28 17:27 |
|||
*/ |
|||
@Configuration |
|||
public class RestTemplateConfiguration { |
|||
@Bean |
|||
public RestTemplate restTemplate() { |
|||
return new RestTemplate(); |
|||
} |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
package com.bnyer.img.config; |
|||
|
|||
import com.bnyer.common.core.utils.Sm4Util; |
|||
import lombok.Getter; |
|||
import lombok.Setter; |
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import org.springframework.context.annotation.Configuration; |
|||
|
|||
import javax.annotation.PostConstruct; |
|||
import java.util.Objects; |
|||
|
|||
|
|||
/** |
|||
* @author chengkun |
|||
* @date 2022/04/27 16:40 |
|||
*/ |
|||
@Configuration |
|||
@Getter |
|||
@Setter |
|||
public class Sm4Config { |
|||
@Value("${encryption.sm4.key}") |
|||
private String key ; |
|||
|
|||
@PostConstruct |
|||
public void init(){ |
|||
Objects.requireNonNull(key,"encryption.sm4.key is null"); |
|||
Sm4Util.utilInit(key); |
|||
} |
|||
} |
|||
@ -1,24 +0,0 @@ |
|||
package com.bnyer.img.feign; |
|||
|
|||
import com.alibaba.fastjson.JSONObject; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author chengkun |
|||
* @date 2022/4/21 18:04 |
|||
*/ |
|||
@FeignClient(name = "tiktok-service", url = "${bnyer.img.tiktok.sessionInfoUrl}") |
|||
public interface TiktokFeign { |
|||
|
|||
/** |
|||
* 获取抖音sessionInfo |
|||
* @param params 授权参数 |
|||
* @return - |
|||
*/ |
|||
@GetMapping("/cash_account/total") |
|||
JSONObject getSessionInfo(@RequestParam Map<String, String> params); |
|||
} |
|||
Loading…
Reference in new issue