feat:新增商户列表/保存用户信息

This commit is contained in:
Hiven
2023-08-14 14:40:50 +08:00
parent 9b0a18fcd8
commit 57e635c26c
22 changed files with 665 additions and 7 deletions

View File

@@ -0,0 +1,26 @@
package validate
import (
"encoding/json"
"errors"
)
type MerchantCategory struct {
CategoryId int64 `json:"category_id"`
}
func Validate(module *string, metadata *string) (interface{}, error) {
if *module == "merchant_category" {
var merchantCategory MerchantCategory
err := json.Unmarshal([]byte(*metadata), &merchantCategory)
if err != nil {
return nil, err
} else {
if merchantCategory.CategoryId == 0 {
return nil, errors.New("merchant_category.category_id is required")
}
return merchantCategory, nil
}
}
return nil, nil
}