mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 19:51:00 +00:00
(improvement)(headless) Opt logic of obtaining faker user (#2014)
* (improvement)(headless) opt logic of obtaining faker user * (improvement)(headless) Fill in default values for data set creating * (improvement)(headless) modify dataEvent type when creating model --------- Co-authored-by: lxwcodemonkey
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
package com.tencent.supersonic.common.config;
|
||||
|
||||
import com.tencent.supersonic.common.util.S2ThreadContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class ThreadContextConfig {
|
||||
|
||||
@Bean
|
||||
public S2ThreadContext s2ThreadContext() {
|
||||
return new S2ThreadContext();
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.tencent.supersonic.common.util;
|
||||
|
||||
import com.alibaba.ttl.TransmittableThreadLocal;
|
||||
|
||||
public class S2ThreadContext {
|
||||
|
||||
private static final TransmittableThreadLocal<ThreadContext> context =
|
||||
new TransmittableThreadLocal<>();
|
||||
|
||||
public ThreadContext get() {
|
||||
return context.get();
|
||||
}
|
||||
|
||||
public void set(ThreadContext value) {
|
||||
context.set(value);
|
||||
}
|
||||
|
||||
public void remove() {
|
||||
context.remove();
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.tencent.supersonic.common.util;
|
||||
|
||||
import com.tencent.supersonic.common.pojo.User;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
@@ -13,7 +14,7 @@ public class ThreadContext {
|
||||
|
||||
private String traceId;
|
||||
|
||||
private String userName;
|
||||
private User user;
|
||||
|
||||
private String token;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user