Browse Source

fix:校验错误问题修改

duxin 7 months ago
parent
commit
f4e36f8958
1 changed files with 8 additions and 1 deletions
  1. 8 1
      src/jfw/modules/bigmember/src/service/follow/enterprise.go

+ 8 - 1
src/jfw/modules/bigmember/src/service/follow/enterprise.go

@@ -272,6 +272,14 @@ func (this *FollowEnt) LabelGroup() {
 		}
 		switch request {
 		case "get": //获取列表
+			// 获取剩余数量信息
+			_, surplus := followEntManager.GetFollowEntInfo()
+			if surplus == 0 {
+				return map[string]interface{}{
+					"status":      false,
+					"limit_count": followEntManager.MaxNum,
+				}, errors.New(fmt.Sprintf("您关注的企业已达%d个,无法关注更多", followEntManager.MaxNum))
+			}
 			data := followEntManager.GetLabelGroup()
 			return data, nil
 		case "add": //增加列表
@@ -286,7 +294,6 @@ func (this *FollowEnt) LabelGroup() {
 		default:
 			return nil, errors.New("错误参数")
 		}
-		return nil, errors.New("错误参数")
 	}()
 	if errMsg != nil {
 		log.Printf("%s 关注企业-关注企业标签分组:%s\n", userId, errMsg.Error())