refactor: organize service dto contracts

This commit is contained in:
Yvan
2026-08-21 14:00:19 +08:00
parent e81a641953
commit d91f0554fd
65 changed files with 865 additions and 696 deletions
+4 -3
View File
@@ -9,6 +9,7 @@ import (
"kra/internal/biz"
"kra/internal/service"
"kra/internal/service/dto"
"github.com/gin-gonic/gin"
)
@@ -56,7 +57,7 @@ func (h *Version) Find(c *gin.Context) {
OKWithData(c, item)
}
func (h *Version) List(c *gin.Context) {
var req service.VersionSearchRequest
var req dto.VersionSearchRequest
if err := c.ShouldBindQuery(&req); err != nil {
Fail(c, err.Error())
return
@@ -81,7 +82,7 @@ func (h *Version) List(c *gin.Context) {
}
func (h *Version) Export(c *gin.Context) {
var req service.ExportVersionRequest
var req dto.ExportVersionRequest
if err := c.ShouldBindJSON(&req); err != nil {
Fail(c, err.Error())
return
@@ -124,7 +125,7 @@ func (h *Version) Download(c *gin.Context) {
c.Data(http.StatusOK, "application/json", []byte(raw))
}
func (h *Version) Import(c *gin.Context) {
var req service.ImportVersionRequest
var req dto.ImportVersionRequest
if err := c.ShouldBindJSON(&req); err != nil {
Fail(c, "解析JSON数据失败:"+err.Error())
return