Commit 1c1215d2 authored by Gyeongho Park's avatar Gyeongho Park

[MOD] docs

parent 4b2b6d54
package com.vazil.vridge.docs.controller;
import com.vazil.vridge.docs.model.GuideIndex;
import com.vazil.vridge.docs.service.GuideIndexService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.*;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import java.util.Arrays;
@RestController
@AllArgsConstructor
@Log4j2
@RequestMapping("/api/guide")
@CrossOrigin
@Api("가이드 API V1")
public class GuideController {
GuideIndexService service;
private static final String GITHUB_TOKEN = "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";
private static final String GITHUB_URL = "https://raw.githubusercontent.com/vazilcompany/vridge-docs/refs/heads/main/guide/";
@ApiOperation(value="가이드 조회")
@GetMapping
public ResponseEntity<String> getContent(@RequestParam(name = "path") String contentPath) throws Exception{
try {
RestTemplate restTemplate = new RestTemplate();
String response = restTemplate.getForObject(GITHUB_URL + contentPath, String.class);
return ResponseEntity.ok(response);
} catch (Exception e) {
log.error(e);
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("가이드 로드 실패");
}
}
}
......@@ -113,8 +113,7 @@ export default {
async getGuideContents() {
const contentKey = `${this.guide.path.substring(0,this.guide.path.length-1)}.md`
await this.$axios.get(
`https://raw.githubusercontent.com/vazilcompany/vridge-docs/refs/heads/main/guide/${this.$i18n.locale}/` + contentKey, {
await this.$axios.get(`/guide/${this.$i18n.locale}/` + contentKey, {
headers:{
Authorization: 'token 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',
}
......
{
"name": "vridge-docs",
"lockfileVersion": 3,
"requires": true,
"packages": {}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment