fix: path url and add docs
This commit is contained in:
parent
d492f3ce44
commit
037acbe128
@ -12,7 +12,7 @@ func GetAllPlan(
|
|||||||
router chi.Router,
|
router chi.Router,
|
||||||
subsPlanSvc subscribeplansvc.SubsPlanIntf,
|
subsPlanSvc subscribeplansvc.SubsPlanIntf,
|
||||||
) {
|
) {
|
||||||
router.Get("/get-plans", func(w http.ResponseWriter, r *http.Request) {
|
router.Get("/subscribe-plan/get-all", func(w http.ResponseWriter, r *http.Request) {
|
||||||
ctx := r.Context()
|
ctx := r.Context()
|
||||||
subsPlan, err := subsPlanSvc.GetAllPlan()
|
subsPlan, err := subsPlanSvc.GetAllPlan()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
144
openapi.yml
Normal file
144
openapi.yml
Normal file
@ -0,0 +1,144 @@
|
|||||||
|
openapi: 3.0.0
|
||||||
|
info:
|
||||||
|
title: Staff and User API
|
||||||
|
version: 1.0.0
|
||||||
|
description: API for handling staff and user login, registration, and subscription plan creation.
|
||||||
|
|
||||||
|
paths:
|
||||||
|
/api/staff/login:
|
||||||
|
post:
|
||||||
|
summary: Login for staff
|
||||||
|
requestBody:
|
||||||
|
required: true
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
email:
|
||||||
|
type: string
|
||||||
|
format: email
|
||||||
|
password:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- email
|
||||||
|
- password
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: Successful login
|
||||||
|
"400":
|
||||||
|
description: Bad request
|
||||||
|
|
||||||
|
/api/staff/register:
|
||||||
|
post:
|
||||||
|
summary: Register a new staff member
|
||||||
|
requestBody:
|
||||||
|
required: true
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
email:
|
||||||
|
type: string
|
||||||
|
format: email
|
||||||
|
password:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- email
|
||||||
|
- password
|
||||||
|
responses:
|
||||||
|
"201":
|
||||||
|
description: Staff member created
|
||||||
|
"400":
|
||||||
|
description: Bad request
|
||||||
|
"409":
|
||||||
|
description: Conflict (email already registered)
|
||||||
|
|
||||||
|
/api/user/login:
|
||||||
|
post:
|
||||||
|
summary: Login for user
|
||||||
|
requestBody:
|
||||||
|
required: true
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
email:
|
||||||
|
type: string
|
||||||
|
format: email
|
||||||
|
password:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- email
|
||||||
|
- password
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: Successful login
|
||||||
|
"400":
|
||||||
|
description: Bad request
|
||||||
|
|
||||||
|
/api/user/register:
|
||||||
|
post:
|
||||||
|
summary: Register a new user
|
||||||
|
requestBody:
|
||||||
|
required: true
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
email:
|
||||||
|
type: string
|
||||||
|
format: email
|
||||||
|
password:
|
||||||
|
type: string
|
||||||
|
subscribe_plan_id:
|
||||||
|
type: string
|
||||||
|
phone:
|
||||||
|
type: string
|
||||||
|
format: phone
|
||||||
|
required:
|
||||||
|
- email
|
||||||
|
- password
|
||||||
|
- subscribe_plan_id
|
||||||
|
- phone
|
||||||
|
responses:
|
||||||
|
"201":
|
||||||
|
description: User created
|
||||||
|
"400":
|
||||||
|
description: Bad request
|
||||||
|
"409":
|
||||||
|
description: Conflict (email already registered)
|
||||||
|
|
||||||
|
/subscribe-plan/create:
|
||||||
|
post:
|
||||||
|
summary: Create a new subscription plan
|
||||||
|
requestBody:
|
||||||
|
required: true
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
code:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- code
|
||||||
|
responses:
|
||||||
|
"201":
|
||||||
|
description: Subscription plan created
|
||||||
|
"400":
|
||||||
|
description: Bad request
|
||||||
|
"409":
|
||||||
|
description: Conflict (plan code already exists)
|
||||||
|
|
||||||
|
/subscribe-plan/get-all:
|
||||||
|
post:
|
||||||
|
summary: Get all subscription plan
|
||||||
|
responses:
|
||||||
|
"201":
|
||||||
|
description: Subscription plan created
|
||||||
|
"400":
|
||||||
|
description: Bad request
|
||||||
Loading…
x
Reference in New Issue
Block a user