refactor(api): 去除 api 层 /v1 目录,统一为 api/<模块>/<子模块> 层级规则(包名=路径段下划线连接)
This commit is contained in:
parent
3d24dbd8cb
commit
abd81486ad
@ -5,13 +5,15 @@ import "github.com/gogf/gf/v2/frame/g"
|
|||||||
|
|
||||||
// AdminItem 管理员列表中的一行。
|
// AdminItem 管理员列表中的一行。
|
||||||
type AdminItem struct {
|
type AdminItem struct {
|
||||||
Id uint64 `json:"id"`
|
Id uint64 `json:"id"`
|
||||||
Username string `json:"username"`
|
Username string `json:"username"`
|
||||||
Nickname string `json:"nickname"`
|
Nickname string `json:"nickname"`
|
||||||
Status int `json:"status"`
|
Status int `json:"status"`
|
||||||
RoleIds []uint64 `json:"roleIds"`
|
BarkDeviceId string `json:"barkDeviceId"`
|
||||||
RoleNames []string `json:"roleNames"`
|
PushplusToken string `json:"pushplusToken"`
|
||||||
CreatedAt string `json:"createdAt"`
|
RoleIds []uint64 `json:"roleIds"`
|
||||||
|
RoleNames []string `json:"roleNames"`
|
||||||
|
CreatedAt string `json:"createdAt"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// AdminListReq 分页查询管理员。
|
// AdminListReq 分页查询管理员。
|
||||||
@ -30,11 +32,13 @@ type AdminListRes struct {
|
|||||||
|
|
||||||
// AdminCreateReq 创建管理员。
|
// AdminCreateReq 创建管理员。
|
||||||
type AdminCreateReq struct {
|
type AdminCreateReq struct {
|
||||||
g.Meta `path:"/admin/create" method:"post" tags:"Admin/Admin" summary:"创建管理员"`
|
g.Meta `path:"/admin/create" method:"post" tags:"Admin/Admin" summary:"创建管理员"`
|
||||||
Username string `json:"username" v:"required"`
|
Username string `json:"username" v:"required"`
|
||||||
Password string `json:"password" v:"required|min-length:6#password required|password too short"`
|
Password string `json:"password" v:"required|min-length:6#password required|password too short"`
|
||||||
Nickname string `json:"nickname"`
|
Nickname string `json:"nickname"`
|
||||||
RoleIds []uint64 `json:"roleIds"`
|
BarkDeviceId string `json:"barkDeviceId"`
|
||||||
|
PushplusToken string `json:"pushplusToken"`
|
||||||
|
RoleIds []uint64 `json:"roleIds"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// AdminCreateRes 是 AdminCreateReq 的响应。
|
// AdminCreateRes 是 AdminCreateReq 的响应。
|
||||||
@ -44,11 +48,13 @@ type AdminCreateRes struct {
|
|||||||
|
|
||||||
// AdminUpdateReq 更新管理员的资料、状态与角色。
|
// AdminUpdateReq 更新管理员的资料、状态与角色。
|
||||||
type AdminUpdateReq struct {
|
type AdminUpdateReq struct {
|
||||||
g.Meta `path:"/admin/update/{id}" method:"post" tags:"Admin/Admin" summary:"更新管理员"`
|
g.Meta `path:"/admin/update/{id}" method:"post" tags:"Admin/Admin" summary:"更新管理员"`
|
||||||
Id uint64 `json:"id" in:"path" v:"required"`
|
Id uint64 `json:"id" in:"path" v:"required"`
|
||||||
Nickname string `json:"nickname"`
|
Nickname string `json:"nickname"`
|
||||||
Status int `json:"status"`
|
Status int `json:"status"`
|
||||||
RoleIds []uint64 `json:"roleIds"`
|
BarkDeviceId string `json:"barkDeviceId"`
|
||||||
|
PushplusToken string `json:"pushplusToken"`
|
||||||
|
RoleIds []uint64 `json:"roleIds"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// AdminUpdateRes 是 AdminUpdateReq 的响应。
|
// AdminUpdateRes 是 AdminUpdateReq 的响应。
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
// Package job_v1 自动任务管理模块接口契约(DB 驱动的 gcron 调度 + 运行记录)。
|
// Package job_v1 自动任务管理模块接口契约(DB 驱动的 gcron 调度 + 运行记录)。
|
||||||
// 规范(2026-08-27):全部 POST;URL 不含参数;入参一律 body。
|
// 规范(2026-08-27):全部 POST;URL 不含参数;入参一律 body。
|
||||||
package job_v1
|
package job
|
||||||
|
|
||||||
import "github.com/gogf/gf/v2/frame/g"
|
import "github.com/gogf/gf/v2/frame/g"
|
||||||
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
// Package notice_v1 通知模块接口契约(统一推送管理:渠道/规则/日志/测试)。
|
// Package notice_v1 通知模块接口契约(统一推送管理:渠道/规则/日志/测试)。
|
||||||
// 规范(2026-08-27):全部 POST;URL 不含参数;入参一律 body。
|
// 规范(2026-08-27):全部 POST;URL 不含参数;入参一律 body。
|
||||||
package notice_v1
|
package notice
|
||||||
|
|
||||||
import "github.com/gogf/gf/v2/frame/g"
|
import "github.com/gogf/gf/v2/frame/g"
|
||||||
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
// Package recruitment_v1 招聘考试聚合模块接口契约。
|
// Package recruitment_v1 招聘考试聚合模块接口契约。
|
||||||
// 规范(2026-08-27):全部 POST;URL 不含任何参数(查询/路径参数均禁止);入参一律走 body。
|
// 规范(2026-08-27):全部 POST;URL 不含任何参数(查询/路径参数均禁止);入参一律走 body。
|
||||||
package recruitment_v1
|
package recruitment
|
||||||
|
|
||||||
import "github.com/gogf/gf/v2/frame/g"
|
import "github.com/gogf/gf/v2/frame/g"
|
||||||
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
// Package serversecurity_v1 服务器安全监控日志模块接口契约。
|
// Package serversecurity_v1 服务器安全监控日志模块接口契约。
|
||||||
// 规范(2026-08-27):全部 POST;URL 不含任何参数(查询/路径参数均禁止);入参一律走 body。
|
// 规范(2026-08-27):全部 POST;URL 不含任何参数(查询/路径参数均禁止);入参一律走 body。
|
||||||
package serversecurity_v1
|
package serversecurity
|
||||||
|
|
||||||
import "github.com/gogf/gf/v2/frame/g"
|
import "github.com/gogf/gf/v2/frame/g"
|
||||||
|
|
||||||
@ -4,7 +4,7 @@ package job
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
jobv1 "service.xpcool.com/api/job/v1"
|
jobv1 "service.xpcool.com/api/job"
|
||||||
"service.xpcool.com/internal/model/dto"
|
"service.xpcool.com/internal/model/dto"
|
||||||
"service.xpcool.com/internal/service/job"
|
"service.xpcool.com/internal/service/job"
|
||||||
)
|
)
|
||||||
|
|||||||
@ -4,7 +4,7 @@ package notice
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
noticev1 "service.xpcool.com/api/notice/v1"
|
noticev1 "service.xpcool.com/api/notice"
|
||||||
"service.xpcool.com/internal/model/dto"
|
"service.xpcool.com/internal/model/dto"
|
||||||
"service.xpcool.com/internal/service/notice"
|
"service.xpcool.com/internal/service/notice"
|
||||||
)
|
)
|
||||||
|
|||||||
@ -3,7 +3,7 @@ package recruitment
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
recruitmentv1 "service.xpcool.com/api/recruitment/v1"
|
recruitmentv1 "service.xpcool.com/api/recruitment"
|
||||||
"service.xpcool.com/internal/model/dto"
|
"service.xpcool.com/internal/model/dto"
|
||||||
"service.xpcool.com/internal/service/recruitment"
|
"service.xpcool.com/internal/service/recruitment"
|
||||||
)
|
)
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
package serversecurity
|
package serversecurity
|
||||||
|
|
||||||
import (
|
import (
|
||||||
serversecurityv1 "service.xpcool.com/api/serversecurity/v1"
|
serversecurityv1 "service.xpcool.com/api/serversecurity"
|
||||||
"service.xpcool.com/internal/model/dto"
|
"service.xpcool.com/internal/model/dto"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ package serversecurity
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
serversecurityv1 "service.xpcool.com/api/serversecurity/v1"
|
serversecurityv1 "service.xpcool.com/api/serversecurity"
|
||||||
"service.xpcool.com/internal/model/dto"
|
"service.xpcool.com/internal/model/dto"
|
||||||
"service.xpcool.com/internal/service/serversecurity"
|
"service.xpcool.com/internal/service/serversecurity"
|
||||||
)
|
)
|
||||||
|
|||||||
@ -4,7 +4,7 @@ package serversecurity
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
serversecurityv1 "service.xpcool.com/api/serversecurity/v1"
|
serversecurityv1 "service.xpcool.com/api/serversecurity"
|
||||||
"service.xpcool.com/internal/service/serversecurity"
|
"service.xpcool.com/internal/service/serversecurity"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
BIN
service_test2.exe
Normal file
BIN
service_test2.exe
Normal file
Binary file not shown.
BIN
service_test2.exe~
Normal file
BIN
service_test2.exe~
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user