Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix api document module update api detail error #4720

Merged
merged 3 commits into from
Jun 9, 2023

Conversation

tomsun28
Copy link
Contributor

@tomsun28 tomsun28 commented Jun 9, 2023

bugfix can not update api detail on api document module.
exception below happen when update api detail.

Caused by: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: NULL not allowed for column "DATE_CREATED"; SQL statement:
INSERT INTO tag_relation
        (id,date_created,date_updated,api_id,tag_id)VALUES (?,?,?,?,?) [23502-200]

Make sure that:

  • You have read the contribution guidelines.
  • You submit test cases (unit or integration tests) that back your changes.
  • Your local test passed ./mvnw clean install -Dmaven.javadoc.skip=true.

@@ -113,6 +113,7 @@ private String update(final ApiDTO apiDTO) {
.id(UUIDUtils.getInstance().generateShortUuid())
.apiId(apiDO.getId())
.tagId(tagId)
.dateCreated(currentTime)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the SQL statement, changing the create time in the update interface is incorrect.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the SQL statement, changing the create time in the update interface is incorrect.

  tagRelationMapper.deleteByApiId(apiDO.getId());
  tagRelationMapper.batchInsert(tags);

hi, but due the tag relation always be deleted and then insert new tag relation when update this api, the createdTime always is currentTime.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, I saw that.

@codecov-commenter
Copy link

codecov-commenter commented Jun 9, 2023

Codecov Report

Merging #4720 (34b7274) into master (cc6b97f) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##             master    #4720      +/-   ##
============================================
- Coverage     66.27%   66.27%   -0.01%     
- Complexity     8010     8011       +1     
============================================
  Files          1111     1111              
  Lines         32181    32182       +1     
  Branches       2907     2907              
============================================
  Hits          21329    21329              
- Misses         9154     9155       +1     
  Partials       1698     1698              
Impacted Files Coverage Δ
...ache/shenyu/admin/service/impl/ApiServiceImpl.java 24.26% <0.00%> (-0.18%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@loongs-zhang loongs-zhang added this to the 2.6.0 milestone Jun 9, 2023
@loongs-zhang loongs-zhang merged commit f76a287 into apache:master Jun 9, 2023
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants