meonkeys commented on code in PR #8:
URL: 
https://github.com/apache/fineract-chat-archive/pull/8#discussion_r2776506628


##########
src/main/java/org/apache/fineract/chat/archive/SlackApiClient.java:
##########
@@ -0,0 +1,379 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.fineract.chat.archive;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URLEncoder;
+import java.net.http.HttpClient;
+import java.net.http.HttpRequest;
+import java.net.http.HttpResponse;
+import java.time.Duration;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+
+final class SlackApiClient {

Review Comment:
   Why `final`?
   
   And why implement your own, instead of using their official Java client?



##########
src/main/java/org/apache/fineract/chat/archive/MarkdownRenderer.java:
##########
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.fineract.chat.archive;
+
+import java.time.LocalDate;
+import java.util.List;
+
+final class MarkdownRenderer {
+
+    private MarkdownRenderer() {}
+
+    static String renderDailyPage(String channelName, LocalDate date, 
List<Row> rows) {
+        StringBuilder builder = new StringBuilder();
+        builder.append("---\n");
+        builder.append("title: \"#").append(channelName).append(" 
").append(date).append("\"\n");
+        builder.append("date: ").append(date).append('\n');
+        builder.append("channel: ").append(channelName).append('\n');
+        builder.append("---\n\n");
+
+        builder.append("| Time (UTC) | User | Message |\n");

Review Comment:
   I'm not sure if a table is a great idea for formatting these, but I guess 
it's fine for the MVP, just to see this working. I'd be good with simplifying a 
bit, e.g.
   
   ```markdown
   time - user - message
   
   time - user - message
   
   time - user - message
   ```
   
   ? What do you think? These would just be long lines (or multiple lines if 
the message spanned multiple lines). `time - user` could use the permalink.



##########
src/main/java/org/apache/fineract/chat/archive/MarkdownRenderer.java:
##########
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.fineract.chat.archive;
+
+import java.time.LocalDate;
+import java.util.List;
+
+final class MarkdownRenderer {

Review Comment:
   Why `final`?
   
   Consider using `commonmark-java`. Might clean up the code a bit.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to