Compare commits
No commits in common. "ba075b67fd53d2dab8723bfe906e2e405b0ccffe" and "81c7a51256fe23ff84e70e9ca7bf283dc0761c75" have entirely different histories.
ba075b67fd
...
81c7a51256
@ -58,7 +58,7 @@ func LoginStaff(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
responsePayload := &authdomain.AuthResponse{
|
responsePayload := &authdomain.LoginResponse{
|
||||||
Token: token,
|
Token: token,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ func LoginUser(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
responsePayload := &authdomain.AuthResponse{
|
responsePayload := &authdomain.LoginResponse{
|
||||||
Token: token,
|
Token: token,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -58,11 +58,7 @@ func RegisterUser(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
responsePayload := &authdomain.AuthResponse{
|
response.RespondJsonSuccess(ctx, w, token)
|
||||||
Token: token,
|
|
||||||
}
|
|
||||||
|
|
||||||
response.RespondJsonSuccess(ctx, w, responsePayload)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,9 +108,7 @@ func RegisterStaff(
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
responsePayload := &authdomain.AuthResponse{
|
|
||||||
Token: token,
|
response.RespondJsonSuccess(ctx, w, token)
|
||||||
}
|
|
||||||
response.RespondJsonSuccess(ctx, w, responsePayload)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -60,7 +60,7 @@ func CreateSubscribePlan(
|
|||||||
response.RespondJsonSuccess(ctx, w, struct {
|
response.RespondJsonSuccess(ctx, w, struct {
|
||||||
Message string
|
Message string
|
||||||
}{
|
}{
|
||||||
Message: "subscription plan created successfully.",
|
Message: "success",
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,7 @@ func GetAllPlan(
|
|||||||
router chi.Router,
|
router chi.Router,
|
||||||
subsPlanSvc subscribeplansvc.SubsPlanIntf,
|
subsPlanSvc subscribeplansvc.SubsPlanIntf,
|
||||||
) {
|
) {
|
||||||
router.Get("/subscribe-plan", 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 {
|
||||||
|
|||||||
@ -7,7 +7,7 @@ type LoginReq struct {
|
|||||||
Password string `json:"password" validate:"required"`
|
Password string `json:"password" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AuthResponse struct {
|
type LoginResponse struct {
|
||||||
Token string `json:"token"`
|
Token string `json:"token"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
202
openapi.yml
202
openapi.yml
@ -8,8 +8,6 @@ paths:
|
|||||||
/staff/login:
|
/staff/login:
|
||||||
post:
|
post:
|
||||||
summary: Login for staff
|
summary: Login for staff
|
||||||
tags:
|
|
||||||
- Staff
|
|
||||||
requestBody:
|
requestBody:
|
||||||
required: true
|
required: true
|
||||||
content:
|
content:
|
||||||
@ -28,37 +26,12 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: Successful login
|
description: Successful login
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
data:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
token:
|
|
||||||
type: string
|
|
||||||
description: JWT token for staff authentication
|
|
||||||
"400":
|
"400":
|
||||||
description: Bad request
|
description: Bad request
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
error:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
code:
|
|
||||||
type: string
|
|
||||||
message:
|
|
||||||
type: string
|
|
||||||
|
|
||||||
/staff/register:
|
/staff/register:
|
||||||
post:
|
post:
|
||||||
summary: Register a new staff member
|
summary: Register a new staff member
|
||||||
tags:
|
|
||||||
- Staff
|
|
||||||
requestBody:
|
requestBody:
|
||||||
required: true
|
required: true
|
||||||
content:
|
content:
|
||||||
@ -77,51 +50,14 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
"201":
|
"201":
|
||||||
description: Staff member created
|
description: Staff member created
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
data:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
token:
|
|
||||||
type: string
|
|
||||||
description: JWT token for staff authentication
|
|
||||||
"400":
|
"400":
|
||||||
description: Bad request
|
description: Bad request
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
error:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
code:
|
|
||||||
type: string
|
|
||||||
message:
|
|
||||||
type: string
|
|
||||||
"409":
|
"409":
|
||||||
description: Conflict (email already registered)
|
description: Conflict (email already registered)
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
error:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
code:
|
|
||||||
type: string
|
|
||||||
message:
|
|
||||||
type: string
|
|
||||||
|
|
||||||
/user/login:
|
/user/login:
|
||||||
post:
|
post:
|
||||||
summary: Login for user
|
summary: Login for user
|
||||||
tags:
|
|
||||||
- User
|
|
||||||
requestBody:
|
requestBody:
|
||||||
required: true
|
required: true
|
||||||
content:
|
content:
|
||||||
@ -140,37 +76,12 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: Successful login
|
description: Successful login
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
data:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
token:
|
|
||||||
type: string
|
|
||||||
description: JWT token for user authentication
|
|
||||||
"400":
|
"400":
|
||||||
description: Bad request
|
description: Bad request
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
error:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
code:
|
|
||||||
type: string
|
|
||||||
message:
|
|
||||||
type: string
|
|
||||||
|
|
||||||
/user/register:
|
/user/register:
|
||||||
post:
|
post:
|
||||||
summary: Register a new user
|
summary: Register a new user
|
||||||
tags:
|
|
||||||
- User
|
|
||||||
requestBody:
|
requestBody:
|
||||||
required: true
|
required: true
|
||||||
content:
|
content:
|
||||||
@ -196,51 +107,14 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
"201":
|
"201":
|
||||||
description: User created
|
description: User created
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
data:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
token:
|
|
||||||
type: string
|
|
||||||
description: JWT token for user authentication
|
|
||||||
"400":
|
"400":
|
||||||
description: Bad request
|
description: Bad request
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
error:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
code:
|
|
||||||
type: string
|
|
||||||
message:
|
|
||||||
type: string
|
|
||||||
"409":
|
"409":
|
||||||
description: Conflict (email already registered)
|
description: Conflict (email already registered)
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
error:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
code:
|
|
||||||
type: string
|
|
||||||
message:
|
|
||||||
type: string
|
|
||||||
|
|
||||||
/subscribe-plan/create:
|
/subscribe-plan/create:
|
||||||
post:
|
post:
|
||||||
summary: Create a new subscription plan
|
summary: Create a new subscription plan
|
||||||
tags:
|
|
||||||
- Subscribe Plan
|
|
||||||
requestBody:
|
requestBody:
|
||||||
required: true
|
required: true
|
||||||
content:
|
content:
|
||||||
@ -248,91 +122,23 @@ paths:
|
|||||||
schema:
|
schema:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
name:
|
|
||||||
type: string
|
|
||||||
code:
|
code:
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- code
|
- code
|
||||||
- name
|
|
||||||
responses:
|
responses:
|
||||||
"201":
|
"201":
|
||||||
description: Subscription plan created
|
description: Subscription plan created
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
data:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
message:
|
|
||||||
type: string
|
|
||||||
example: "Subscription plan created successfully."
|
|
||||||
"400":
|
"400":
|
||||||
description: Bad request
|
description: Bad request
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
error:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
code:
|
|
||||||
type: string
|
|
||||||
message:
|
|
||||||
type: string
|
|
||||||
"409":
|
"409":
|
||||||
description: Conflict (plan code already exists)
|
description: Conflict (plan code already exists)
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
error:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
code:
|
|
||||||
type: string
|
|
||||||
message:
|
|
||||||
type: string
|
|
||||||
|
|
||||||
/subscribe-plan:
|
/subscribe-plan/get-all:
|
||||||
get:
|
get:
|
||||||
summary: Get all subscription plans
|
summary: Get all subscription plan
|
||||||
tags:
|
|
||||||
- Subscribe Plan
|
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"201":
|
||||||
description: Successfully retrieved all subscription plans
|
description: Subscription plan created
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
data:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
id:
|
|
||||||
type: string
|
|
||||||
code:
|
|
||||||
type: string
|
|
||||||
name:
|
|
||||||
type: string
|
|
||||||
"400":
|
"400":
|
||||||
description: Bad request
|
description: Bad request
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
error:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
code:
|
|
||||||
type: string
|
|
||||||
message:
|
|
||||||
type: string
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user