okuda-seminar / log_service

Apache License 2.0
0 stars 0 forks source link

[Server]implement listlog feature in presentation layer. #35

Closed Rwatana closed 2 weeks ago

Rwatana commented 1 month ago

Issue Number

33

Implementation Summary

This pull request implements the HandleLogList method in the presentation layer, enabling the retrieval and display of log records through an HTTP endpoint. The following modifications were made:

Scope of Impact

Particular Points to Check

image

Schedule

10/27

Rwatana commented 1 month ago

@nayuta-ai Please check my PR.

Rwatana commented 3 weeks ago

@nayuta-ai I think I have modified the points. Please check my code.

Rwatana commented 3 weeks ago

@nayuta-ai
I have incorporated the points you highlighted without splitting the test. Could you please review my code?

image

Rwatana commented 3 weeks ago

@nayuta-ai

Topic

I modified the variable names to prevent conflicts.I consolidated the two separate test functions into a single test function. Please check my code.

Question

In a case like this, should I request a review from Okuda-san?

image

nayuta-ai commented 3 weeks ago

Please ensure that both Okuda-san and I provide approval.

ryuji0123 commented 3 weeks ago

Unless I explicitly request changes, you don't need to ask my approval.

Rwatana commented 3 weeks ago

@nayuta-ai I modified a variable name to camel case and added a test for ListLogs failure. image

Rwatana commented 3 weeks ago

@nayuta-ai I have some misunderstandings about mock testing. I think I may have modified the code incorrectly. Could you please check my code?

image

nayuta-ai commented 3 weeks ago

@Rwatana Why has the test coverage decreased?

Rwatana commented 3 weeks ago

@nayuta-ai I understand that for this mock, I want to create a struct that can’t be encoded, or create a situation where an error occurs during the encoding process to test for failure cases. However, I am unsure how to achieve this.

I tried making the mock return a new struct that cannot be encoded or replacing part of the struct with non-encodable elements, but it didn’t work by the error. Could you advise on how to proceed in such a case? I apologize for the last-minute request.

nayuta-ai commented 3 weeks ago

I understand the necessity of the following code:

type errorWriterResponse struct {
    statusCode int
    body       string
}

How about reverting to the previous commit?

Rwatana commented 3 weeks ago

@nayuta-ai I reverted to the previous version. Please check my code. image

Rwatana commented 2 weeks ago

@nayuta-ai I think I was able to format it correctly by using the Go formatter. Please check my code.

github-actions[bot] commented 2 weeks ago

Format failed

Files that need to be formatted: internal/server/infrastructure/mysql/db/connect_db.go internal/server/usecase/list_log_test.go