halo-dev / halo

强大易用的开源建站工具。
https://www.halo.run
GNU General Public License v3.0
33.3k stars 9.61k forks source link

feat: support JSON-based retrieval and update for theme and plugin configs #6661

Open guqing opened 6 days ago

guqing commented 6 days ago

What type of PR is this?

/kind improvement /area core /milestone 2.20.x

What this PR does / why we need it:

新增 API 用于以 JSON 的方式获取和更新插件和主题的配置

之前一直是返回的 ConfigMap 让前端去操作字符串 JSON 需要转换,渲染表单值回显等操作都不方便,例如像 SEO 插件这样还会去获取配置在业务中使用而不仅仅是只有后端会使用到配置,因此使用 JSON 的方式返回可能要更合理一些

Does this PR introduce a user-facing change?

新增 API 用于以 JSON 格式获取和更新插件和主题的配置
f2c-ci-robot[bot] commented 6 days ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please ask for approval from guqing. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/halo-dev/halo/blob/main/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
guqing commented 6 days ago

@ruibaby 帮忙适配一下前端部分

codecov[bot] commented 6 days ago

Codecov Report

Attention: Patch coverage is 79.20000% with 26 lines in your changes missing coverage. Please review.

Project coverage is 58.26%. Comparing base (6cd8dc8) to head (a634065). Report is 72 commits behind head on main.

Files with missing lines Patch % Lines
...tension/service/impl/SettingConfigServiceImpl.java 5.26% 18 Missing :warning:
...un/halo/app/core/extension/theme/SettingUtils.java 0.00% 4 Missing :warning:
...lo/app/core/extension/endpoint/PluginEndpoint.java 96.07% 1 Missing and 1 partial :warning:
...n/halo/app/core/extension/theme/ThemeEndpoint.java 96.07% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #6661 +/- ## ============================================ + Coverage 58.18% 58.26% +0.07% - Complexity 3774 3948 +174 ============================================ Files 651 675 +24 Lines 22125 23189 +1064 Branches 1538 1576 +38 ============================================ + Hits 12873 13510 +637 - Misses 8641 9059 +418 - Partials 611 620 +9 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sonarcloud[bot] commented 6 days ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud