From 215321eb2a93dcd682541b04212b69d09b8c58e4 Mon Sep 17 00:00:00 2001 From: zhangping17 Date: Fri, 17 May 2024 19:33:18 +0800 Subject: [PATCH 1/8] pom --- .../src/main/java/run/mone/ai/bytedance/ArsRequest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jcommon/ai/bytedance/src/main/java/run/mone/ai/bytedance/ArsRequest.java b/jcommon/ai/bytedance/src/main/java/run/mone/ai/bytedance/ArsRequest.java index 91fc6153d..a3a2d5d84 100644 --- a/jcommon/ai/bytedance/src/main/java/run/mone/ai/bytedance/ArsRequest.java +++ b/jcommon/ai/bytedance/src/main/java/run/mone/ai/bytedance/ArsRequest.java @@ -18,7 +18,7 @@ public class ArsRequest { private String cluster; @Builder.Default - private String audio_format = "mp3"; + private String audio_format = "wav"; private byte[] audio; } From f0a445c8ac80ceb24798a4e22b53ba38db5142a6 Mon Sep 17 00:00:00 2001 From: zhangping17 Date: Fri, 17 May 2024 22:35:06 +0800 Subject: [PATCH 2/8] pom --- .../src/main/java/run/mone/ai/bytedance/ArsRequest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jcommon/ai/bytedance/src/main/java/run/mone/ai/bytedance/ArsRequest.java b/jcommon/ai/bytedance/src/main/java/run/mone/ai/bytedance/ArsRequest.java index a3a2d5d84..91fc6153d 100644 --- a/jcommon/ai/bytedance/src/main/java/run/mone/ai/bytedance/ArsRequest.java +++ b/jcommon/ai/bytedance/src/main/java/run/mone/ai/bytedance/ArsRequest.java @@ -18,7 +18,7 @@ public class ArsRequest { private String cluster; @Builder.Default - private String audio_format = "wav"; + private String audio_format = "mp3"; private byte[] audio; } From 3f91cb441c41191a62ff500afdc345f1f4b45e31 Mon Sep 17 00:00:00 2001 From: wtt <30461027+wtt40122@users.noreply.github.com> Date: Tue, 11 Jun 2024 17:08:27 +0800 Subject: [PATCH 3/8] refactor: update es and upgrade file (#848) --- .../java/com/xiaomi/mone/es/EsClient.java | 6 +++--- .../com/xiaomi/mone/es/test/EsClientTest.java | 5 +++-- .../mone/es/test/EsProcessorClientTest.java | 7 ++++--- .../java/com/xiaomi/mone/file/ILogFile.java | 7 +++++++ .../java/com/xiaomi/mone/file/LogFile.java | 12 +++++++++++ .../java/com/xiaomi/mone/file/LogFile2.java | 20 ++++++++++++++++--- .../com/xiaomi/mone/file/LogFileTest.java | 6 +++--- 7 files changed, 49 insertions(+), 14 deletions(-) diff --git a/jcommon/es/src/main/java/com/xiaomi/mone/es/EsClient.java b/jcommon/es/src/main/java/com/xiaomi/mone/es/EsClient.java index f557c4d83..e2b145d2f 100644 --- a/jcommon/es/src/main/java/com/xiaomi/mone/es/EsClient.java +++ b/jcommon/es/src/main/java/com/xiaomi/mone/es/EsClient.java @@ -58,8 +58,8 @@ public class EsClient { private static Sniffer sniffer; - private static final int SNIFF_INTERVAL_MILLIS = 30 * 1000; - private static final int SNIFF_AFTER_FAILURE_DELAY_MILLIS = 30 * 1000; + private static final int SNIFF_INTERVAL_MILLIS = 60 * 1000 * 3; + private static final int SNIFF_AFTER_FAILURE_DELAY_MILLIS = 60 * 1000; private static final int MAX_CONN_PER_ROUTE = 500; private static final int MAX_CONN_TOTAL = 500; private static final int SOCKET_TIMEOUT_MS = 10 * 60 * 1000; @@ -196,7 +196,7 @@ private void initializeSniffer() { .setSniffAfterFailureDelayMillis(SNIFF_AFTER_FAILURE_DELAY_MILLIS) .setNodesSniffer(new ElasticsearchNodesSniffer( restClient, - TimeUnit.SECONDS.toMillis(5), + TimeUnit.SECONDS.toMillis(60), ElasticsearchNodesSniffer.Scheme.HTTP)) .build(); sniffOnFailureListener.setSniffer(sniffer); diff --git a/jcommon/es/src/test/java/com/xiaomi/mone/es/test/EsClientTest.java b/jcommon/es/src/test/java/com/xiaomi/mone/es/test/EsClientTest.java index 97ef93055..bc9b5a24f 100644 --- a/jcommon/es/src/test/java/com/xiaomi/mone/es/test/EsClientTest.java +++ b/jcommon/es/src/test/java/com/xiaomi/mone/es/test/EsClientTest.java @@ -226,8 +226,9 @@ public void getClusterHealth() throws IOException { @Test public void queryIndexMetadataTest() throws IOException { - GetMappingsResponse metadata = client.queryIndexMapping("zgq_common_milog_staging_app_private_1"); - System.out.println(String.format("result:%s", gson.toJson(metadata))); + GetMappingsResponse metadata = client.queryIndexMapping("test_scf_log_index"); +// Map mappings = metadata.mappings(); +// System.out.println(String.format("result:%s", gson.toJson(metadata))); } @Test diff --git a/jcommon/es/src/test/java/com/xiaomi/mone/es/test/EsProcessorClientTest.java b/jcommon/es/src/test/java/com/xiaomi/mone/es/test/EsProcessorClientTest.java index 7653a6d56..a6a7fb69b 100644 --- a/jcommon/es/src/test/java/com/xiaomi/mone/es/test/EsProcessorClientTest.java +++ b/jcommon/es/src/test/java/com/xiaomi/mone/es/test/EsProcessorClientTest.java @@ -22,7 +22,7 @@ public void bulkInsert() throws InterruptedException { NacosConfig config = new NacosConfig(); config.setDataId("zzy_new"); - config.init(); +// config.init(); String ip = config.getConfig("es_ip"); String user = config.getConfig("es_user"); @@ -53,13 +53,14 @@ public void afterBulk(long executionId, BulkRequest request, Throwable failure) int count = 0; while (true) { // processor.bulkInsert(indexName, data); - processor.bulkUpsert(indexName, "YpzPE4UBt3Uy5NFQ1V5e", data); + processor.bulkInsert(indexName, data); count++; if (count == n) { break; } } - Thread.sleep(10000l); +// Thread.sleep(10000l); + System.in.read(); }catch (Exception e){ e.printStackTrace(); } diff --git a/jcommon/file/src/main/java/com/xiaomi/mone/file/ILogFile.java b/jcommon/file/src/main/java/com/xiaomi/mone/file/ILogFile.java index 0a898721e..f78f883e6 100644 --- a/jcommon/file/src/main/java/com/xiaomi/mone/file/ILogFile.java +++ b/jcommon/file/src/main/java/com/xiaomi/mone/file/ILogFile.java @@ -16,5 +16,12 @@ public interface ILogFile { void initLogFile(String file, ReadListener listener, long pointer, long lineNumber); + /** + * It only needs to be called when an exception occurs and can only be called externally. + */ + void setExceptionFinish(); + + boolean getExceptionFinish(); + } diff --git a/jcommon/file/src/main/java/com/xiaomi/mone/file/LogFile.java b/jcommon/file/src/main/java/com/xiaomi/mone/file/LogFile.java index 5f8b82b61..71654948e 100644 --- a/jcommon/file/src/main/java/com/xiaomi/mone/file/LogFile.java +++ b/jcommon/file/src/main/java/com/xiaomi/mone/file/LogFile.java @@ -35,6 +35,8 @@ public class LogFile implements ILogFile { @Setter private volatile boolean reFresh; + private volatile boolean exceptionFinish; + @Getter private int beforePointerHashCode; @@ -171,6 +173,16 @@ public void initLogFile(String file, ReadListener listener, long pointer, long l this.lineNumber = lineNumber; } + @Override + public void setExceptionFinish() { + exceptionFinish = true; + } + + @Override + public boolean getExceptionFinish() { + return exceptionFinish; + } + private String lineCutOff(String line) { if (null != line) { //todo 大行文件先临时截断 diff --git a/jcommon/file/src/main/java/com/xiaomi/mone/file/LogFile2.java b/jcommon/file/src/main/java/com/xiaomi/mone/file/LogFile2.java index 27a921211..e77743c3a 100644 --- a/jcommon/file/src/main/java/com/xiaomi/mone/file/LogFile2.java +++ b/jcommon/file/src/main/java/com/xiaomi/mone/file/LogFile2.java @@ -42,6 +42,8 @@ public class LogFile2 implements ILogFile { @Setter private volatile boolean reFresh; + private volatile boolean exceptionFinish; + @Getter private int beforePointerHashCode; @@ -110,12 +112,13 @@ private void open() { } } + @Override public void readLine() throws IOException { while (true) { open(); //兼容文件切换时,缓存的pointer try { - log.info("open file:{},pointer:{}", file, this.pointer); + log.info("open file:{},pointer:{},lineNumber:{},", file, this.pointer, this.lineNumber); if (pointer > raf.length()) { pointer = 0; lineNumber = 0; @@ -123,7 +126,7 @@ public void readLine() throws IOException { } catch (Exception e) { log.error("file.length() IOException, file:{}", this.file, e); } - log.info("rel open file:{},pointer:{}", file, this.pointer); + log.info("rel open file:{},pointer:{},lineNumber:{}", file, this.pointer, this.lineNumber); raf.seek(pointer); while (true) { @@ -166,6 +169,7 @@ public void readLine() throws IOException { } if (listener.isBreak(line)) { + log.info("isBreak:{},pointer:{},lineNumber:{},fileKey:{}", this.file, this.pointer, this.lineNumber, this.fileKey); stop = true; break; } @@ -193,7 +197,7 @@ public void readLine() throws IOException { } raf.close(); if (stop) { - log.info("stop:{},pointer:{},fileKey:{}", this.file, this.pointer, this.fileKey); + log.info("stop:{},pointer:{},lineNumber:{},fileKey:{}", this.file, this.pointer, this.lineNumber, this.fileKey); FileInfoCache.ins().put(this.fileKey.toString(), FileInfo.builder().pointer(this.pointer).fileName(this.file).build()); break; } @@ -209,6 +213,16 @@ public void initLogFile(String file, ReadListener listener, long pointer, long l this.lineNumber = lineNumber; } + @Override + public void setExceptionFinish() { + exceptionFinish = true; + } + + @Override + public boolean getExceptionFinish() { + return exceptionFinish; + } + private String lineCutOff(String line) { if (null != line) { //todo 大行文件先临时截断 diff --git a/jcommon/file/src/test/java/com/xiaomi/mone/file/LogFileTest.java b/jcommon/file/src/test/java/com/xiaomi/mone/file/LogFileTest.java index 363f59624..8644d3e01 100644 --- a/jcommon/file/src/test/java/com/xiaomi/mone/file/LogFileTest.java +++ b/jcommon/file/src/test/java/com/xiaomi/mone/file/LogFileTest.java @@ -74,12 +74,12 @@ public void testLogFileMonitor() { monitor.setListener(new DefaultMonitorListener(monitor, readEvent -> { System.out.println(readEvent.getReadResult().getLines()); })); - String fileName = "/home/work/log/test/provider/server.log.*"; + String fileName = "/home/work/log/file.log.*"; Pattern pattern = Pattern.compile(fileName); - monitor.reg("/home/work/log/test/provider/", it -> { + monitor.reg("/home/work/log", it -> { boolean matches = pattern.matcher(it).matches(); log.info("file:{},matches:{}", it, matches); - return matches; + return true; }); log.info("reg finish"); System.in.read(); From 16f5df8cad3cd01e33422e94dc348a3e342383f5 Mon Sep 17 00:00:00 2001 From: zhangping17 Date: Fri, 21 Jun 2024 20:20:04 +0800 Subject: [PATCH 4/8] claude3.5 --- .../java/run/mone/ai/google/CloudeClient.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/jcommon/ai/google/src/main/java/run/mone/ai/google/CloudeClient.java b/jcommon/ai/google/src/main/java/run/mone/ai/google/CloudeClient.java index 63f71c457..67e929be4 100644 --- a/jcommon/ai/google/src/main/java/run/mone/ai/google/CloudeClient.java +++ b/jcommon/ai/google/src/main/java/run/mone/ai/google/CloudeClient.java @@ -84,4 +84,35 @@ public ResponsePayload call(String token, RequestPayload requestPayload) { return null; } + public ResponsePayload call(String url ,String token, RequestPayload requestPayload) { + OkHttpClient client = new OkHttpClient.Builder().readTimeout(5, TimeUnit.MINUTES).build(); + MediaType mediaType = MediaType.parse("application/json; charset=utf-8"); + RequestBody body = RequestBody.create(mediaType, new Gson().toJson(requestPayload)); + Request request = new Request.Builder() + .url(url) + .post(body) + .addHeader("Authorization", "Bearer " + token) + .addHeader("Content-Type", "application/json; charset=utf-8") + .build(); + + try (Response response = client.newCall(request).execute()) { + if (response.code() == 429) { + ResponsePayload res = new ResponsePayload(); + Content content = new Content(); + content.setText(gson.toJson(ImmutableMap.of("message", "被claude3限流了", "code", "429"))); + log.info("claude res:{}", content.getText()); + res.setContent(Lists.newArrayList(content)); + return res; + } + if (!response.isSuccessful()) throw new IOException("Unexpected code " + response); + // Handle the response + String res = response.body().string(); + log.info("claude3 res:{}", res); + return new Gson().fromJson(res, ResponsePayload.class); + } catch (Throwable e) { + log.error(e.getMessage(), e); + } + return null; + } + } From 9e990c82ab3f2a8ebf1b0abd3012cee7a5380cfb Mon Sep 17 00:00:00 2001 From: zhangping17 Date: Thu, 27 Jun 2024 11:36:48 +0800 Subject: [PATCH 5/8] claude3.5 --- .../google/src/main/java/run/mone/ai/google/CloudeClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jcommon/ai/google/src/main/java/run/mone/ai/google/CloudeClient.java b/jcommon/ai/google/src/main/java/run/mone/ai/google/CloudeClient.java index 67e929be4..0c3722ff7 100644 --- a/jcommon/ai/google/src/main/java/run/mone/ai/google/CloudeClient.java +++ b/jcommon/ai/google/src/main/java/run/mone/ai/google/CloudeClient.java @@ -40,9 +40,9 @@ public class CloudeClient { @SneakyThrows - public String token() { + public String token(String model) { GoogleCredentials credentials = GoogleCredentials.fromStream( - new FileInputStream("/tmp/key.json")) + new FileInputStream("/tmp/key-"+model+".json")) .createScoped(Collections.singleton("https://" + googleUrl + "/auth/cloud-platform")); // Use the credentials to authenticate and generate an access token credentials.refreshIfExpired(); From 7ab5014b81d11cf766c4bd8aaf75e018a168e327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=BF=97=E5=8B=87?= Date: Tue, 2 Jul 2024 10:10:18 +0800 Subject: [PATCH 6/8] [enhancement] JCommon MongoDB supports pagination queries #851 (#852) --- jcommon/ai/bytedance/pom.xml | 7 +++ .../run/mone/ai/bytedance/DoubaoClient.java | 56 +++++++++++++++++++ .../src/main/java/run/mone/auth/AuthAop.java | 5 ++ .../src/main/java/run/mone/bo/User.java | 6 +- .../java/run/mone/service/MongoService.java | 22 ++++++++ .../youpin/docean/test/HttpServerTest.java | 3 +- jcommon/pom.xml | 30 +++++----- 7 files changed, 112 insertions(+), 17 deletions(-) create mode 100644 jcommon/ai/bytedance/src/main/java/run/mone/ai/bytedance/DoubaoClient.java diff --git a/jcommon/ai/bytedance/pom.xml b/jcommon/ai/bytedance/pom.xml index bbadac9dd..b19d7e7e2 100644 --- a/jcommon/ai/bytedance/pom.xml +++ b/jcommon/ai/bytedance/pom.xml @@ -29,6 +29,13 @@ jackson-databind 2.12.4 + + + com.squareup.okhttp3 + okhttp + 4.10.0 + + diff --git a/jcommon/ai/bytedance/src/main/java/run/mone/ai/bytedance/DoubaoClient.java b/jcommon/ai/bytedance/src/main/java/run/mone/ai/bytedance/DoubaoClient.java new file mode 100644 index 000000000..94808fb5f --- /dev/null +++ b/jcommon/ai/bytedance/src/main/java/run/mone/ai/bytedance/DoubaoClient.java @@ -0,0 +1,56 @@ +package run.mone.ai.bytedance; + + +import okhttp3.*; + +/** + * @author goodjava@qq.com + * @date 2024/5/18 17:20 + */ +public class DoubaoClient { + + private static String ARK_API_KEY = ""; + + public static void main(String[] args) { + OkHttpClient client = new OkHttpClient(); + String json = "{\n" + + " \"model\": \"\",\n" + + " \"messages\": [\n" + + " {\n" + + " \"role\": \"system\",\n" + + " \"content\": \"You are a helpful assistant.\"\n" + + " },\n" + + " {\n" + + " \"role\": \"user\",\n" + + " \"content\": \"Hello!\"\n" + + " }\n" + + " ],\n" + + " \"stream\": false\n" + + "}"; + + MediaType JSON = MediaType.get("application/json; charset=utf-8"); + RequestBody body = RequestBody.create(json, JSON); + + Request request = new Request.Builder() + .url("") + .addHeader("Content-Type", "application/json") + .addHeader("Authorization", "Bearer " + ARK_API_KEY) // 确保你已经设置了 ARK_API_KEY 变量 + .post(body) + .build(); + + try (Response response = client.newCall(request).execute()) { + // 处理响应 + if (response.isSuccessful()) { + String responseBody = response.body().string(); + System.out.println(responseBody); + } else { + System.out.println(response); + } + } catch (Exception e) { + e.printStackTrace(); + } + + + } + +} diff --git a/jcommon/docean-plugin/docean-plugin-mongodb/src/main/java/run/mone/auth/AuthAop.java b/jcommon/docean-plugin/docean-plugin-mongodb/src/main/java/run/mone/auth/AuthAop.java index f9ea28bfa..ad8252e42 100644 --- a/jcommon/docean-plugin/docean-plugin-mongodb/src/main/java/run/mone/auth/AuthAop.java +++ b/jcommon/docean-plugin/docean-plugin-mongodb/src/main/java/run/mone/auth/AuthAop.java @@ -68,6 +68,11 @@ public void before(ProceedingJoinPoint point) { } } + //没有就当普通用户处理 + if (null == user.getRole()) { + user.setRole("user"); + } + //必须有后台管理权限 if (role.equals("admin")) { if (null == user || !user.getRole().equals("admin")) { diff --git a/jcommon/docean-plugin/docean-plugin-mongodb/src/main/java/run/mone/bo/User.java b/jcommon/docean-plugin/docean-plugin-mongodb/src/main/java/run/mone/bo/User.java index 01f224d39..0480cfc6c 100644 --- a/jcommon/docean-plugin/docean-plugin-mongodb/src/main/java/run/mone/bo/User.java +++ b/jcommon/docean-plugin/docean-plugin-mongodb/src/main/java/run/mone/bo/User.java @@ -7,6 +7,8 @@ import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Map; + /** * 用户 * @@ -17,7 +19,7 @@ @AllArgsConstructor @NoArgsConstructor @Entity("user") -public class User implements MongoBo{ +public class User implements MongoBo { @Id private String id; @@ -57,6 +59,8 @@ public class User implements MongoBo{ private String token; + private Map meta; + public User(String username, String password) { this.username = username; this.password = password; diff --git a/jcommon/docean-plugin/docean-plugin-mongodb/src/main/java/run/mone/service/MongoService.java b/jcommon/docean-plugin/docean-plugin-mongodb/src/main/java/run/mone/service/MongoService.java index 7b0171630..8b5726413 100644 --- a/jcommon/docean-plugin/docean-plugin-mongodb/src/main/java/run/mone/service/MongoService.java +++ b/jcommon/docean-plugin/docean-plugin-mongodb/src/main/java/run/mone/service/MongoService.java @@ -3,6 +3,7 @@ import com.xiaomi.youpin.docean.anno.Service; import dev.morphia.Datastore; import dev.morphia.UpdateOptions; +import dev.morphia.query.FindOptions; import dev.morphia.query.filters.Filter; import dev.morphia.query.filters.Filters; import dev.morphia.query.updates.UpdateOperator; @@ -65,6 +66,27 @@ public List findAll(Filter filter) { return datastore.find(this.clazz).filter(filter).iterator().toList(); } + public List findAll() { + return datastore.find(this.clazz).iterator().toList(); + } + + //实现分页查询(class) + public List findWithPagination(Filter filter, int page, int size) { + FindOptions options = new FindOptions() + .skip((page - 1) * size) + .limit(size); + return datastore.find(this.clazz) + .filter(filter) + .iterator(options) + .toList(); + } + + //查询总页数(class) + public long getTotalPages(Filter filter, int pageSize) { + long totalRecords = datastore.find(this.clazz).filter(filter).count(); + return (totalRecords + pageSize - 1) / pageSize; + } + public boolean delete(T t) { datastore.delete(t); return true; diff --git a/jcommon/docean/src/test/java/com/xiaomi/youpin/docean/test/HttpServerTest.java b/jcommon/docean/src/test/java/com/xiaomi/youpin/docean/test/HttpServerTest.java index bce62cebd..33ede037e 100644 --- a/jcommon/docean/src/test/java/com/xiaomi/youpin/docean/test/HttpServerTest.java +++ b/jcommon/docean/src/test/java/com/xiaomi/youpin/docean/test/HttpServerTest.java @@ -116,7 +116,8 @@ public void testWebSocketServer() { @Test public void testWebSocketClient() { OkHttpClient client = new OkHttpClient(); - Request request = new Request.Builder().url("ws://127.0.0.1:8899/ws").build(); +// Request request = new Request.Builder().url("ws://127.0.0.1:8899/ws").build(); + Request request = new Request.Builder().url("").build(); WebSocketListener listener = new WebSocketListener() { @Override public void onOpen(WebSocket webSocket, Response response) { diff --git a/jcommon/pom.xml b/jcommon/pom.xml index bd8a0c84c..66ebff815 100644 --- a/jcommon/pom.xml +++ b/jcommon/pom.xml @@ -232,21 +232,21 @@ - - - - - - - - - - - - - - - + + maven-source-plugin + 2.1 + + + compile + + jar + + + + + true + + From beeae95a0ddbd4ef529158dcfb9e4a37995305a9 Mon Sep 17 00:00:00 2001 From: rikaaa0928 Date: Tue, 2 Jul 2024 14:31:10 +0800 Subject: [PATCH 7/8] [enhancement] JCommon MongoDB UserController set default role at login --- .../src/main/java/run/mone/controller/UserController.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jcommon/docean-plugin/docean-plugin-mongodb/src/main/java/run/mone/controller/UserController.java b/jcommon/docean-plugin/docean-plugin-mongodb/src/main/java/run/mone/controller/UserController.java index bd8ad309d..86de53110 100644 --- a/jcommon/docean-plugin/docean-plugin-mongodb/src/main/java/run/mone/controller/UserController.java +++ b/jcommon/docean-plugin/docean-plugin-mongodb/src/main/java/run/mone/controller/UserController.java @@ -4,6 +4,7 @@ import com.xiaomi.youpin.docean.anno.ModelAttribute; import com.xiaomi.youpin.docean.anno.RequestMapping; import com.xiaomi.youpin.docean.anno.RequestParam; +import com.xiaomi.youpin.docean.common.StringUtils; import com.xiaomi.youpin.docean.mvc.ContextHolder; import com.xiaomi.youpin.docean.mvc.MvcContext; import run.mone.bo.User; @@ -104,6 +105,9 @@ public String login(User userReq) { return "error"; } user.setPassword(""); + if (StringUtils.isEmpty(user.getRole())) { + user.setRole("user"); + } context.session().setAttribute("user", user); return "ok"; } From b65bb034064cd70a85a0070f2ae9aeb4376a14f3 Mon Sep 17 00:00:00 2001 From: rikaaa0928 <8528731+rikaaa0928@users.noreply.github.com> Date: Tue, 2 Jul 2024 16:18:43 +0800 Subject: [PATCH 8/8] [enhancement] JCommon MongoDB UserController fix default role for annotation (#854) --- .../docean-plugin-mongodb/src/main/java/run/mone/auth/Auth.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jcommon/docean-plugin/docean-plugin-mongodb/src/main/java/run/mone/auth/Auth.java b/jcommon/docean-plugin/docean-plugin-mongodb/src/main/java/run/mone/auth/Auth.java index 80b0238db..daea12999 100644 --- a/jcommon/docean-plugin/docean-plugin-mongodb/src/main/java/run/mone/auth/Auth.java +++ b/jcommon/docean-plugin/docean-plugin-mongodb/src/main/java/run/mone/auth/Auth.java @@ -29,5 +29,5 @@ String name() default "name"; - String role() default "admin"; + String role() default "user"; }