mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-03 16:00:25 +08:00
refactor: validator调整
This commit is contained in:
8
server/internal/common/router/router.go
Normal file
8
server/internal/common/router/router.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package router
|
||||
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
func Init(router *gin.RouterGroup) {
|
||||
InitCommonRouter(router)
|
||||
InitIndexRouter(router)
|
||||
}
|
||||
@@ -104,6 +104,7 @@ func (m *MachineFile) GetDirEntry(rc *req.Ctx) {
|
||||
g := rc.GinCtx
|
||||
fid := GetMachineFileId(g)
|
||||
readPath := g.Query("path")
|
||||
rc.ReqParam = fmt.Sprintf("path: %s", readPath)
|
||||
|
||||
if !strings.HasSuffix(readPath, "/") {
|
||||
readPath = readPath + "/"
|
||||
@@ -120,7 +121,6 @@ func (m *MachineFile) GetDirEntry(rc *req.Ctx) {
|
||||
}
|
||||
sort.Sort(vo.MachineFileInfos(fisVO))
|
||||
rc.ResData = fisVO
|
||||
rc.ReqParam = fmt.Sprintf("path: %s", readPath)
|
||||
}
|
||||
|
||||
func (m *MachineFile) GetDirSize(rc *req.Ctx) {
|
||||
|
||||
@@ -2,7 +2,7 @@ package form
|
||||
|
||||
type AccountCreateForm struct {
|
||||
Id uint64 `json:"id"`
|
||||
Name string `json:"name" binding:"required,max=16"`
|
||||
Name string `json:"name" binding:"required,max=16" msg:"required=姓名不能为空,max=姓名最大长度不能超过16位"`
|
||||
Username string `json:"username" binding:"pattern=account_username"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user