helado12 / blog

A nice, simple blog using Spring Boot, mybatis and semantic-ui
http://34.105.241.17:8080/
0 stars 0 forks source link

Sweep: Add a new backend service to this blog app that the user can view the blog by the "category" of the blog similar to the "tag" #3

Open helado12 opened 8 months ago

helado12 commented 8 months ago

This is a personal blog application with a front-end and a back-end built in Spring Boot, mybatis and semantic-ui. It has basic functionality like view the blog, query the blog by its tag/type, and it has a admin module where the admin user can log-in and edit the blogs. You should analyse the repo closely to understand the whole application and the requirement is to add a new backend functionality that the user can view the blog by its "category". Make necessary code changes and front-end implenementation and testing are not required.

Checklist - [X] Create `src/main/resources/mapper/CategoryDao.xml` ✓ https://github.com/helado12/blog/commit/096aa6d1a329e98b5330a997cca6a4f9c759e4fb [Edit](https://github.com/helado12/blog/edit/sweep/add_a_new_backend_service_to_this_blog_a/src/main/resources/mapper/CategoryDao.xml) - [X] Running GitHub Actions for `src/main/resources/mapper/CategoryDao.xml` ✓ [Edit](https://github.com/helado12/blog/edit/sweep/add_a_new_backend_service_to_this_blog_a/src/main/resources/mapper/CategoryDao.xml) - [X] Create `src/main/java/com/htr/dao/CategoryDao.java` ✓ https://github.com/helado12/blog/commit/c79c156c5c91502688c039f8e64626999cb2ffcc [Edit](https://github.com/helado12/blog/edit/sweep/add_a_new_backend_service_to_this_blog_a/src/main/java/com/htr/dao/CategoryDao.java) - [X] Running GitHub Actions for `src/main/java/com/htr/dao/CategoryDao.java` ✓ [Edit](https://github.com/helado12/blog/edit/sweep/add_a_new_backend_service_to_this_blog_a/src/main/java/com/htr/dao/CategoryDao.java) - [X] Modify `src/main/resources/mapper/BlogDao.xml` ✓ https://github.com/helado12/blog/commit/912ba18f479db8be25562dedb4ed7552a55a76b7 [Edit](https://github.com/helado12/blog/edit/sweep/add_a_new_backend_service_to_this_blog_a/src/main/resources/mapper/BlogDao.xml) - [X] Running GitHub Actions for `src/main/resources/mapper/BlogDao.xml` ✓ [Edit](https://github.com/helado12/blog/edit/sweep/add_a_new_backend_service_to_this_blog_a/src/main/resources/mapper/BlogDao.xml) - [X] Modify `src/main/java/com/htr/dao/BlogDao.java` ✓ https://github.com/helado12/blog/commit/42abac3fdb63047182afca008e480bd18158bb99 [Edit](https://github.com/helado12/blog/edit/sweep/add_a_new_backend_service_to_this_blog_a/src/main/java/com/htr/dao/BlogDao.java) - [X] Running GitHub Actions for `src/main/java/com/htr/dao/BlogDao.java` ✓ [Edit](https://github.com/helado12/blog/edit/sweep/add_a_new_backend_service_to_this_blog_a/src/main/java/com/htr/dao/BlogDao.java) - [X] Modify `src/main/java/com/htr/service/BlogService.java` ✓ https://github.com/helado12/blog/commit/49cb17696819817ba8e48f8c9fa10ff807e5b80d [Edit](https://github.com/helado12/blog/edit/sweep/add_a_new_backend_service_to_this_blog_a/src/main/java/com/htr/service/BlogService.java) - [X] Running GitHub Actions for `src/main/java/com/htr/service/BlogService.java` ✓ [Edit](https://github.com/helado12/blog/edit/sweep/add_a_new_backend_service_to_this_blog_a/src/main/java/com/htr/service/BlogService.java) - [X] Create `src/main/java/com/htr/entity/Category.java` ✓ https://github.com/helado12/blog/commit/fb81fc4d3bc1c3fcb9ecde0e256c1e9486ad6e96 [Edit](https://github.com/helado12/blog/edit/sweep/add_a_new_backend_service_to_this_blog_a/src/main/java/com/htr/entity/Category.java) - [X] Running GitHub Actions for `src/main/java/com/htr/entity/Category.java` ✓ [Edit](https://github.com/helado12/blog/edit/sweep/add_a_new_backend_service_to_this_blog_a/src/main/java/com/htr/entity/Category.java) - [X] Create `src/main/java/com/htr/entity/Blog.java` ✓ https://github.com/helado12/blog/commit/d253217f6cfb3c82b145b3688c130852afc23019 [Edit](https://github.com/helado12/blog/edit/sweep/add_a_new_backend_service_to_this_blog_a/src/main/java/com/htr/entity/Blog.java) - [X] Running GitHub Actions for `src/main/java/com/htr/entity/Blog.java` ✓ [Edit](https://github.com/helado12/blog/edit/sweep/add_a_new_backend_service_to_this_blog_a/src/main/java/com/htr/entity/Blog.java)
helado12 commented 8 months ago

🚀 Here's the PR! #5

See Sweep's progress at the progress dashboard!
💎 Sweep Pro: I'm using GPT-4. You have unlimited GPT-4 tickets. (tracking ID: None)
Install Sweep Configs: Pull Request

[!TIP] I can email you next time I complete a pull request if you set up your email here!


Actions (click)


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I think are relevant in decreasing order of relevance (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/helado12/blog/blob/504980349c052ccf98c9f489dd366759813627b4/src/main/resources/mapper/BlogDao.xml#L1-L169

Step 2: ⌨️ Coding

Ran GitHub Actions for c79c156c5c91502688c039f8e64626999cb2ffcc:

--- 
+++ 
@@ -154,6 +154,14 @@
         where (blogtag.tag_id= tag.id and blogtag.blog_id = b.id and tag.id = #{id} ) order by b.update_time desc
     

+    
+
     
         update t_blog set views = views + 1 where id = #{id}
     

Ran GitHub Actions for 912ba18f479db8be25562dedb4ed7552a55a76b7:

--- 
+++ 
@@ -43,6 +43,8 @@

     List getByTagId(Long id);

+    List getBlogsByCategoryId(Long categoryId);
+
     List queryBlogYear();

     List findByYear(String year);

Ran GitHub Actions for 42abac3fdb63047182afca008e480bd18158bb99:

--- 
+++ 
@@ -37,6 +37,8 @@

     List getByTagId(Long id);

+    List getBlogsByCategory(Long categoryId);
+
     Map> archiveBlog();

 }

Ran GitHub Actions for 49cb17696819817ba8e48f8c9fa10ff807e5b80d:

Ran GitHub Actions for fb81fc4d3bc1c3fcb9ecde0e256c1e9486ad6e96:

Ran GitHub Actions for d253217f6cfb3c82b145b3688c130852afc23019:


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/add_a_new_backend_service_to_this_blog_a.


🎉 Latest improvements to Sweep:
  • New dashboard launched for real-time tracking of Sweep issues, covering all stages from search to coding.
  • Integration of OpenAI's latest Assistant API for more efficient and reliable code planning and editing, improving speed by 3x.
  • Use the GitHub issues extension for creating Sweep issues directly from your editor.

💡 To recreate the pull request edit the issue title or description.Something wrong? Let us know.

This is an automated message generated by Sweep AI.