refactor(api): 去除 api 层 /v1 目录,统一为 api/<模块>/<子模块> 层级规则(包名=路径段下划线连接)

This commit is contained in:
夏犀麟 2026-08-27 23:20:32 +08:00
parent 3d24dbd8cb
commit abd81486ad
13 changed files with 33 additions and 27 deletions

View File

@ -9,6 +9,8 @@ type AdminItem struct {
Username string `json:"username"` Username string `json:"username"`
Nickname string `json:"nickname"` Nickname string `json:"nickname"`
Status int `json:"status"` Status int `json:"status"`
BarkDeviceId string `json:"barkDeviceId"`
PushplusToken string `json:"pushplusToken"`
RoleIds []uint64 `json:"roleIds"` RoleIds []uint64 `json:"roleIds"`
RoleNames []string `json:"roleNames"` RoleNames []string `json:"roleNames"`
CreatedAt string `json:"createdAt"` CreatedAt string `json:"createdAt"`
@ -34,6 +36,8 @@ type AdminCreateReq struct {
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"`
BarkDeviceId string `json:"barkDeviceId"`
PushplusToken string `json:"pushplusToken"`
RoleIds []uint64 `json:"roleIds"` RoleIds []uint64 `json:"roleIds"`
} }
@ -48,6 +52,8 @@ type AdminUpdateReq struct {
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"`
BarkDeviceId string `json:"barkDeviceId"`
PushplusToken string `json:"pushplusToken"`
RoleIds []uint64 `json:"roleIds"` RoleIds []uint64 `json:"roleIds"`
} }

View File

@ -1,6 +1,6 @@
// Package job_v1 自动任务管理模块接口契约DB 驱动的 gcron 调度 + 运行记录)。 // Package job_v1 自动任务管理模块接口契约DB 驱动的 gcron 调度 + 运行记录)。
// 规范2026-08-27全部 POSTURL 不含参数;入参一律 body。 // 规范2026-08-27全部 POSTURL 不含参数;入参一律 body。
package job_v1 package job
import "github.com/gogf/gf/v2/frame/g" import "github.com/gogf/gf/v2/frame/g"

View File

@ -1,6 +1,6 @@
// Package notice_v1 通知模块接口契约(统一推送管理:渠道/规则/日志/测试)。 // Package notice_v1 通知模块接口契约(统一推送管理:渠道/规则/日志/测试)。
// 规范2026-08-27全部 POSTURL 不含参数;入参一律 body。 // 规范2026-08-27全部 POSTURL 不含参数;入参一律 body。
package notice_v1 package notice
import "github.com/gogf/gf/v2/frame/g" import "github.com/gogf/gf/v2/frame/g"

View File

@ -1,6 +1,6 @@
// Package recruitment_v1 招聘考试聚合模块接口契约。 // Package recruitment_v1 招聘考试聚合模块接口契约。
// 规范2026-08-27全部 POSTURL 不含任何参数(查询/路径参数均禁止);入参一律走 body。 // 规范2026-08-27全部 POSTURL 不含任何参数(查询/路径参数均禁止);入参一律走 body。
package recruitment_v1 package recruitment
import "github.com/gogf/gf/v2/frame/g" import "github.com/gogf/gf/v2/frame/g"

View File

@ -1,6 +1,6 @@
// Package serversecurity_v1 服务器安全监控日志模块接口契约。 // Package serversecurity_v1 服务器安全监控日志模块接口契约。
// 规范2026-08-27全部 POSTURL 不含任何参数(查询/路径参数均禁止);入参一律走 body。 // 规范2026-08-27全部 POSTURL 不含任何参数(查询/路径参数均禁止);入参一律走 body。
package serversecurity_v1 package serversecurity
import "github.com/gogf/gf/v2/frame/g" import "github.com/gogf/gf/v2/frame/g"

View File

@ -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"
) )

View File

@ -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"
) )

View File

@ -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"
) )

View File

@ -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"
) )

View File

@ -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"
) )

View File

@ -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

Binary file not shown.

BIN
service_test2.exe~ Normal file

Binary file not shown.