|
|
package command
|
|
|
|
|
|
import (
|
|
|
"fmt"
|
|
|
|
|
|
"github.com/beego/beego/v2/core/validation"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
|
|
|
)
|
|
|
|
...
|
...
|
@@ -13,29 +10,11 @@ type NoticeSettingUpdateCommand struct { |
|
|
// id
|
|
|
NoticeSettingId string `json:"noticeSettingId"`
|
|
|
// 消息对应的业务模块
|
|
|
Module string `json:"module" valid:"Required"`
|
|
|
Module string `json:"module"`
|
|
|
// 业务环节
|
|
|
ModuleAction string `json:"moduleAction" valid:"Required"`
|
|
|
ModuleAction string `json:"moduleAction"`
|
|
|
// 是否推送 【是:1】【否:2】
|
|
|
IsPush int `json:"isPush" valid:"Required"`
|
|
|
IsPush int `json:"isPush"`
|
|
|
// 内容模板
|
|
|
Content string `json:"content" valid:"Required"`
|
|
|
}
|
|
|
|
|
|
func (noticeSettingUpdateQuery *NoticeSettingUpdateCommand) Valid(validation *validation.Validation) {
|
|
|
|
|
|
}
|
|
|
|
|
|
func (noticeSettingUpdateQuery *NoticeSettingUpdateCommand) ValidateCommand() error {
|
|
|
valid := validation.Validation{}
|
|
|
b, err := valid.Valid(noticeSettingUpdateQuery)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
if !b {
|
|
|
for _, validErr := range valid.Errors {
|
|
|
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
|
|
|
}
|
|
|
}
|
|
|
return nil
|
|
|
Content string `json:"content"`
|
|
|
} |
...
|
...
|
|