refactor: organize service dto contracts
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user