Add APIs to fetch theme info and settings according to the theme id
Created by: guqing
What this PR does?
Add api to fetch theme info and settings according to the themeId
Why we need it?
Close #1659 (closed)
How to test it?
- 拉取该PR运行
- 登陆后台设置api key为:12345678
- 测试接口
获取主题信息:
➤ curl -g -i -X GET http://127.0.0.1:8090/api/content/themes/caicai_anatole -H "API-Authorization: 12345678" -H "Content-Type: application/json"
HTTP/1.1 200 OK
Date: Fri, 18 Feb 2022 05:08:17 GMT
Access-Control-Allow-Headers: Content-Type,ADMIN-Authorization,API-Authorization
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Credentials: true
Access-Control-Max-Age: 3600
Content-Type: application/json
Vary: Accept-Encoding, User-Agent
Transfer-Encoding: chunked
{"status":200,"message":"OK","devMessage":null,"data":{"id":"caicai_anatole","name":"Anatole","website":"https://github.com/halo-dev/halo-theme-anatole","branch":"master","repo":"https://github.com/halo-dev/halo-theme-anatole","updateStrategy":"RELEASE","description":"A other Halo theme","logo":"https://avatars1.githubusercontent.com/u/1811819?s=460&v=4","version":"1.2.0","require":"1.3.0","author":{"name":"Caicai","website":"https://www.caicai.me","avatar":null},"themePath":"/Users/guqing/halo-dev/templates/themes/caicai_anatole","folderName":"caicai_anatole","hasOptions":true,"screenshots":"/themes/caicai_anatole/screenshot.png","postMetaField":null,"sheetMetaField":null,"activated":true}}
获取主题配置:
➤ curl -g -i -X GET http://127.0.0.1:8090/api/content/themes/caicai_anatole/settings -H "API-Authorization: 12345678" -H "Content-Type: application/json"
HTTP/1.1 200 OK
Date: Fri, 18 Feb 2022 05:09:47 GMT
Access-Control-Allow-Headers: Content-Type,ADMIN-Authorization,API-Authorization
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Credentials: true
Access-Control-Max-Age: 3600
Content-Type: application/json
Vary: Accept-Encoding, User-Agent
Transfer-Encoding: chunked
{"status":200,"message":"OK","devMessage":null,"data":{"post_title_uppper":true,"scrollbar":"#3798e8","avatar_circle":true,"blog_title_uppper":true,"hitokoto":false,"rss":true,"google_color":"#fff","code_pretty":""}}