- route definition
- Url: /api/v1/admin
- Method: GET
- Request:
AdminsListRequest - Response:
AdminsListResponse
- request definition
type AdminsListRequest struct {
Page int `form:"page,optional,default=1"`
PageSize int `form:"pageSize,optional,default=20"`
Search string `form:"search,optional"`
Role string `form:"role,optional"`
Status int `form:"status,optional"`
}
- response definition
type AdminsListResponse struct {
Items []Admin `json:"items"`
Total int64 `json:"total"`
Page int `json:"page"`
Size int `json:"pageSize"`
}
- route definition
- Url: /api/v1/admin
- Method: POST
- Request:
AdminCreateRequest - Response:
AdminCreateResponse
- request definition
type AdminCreateRequest struct {
Username string `json:"username"`
Password string `json:"password"`
Nickname string `json:"nickname,optional"`
Email string `json:"email,optional"`
Phone string `json:"phone,optional"`
Roles []string `json:"roles"`
}
- response definition
type AdminCreateResponse struct {
Id int64 `json:"id"`
Username string `json:"username"`
Nickname string `json:"nickname"`
Email string `json:"email"`
Phone string `json:"phone"`
Roles []string `json:"roles"`
Status int `json:"status"` // 1:active 0:disabled
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
type Admin struct {
Id int64 `json:"id"`
Username string `json:"username"`
Nickname string `json:"nickname"`
Email string `json:"email"`
Phone string `json:"phone"`
Roles []string `json:"roles"`
Status int `json:"status"` // 1:active 0:disabled
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
- route definition
- Url: /api/v1/admin/:id
- Method: GET
- Request:
AdminDetailRequest - Response:
AdminDetailResponse
- request definition
type AdminDetailRequest struct {
ID string `path:"id"`
}
- response definition
type AdminDetailResponse struct {
Id int64 `json:"id"`
Username string `json:"username"`
Nickname string `json:"nickname"`
Email string `json:"email"`
Phone string `json:"phone"`
Roles []string `json:"roles"`
Status int `json:"status"` // 1:active 0:disabled
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
type Admin struct {
Id int64 `json:"id"`
Username string `json:"username"`
Nickname string `json:"nickname"`
Email string `json:"email"`
Phone string `json:"phone"`
Roles []string `json:"roles"`
Status int `json:"status"` // 1:active 0:disabled
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
- route definition
- Url: /api/v1/admin/:id
- Method: PUT
- Request:
AdminUpdateRequest - Response:
AdminUpdateResponse
- request definition
type AdminUpdateRequest struct {
ID string `path:"id"`
Nickname string `json:"nickname,optional"`
Email string `json:"email,optional"`
Phone string `json:"phone,optional"`
Roles []string `json:"roles,optional"`
Status int `json:"status,optional"`
}
- response definition
type AdminUpdateResponse struct {
Id int64 `json:"id"`
Username string `json:"username"`
Nickname string `json:"nickname"`
Email string `json:"email"`
Phone string `json:"phone"`
Roles []string `json:"roles"`
Status int `json:"status"` // 1:active 0:disabled
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
type Admin struct {
Id int64 `json:"id"`
Username string `json:"username"`
Nickname string `json:"nickname"`
Email string `json:"email"`
Phone string `json:"phone"`
Roles []string `json:"roles"`
Status int `json:"status"` // 1:active 0:disabled
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
- route definition
- Url: /api/v1/admin/:id
- Method: DELETE
- Request:
AdminDeleteRequest - Response:
-
- request definition
type AdminDeleteRequest struct {
ID string `path:"id"`
}
- response definition
- route definition
- Url: /api/v1/admin/:id/password-reset
- Method: POST
- Request:
AdminPasswordResetRequest - Response:
-
- request definition
type AdminPasswordResetRequest struct {
ID string `path:"id"`
NewPassword string `json:"newPassword"`
}
- response definition
- route definition
- Url: /api/v1/permissions
- Method: GET
- Request:
PermissionsListRequest - Response:
PermissionsListResponse
- request definition
type PermissionsListRequest struct {
Page int `form:"page,optional,default=1"`
PageSize int `form:"pageSize,optional,default=20"`
Category string `form:"category,optional"`
Resource string `form:"resource,optional"`
}
- response definition
type PermissionsListResponse struct {
Items []Permission `json:"items"`
Total int64 `json:"total"`
Page int `json:"page"`
Size int `json:"pageSize"`
}
- route definition
- Url: /api/v1/permissions/:id
- Method: GET
- Request:
PermissionDetailRequest - Response:
PermissionDetailResponse
- request definition
type PermissionDetailRequest struct {
ID string `path:"id"`
}
- response definition
type PermissionDetailResponse struct {
Id string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Resource string `json:"resource"`
Action string `json:"action"`
Category string `json:"category"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
type Permission struct {
Id string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Resource string `json:"resource"`
Action string `json:"action"`
Category string `json:"category"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
- route definition
- Url: /api/v1/roles
- Method: GET
- Request:
RolesListRequest - Response:
RolesListResponse
- request definition
type RolesListRequest struct {
Page int `form:"page,optional,default=1"`
PageSize int `form:"pageSize,optional,default=20"`
Category string `form:"category,optional"`
Search string `form:"search,optional"`
}
- response definition
type RolesListResponse struct {
Items []Role `json:"items"`
Total int64 `json:"total"`
Page int `json:"page"`
Size int `json:"pageSize"`
}
- route definition
- Url: /api/v1/roles
- Method: POST
- Request:
RoleCreateRequest - Response:
RoleCreateResponse
- request definition
type RoleCreateRequest struct {
Name string `json:"name"`
Description string `json:"description,optional"`
Category string `json:"category,optional"`
Permissions []string `json:"permissions,optional"`
}
- response definition
type RoleCreateResponse struct {
Id int64 `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Category string `json:"category"`
Permissions []string `json:"permissions"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
type Role struct {
Id int64 `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Category string `json:"category"`
Permissions []string `json:"permissions"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
- route definition
- Url: /api/v1/roles/:id
- Method: GET
- Request:
RoleDetailRequest - Response:
RoleDetailResponse
- request definition
type RoleDetailRequest struct {
ID string `path:"id"`
}
- response definition
type RoleDetailResponse struct {
Id int64 `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Category string `json:"category"`
Permissions []string `json:"permissions"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
type Role struct {
Id int64 `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Category string `json:"category"`
Permissions []string `json:"permissions"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
- route definition
- Url: /api/v1/roles/:id
- Method: PUT
- Request:
RoleUpdateRequest - Response:
RoleUpdateResponse
- request definition
type RoleUpdateRequest struct {
ID string `path:"id"`
Name string `json:"name,optional"`
Description string `json:"description,optional"`
Category string `json:"category,optional"`
Permissions []string `json:"permissions,optional"`
}
- response definition
type RoleUpdateResponse struct {
Id int64 `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Category string `json:"category"`
Permissions []string `json:"permissions"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
type Role struct {
Id int64 `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Category string `json:"category"`
Permissions []string `json:"permissions"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
- route definition
- Url: /api/v1/roles/:id
- Method: DELETE
- Request:
RoleDeleteRequest - Response:
-
- request definition
type RoleDeleteRequest struct {
ID string `path:"id"`
}
- response definition