|
|
@@ -1,5 +1,6 @@
|
|
|
package com.zhongshu.card.server.core.controller.org;
|
|
|
|
|
|
+import com.github.microservice.core.util.bytes.BytesUtil;
|
|
|
import com.github.microservice.net.ResultContent;
|
|
|
import com.zhongshu.card.server.core.service.TestService;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
@@ -10,6 +11,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Collections;
|
|
|
+
|
|
|
@Slf4j
|
|
|
@RestController
|
|
|
@RequestMapping("test")
|
|
|
@@ -25,8 +29,28 @@ public class TestController {
|
|
|
|
|
|
// openAPIRegisterService.initRegisterPAIS();
|
|
|
|
|
|
+ try{
|
|
|
+ byte[] bins = BytesUtil.longToBin(Long.parseLong("2152525002"), 4);
|
|
|
+ var ret = reverse(bins);
|
|
|
+ String str = BytesUtil.binToHex(ret);
|
|
|
+ log.info("str; {}", str.toUpperCase());
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
return this.testService.text();
|
|
|
}
|
|
|
|
|
|
+ public static byte[] reverse(byte[] bin) {
|
|
|
+ var items = new ArrayList<Byte>();
|
|
|
+ for (var b : bin) {
|
|
|
+ items.add(b);
|
|
|
+ }
|
|
|
+ Collections.reverse(items);
|
|
|
+ byte[] ret = new byte[items.size()];
|
|
|
+ for (int i = 0; i < items.size(); i++) {
|
|
|
+ ret[i] = items.get(i);
|
|
|
+ }
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
|
|
|
}
|