use json encoding for route body parameters, implement modify user/group/pool operations, simplify schema by using comon lib struct tags and RequireAll and AtLeastOne helper functions, properly implement locadb as Backend interface
This commit is contained in:
+2
-16
@@ -1,21 +1,7 @@
|
||||
package app
|
||||
|
||||
type Login struct { // login body struct
|
||||
UsernameRaw string `form:"username" binding:"required"`
|
||||
UsernameRaw string `json:"username" binding:"required"`
|
||||
Username Username
|
||||
Password string `form:"password" binding:"required"`
|
||||
}
|
||||
|
||||
type UserFormRequired struct { // add user body struct
|
||||
CN string `form:"cn" binding:"required"`
|
||||
SN string `form:"sn" binding:"required"`
|
||||
Mail string `form:"mail" binding:"required"`
|
||||
Password string `form:"password" binding:"required"`
|
||||
}
|
||||
|
||||
type UserFormOptional struct { // modify user body struct
|
||||
CN string `form:"cn"`
|
||||
SN string `form:"sn"`
|
||||
Mail string `form:"mail"`
|
||||
Password string `form:"password"`
|
||||
Password string `json:"password" binding:"required"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user