Skip to content

Commit

Permalink
feat: action 支持不带参数
Browse files Browse the repository at this point in the history
  • Loading branch information
godLei6 committed Sep 13, 2023
1 parent b54c2a0 commit c3e29c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/disvr/internal/domain/deviceMsg/msgThing/req.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ func (d *Req) FmtReqParam(t *schema.Model, tt schema.ParamType) error {

// 校验设备上报的参数合法性
func (d *Req) VerifyReqParam(t *schema.Model, tt schema.ParamType) (map[string]Param, error) {
if len(d.Params) == 0 {
return nil, errors.Parameter.AddDetail("need add params")
}

getParam := make(map[string]Param, len(d.Params))

switch tt {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package productmanagelogic

import (
"context"
"fmt"
"github.com/i-Things/things/src/dmsvr/internal/repo/relationDB"
"path"
"regexp"
Expand Down Expand Up @@ -142,7 +141,7 @@ func (l *ProductInfoCreateLogic) ProductInfoCreate(in *dm.ProductInfo) (*dm.Resp
if in.ProductID != "" {
expr := `[0-9A-Za-z]{11,11}`
match, _ := regexp.MatchString(expr, in.ProductID)
fmt.Println(match)
//fmt.Println(match)
if !match {
return nil, errors.Parameter.WithMsg("产品id格式不对,格式为11位数字和英文字母组成的字符串")
}
Expand Down

0 comments on commit c3e29c8

Please sign in to comment.