docs: add description annotation at inquiry API files

This commit is contained in:
Dayoung 2025-06-18 09:19:55 +09:00
parent de5b6d0c65
commit 3d5cb308a8
4 changed files with 147 additions and 0 deletions

View File

@ -3,6 +3,59 @@ import axios from 'axios'
import { NextResponse } from 'next/server'
import { loggerWrapper } from '@/libs/api-wrapper'
/**
* @api {GET} /api/qna/detail API
* @apiName GET /api/qna/detail
* @apiGroup Qna
* @apiDescription API
*
* @apiParam {String} compCd
* @apiParam {String} qnaNo
* @apiParam {String} langCd
* @apiParam {String} loginId ID
*
* @apiExample {curl} Example usage:
* curl -X GET http://localhost:3000/api/qna/detail
*
* @apiSuccessExample {json} Success-Response:
* {
* "data": {
"compCd": "5200",
"qnaNo": 51,
"qstTitle": "Q.CAST TEST",
"qstContents": "Q.CAST TEST CONTENTS",
"regDt": "2025.04.29 16:16:51",
"regId": "X112",
"regNm": "株式会社アイ工務店",
"regEmail": "x112@interplug.co.kr",
"answerYn": "N",
"ansContents": null,
"ansRegDt": null,
"ansRegNm": null,
"ansListFile": null,
"storeId": "X112",
"storeNm": "株式会社アイ工務店",
"regUserNm": "TEST",
"regUserTelNo": "010-1111-1111",
"qnaClsLrgCd": "A01",
"qnaClsMidCd": "B02",
"qnaClsSmlCd": "C05",
"listFile": [
{
"fileNo": 853
"encodeFileNo": 853,
"srcFileNm": "Quotation_4500380_20240808145129.pdf",
"fileCours": "/temp/20250428/"
"fileSize":160982,
"regDt":"2024.08.13"
}
...
],
...
},
* @apiError {Number} 401 ( )
* @apiError {Number} 500
*/
async function getQnaDetail(request: Request): Promise<NextResponse> {
const { searchParams } = new URL(request.url)
const params = {

View File

@ -7,6 +7,51 @@ import { loggerWrapper } from '@/libs/api-wrapper'
import { sessionOptions } from '@/libs/session'
import { SessionData } from '@/types/Auth'
/**
* @api {GET} /api/qna/list API
* @apiName GET /api/qna/list
* @apiGroup Qna
* @apiDescription API
*
* @apiParam {String} compCd
* @apiParam {String} langCd
* @apiParam {String} storeId ID
* @apiParam {String} siteTpCd
* @apiParam {String} schTitle
* @apiParam {String} schRegId ID
* @apiParam {String} schFromDt
* @apiParam {String} schToDt
* @apiParam {String} schAnswerYn
* @apiParam {String} loginId ID
*
* @apiExample {curl} Example usage:
* curl -X GET http://localhost:3000/api/qna/list
*
* @apiSuccessExample {json} Success-Response:
* {
* "data": [
{
"totCnt": 1,
"rowNumber": 1,
"compCd": "5200",
"qnaNo": 51,
"qstTitle": "Q.CAST TEST22",
"regDt": "2025.05.12",
"regId": "X112",
"regNm": "株式会社アイ工務店",
"answerYn": "N",
"attachYn": null,
"qnaClsLrgCd": "見積関連",
"qnaClsMidCd": "構造設置可否",
"qnaClsSmlCd": "C05 未定2",
"regUserNm": "Test"
},
...
],
}
* @apiError {Number} 500
* @apiError {Number} 401 ( )
*/
async function getQnaList(request: Request): Promise<NextResponse> {
const cookieStore = await cookies()
const session = await getIronSession<SessionData>(cookieStore, sessionOptions)

View File

@ -3,6 +3,34 @@ import axios from 'axios'
import { CommonCode } from '@/types/Inquiry'
import { loggerWrapper } from '@/libs/api-wrapper'
/**
* @api {GET} /api/qna API
* @apiName GET /api/qna
* @apiGroup Qna
* @apiDescription API
*
* @apiSuccess {Object} data
* @apiSuccess {String} data.headCd
* @apiSuccess {String} data.code
* @apiSuccess {String} data.codeJp -
* @apiSuccess {String} data.refChr1 -
*
* @apiExample {curl} Example usage:
* curl -X GET http://localhost:3000/api/qna
*
* @apiSuccessExample {json} Success-Response:
* {
* "data": [
* {
* "headCd": "204200",
* "code": "1",
* "codeJp": "1",
* "refChr1": "1"
* }
* ],
* ...
* }
*/
async function getCommonCodeListData(request: Request): Promise<NextResponse> {
const response = await axios.get(`${process.env.NEXT_PUBLIC_INQUIRY_API_URL}/api/system/commonCodeListData`)
const codeList: CommonCode[] = []

View File

@ -2,6 +2,27 @@ import axios from 'axios'
import { NextResponse } from 'next/server'
import { loggerWrapper } from '@/libs/api-wrapper'
/**
* @api {POST} /api/qna/save API
* @apiName POST /api/qna/save
* @apiGroup Qna
* @apiDescription API
*
* @apiBody {InquiryRequest} inquiryRequest
*
* @apiExample {curl} Example usage:
* curl -X POST http://localhost:3000/api/qna/save
*
* @apiSuccessExample {json} Success-Response:
* {
* "data" : {
* "cnt": 1,
* "qnoNo": 1,
* "mailYn": "Y"
* },
* },
* @apiError {Number} 500
*/
async function setQna(request: Request): Promise<NextResponse> {
const formData = await request.formData()
console.log(formData)