feat:完善项目

This commit is contained in:
henry
2022-01-17 09:57:57 +08:00
parent 6d075dab4f
commit b50fdb0d44
30 changed files with 70 additions and 84 deletions

View File

@ -23,10 +23,10 @@ func (a *Config) Index(c *gin.Context) {
func (a *Config) Add(c *gin.Context) {
form := &struct {
Kind int `json:"kind" form:"kind" binding:"required"`
Name string `json:"name" form:"name" binding:"required"`
Key string `json:"key" form:"key" binding:"required"`
Value interface{} `json:"value" form:"value" binding:"required"`
Kind int `json:"kind" form:"kind" binding:"required"`
Name string `json:"name" form:"name" binding:"required"`
Key string `json:"key" form:"key" binding:"required"`
Value string `json:"value" form:"value" binding:"required"`
}{}
if err := api.Bind(form)(c); err != nil {
api.APIFailure(err.(error))(c)
@ -39,8 +39,8 @@ func (a *Config) Add(c *gin.Context) {
func (a *Config) Edit(c *gin.Context) {
form := &struct {
api.IDStringForm
Name string `json:"name" form:"name" binding:"required"`
Value interface{} `json:"value" form:"value" binding:"required"`
Name string `json:"name" form:"name" binding:"required"`
Value string `json:"value" form:"value" binding:"required"`
}{}
if err := api.Bind(form)(c); err != nil {
api.APIFailure(err.(error))(c)