WH01243 2 лет назад
Родитель
Сommit
b569646481

+ 1 - 1
api/messagecenter/internal/handler/groupnoticeupdatehandler.go

@@ -11,7 +11,7 @@ import (
 
 
 func groupNoticeUpdateHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
 func groupNoticeUpdateHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
 	return func(w http.ResponseWriter, r *http.Request) {
 	return func(w http.ResponseWriter, r *http.Request) {
-		var req types.GroupNameUpdateReq
+		var req types.GroupNoticeUpdateReq
 		if err := httpx.Parse(r, &req); err != nil {
 		if err := httpx.Parse(r, &req); err != nil {
 			httpx.ErrorCtx(r.Context(), w, err)
 			httpx.ErrorCtx(r.Context(), w, err)
 			return
 			return

+ 1 - 0
api/messagecenter/internal/handler/routes.go

@@ -5,6 +5,7 @@ import (
 	"net/http"
 	"net/http"
 
 
 	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/api/messagecenter/internal/svc"
 	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/api/messagecenter/internal/svc"
+
 	"github.com/zeromicro/go-zero/rest"
 	"github.com/zeromicro/go-zero/rest"
 )
 )
 
 

+ 6 - 2
api/messagecenter/internal/logic/groupnameupdatelogic.go

@@ -3,8 +3,11 @@ package logic
 import (
 import (
 	quitl "app.yhyue.com/moapp/jybase/common"
 	quitl "app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/encrypt"
 	"app.yhyue.com/moapp/jybase/encrypt"
+	util "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/entity"
 	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/messagecenter"
 	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/messagecenter"
 	"context"
 	"context"
+	"log"
+	"unicode/utf8"
 
 
 	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/api/messagecenter/internal/svc"
 	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/api/messagecenter/internal/svc"
 	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/api/messagecenter/internal/types"
 	"bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/api/messagecenter/internal/types"
@@ -29,10 +32,11 @@ func NewGroupNameUpdateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *G
 func (l *GroupNameUpdateLogic) GroupNameUpdate(req *types.GroupNameUpdateReq) (resp *types.CommonRes, err error) {
 func (l *GroupNameUpdateLogic) GroupNameUpdate(req *types.GroupNameUpdateReq) (resp *types.CommonRes, err error) {
 	// todo: add your logic here and delete this line
 	// todo: add your logic here and delete this line
 	chatGroupId := quitl.Int64All(encrypt.SE.Decode4Hex(req.ChatGroupId))
 	chatGroupId := quitl.Int64All(encrypt.SE.Decode4Hex(req.ChatGroupId))
-	if len(req.GroupName)>15{
+	log.Println(len(req.GroupName))
+	if utf8.RuneCountInString(req.GroupName) > 15 {
 		return &types.CommonRes{
 		return &types.CommonRes{
 			Error_msg:  "超过15个字,请调整后保存",
 			Error_msg:  "超过15个字,请调整后保存",
-			Error_code: ,
+			Error_code: int(util.ERROR_CODE),
 		}, nil
 		}, nil
 	}
 	}
 	result, err := l.svcCtx.Message.GroupNameUpdate(l.ctx, &messagecenter.GroupNameUpdateReq{
 	result, err := l.svcCtx.Message.GroupNameUpdate(l.ctx, &messagecenter.GroupNameUpdateReq{

+ 1 - 0
api/messagecenter/internal/logic/groupnoticeupdatelogic.go

@@ -32,6 +32,7 @@ func (l *GroupNoticeUpdateLogic) GroupNoticeUpdate(req *types.GroupNoticeUpdateR
 	result, err := l.svcCtx.Message.GroupNoticeUpdate(l.ctx, &messagecenter.GroupNoticeUpdateReq{
 	result, err := l.svcCtx.Message.GroupNoticeUpdate(l.ctx, &messagecenter.GroupNoticeUpdateReq{
 		AppId:         req.Appid,
 		AppId:         req.Appid,
 		GroupNoticeId: groupNoticeId,
 		GroupNoticeId: groupNoticeId,
+		Content:       req.Content,
 	})
 	})
 	if err != nil {
 	if err != nil {
 		return nil, err
 		return nil, err

+ 4 - 5
api/messagecenter/internal/types/types.go

@@ -90,9 +90,9 @@ type ReadStateReq struct {
 
 
 type ChatGroupListReq struct {
 type ChatGroupListReq struct {
 	EntId      int64  `header:"entId,optional"`
 	EntId      int64  `header:"entId,optional"`
-	UserName   string `json:"userName"`
-	GroupName  string `json:"groupName"`
-	PositionId int64  `header:"positionId,optional"`
+	UserName   string `json:"userName,optional"`
+	GroupName  string `json:"groupName,optional"`
+	PositionId int64  `header:"positionId"`
 	Appid      string `header:"appId"`
 	Appid      string `header:"appId"`
 }
 }
 
 
@@ -111,7 +111,7 @@ type ChatGroupPersonReq struct {
 
 
 type ChatGroupJoinReq struct {
 type ChatGroupJoinReq struct {
 	ChatGroupId string   `json:"chatGroupId"`
 	ChatGroupId string   `json:"chatGroupId"`
-	PositionId  int64    `json:"positionId"`
+	PositionId  int64    `header:"positionId"`
 	Appid       string   `header:"appId"`
 	Appid       string   `header:"appId"`
 	UserIdArr   []string `json:"userIdArr"`
 	UserIdArr   []string `json:"userIdArr"`
 }
 }
@@ -149,5 +149,4 @@ type AppraiseMessageReq struct {
 	NewUserId int64  `header:"newUserId"`
 	NewUserId int64  `header:"newUserId"`
 	MessageId string `json:"messageId"`
 	MessageId string `json:"messageId"`
 	Appraise  int64  `json:"appraise,options=-1|1"`
 	Appraise  int64  `json:"appraise,options=-1|1"`
-	Appid         string `header:"appId"`
 }
 }

+ 12 - 12
api/messagecenter/messagecenter.api

@@ -80,9 +80,9 @@ type ReadStateReq {
 }
 }
 type ChatGroupListReq {
 type ChatGroupListReq {
 	EntId      int64  `header:"entId,optional"`
 	EntId      int64  `header:"entId,optional"`
-	UserName   string `json:"userName"`
-	GroupName  string `json:"groupName"`
-	PositionId int64  `header:"positionId,optional"`
+	UserName   string `json:"userName,optional"`
+	GroupName  string `json:"groupName,optional"`
+	PositionId int64  `header:"positionId"`
 	Appid      string `header:"appId"`
 	Appid      string `header:"appId"`
 }
 }
 type ChatGroupAddReq {
 type ChatGroupAddReq {
@@ -98,7 +98,7 @@ type ChatGroupPersonReq {
 }
 }
 type ChatGroupJoinReq {
 type ChatGroupJoinReq {
 	ChatGroupId string   `json:"chatGroupId"`
 	ChatGroupId string   `json:"chatGroupId"`
-	PositionId  int64    `json:"positionId"`
+	PositionId  int64    `header:"positionId"`
 	Appid       string   `header:"appId"`
 	Appid       string   `header:"appId"`
 	UserIdArr   []string `json:"userIdArr"`
 	UserIdArr   []string `json:"userIdArr"`
 }
 }
@@ -152,21 +152,21 @@ service messagecenter-api {
 	post /message/obtainShunt (ShuntReq) returns (CommonRes);
 	post /message/obtainShunt (ShuntReq) returns (CommonRes);
 	@handler updateReadById
 	@handler updateReadById
 	post /message/updateReadById (ReadStateReq) returns (CommonRes);
 	post /message/updateReadById (ReadStateReq) returns (CommonRes);
-	@handler chatGroupList
+	@handler chatGroupList  //群组列表
 	post /message/chatGroupList (ChatGroupListReq) returns (CommonRes);
 	post /message/chatGroupList (ChatGroupListReq) returns (CommonRes);
-	@handler chatGroupAdd
+	@handler chatGroupAdd  //群组新增
 	post /message/chatGroupAdd (ChatGroupAddReq) returns (CommonRes);
 	post /message/chatGroupAdd (ChatGroupAddReq) returns (CommonRes);
-	@handler chatGroupPerson
+	@handler chatGroupPerson  //群组成员
 	post /message/chatGroupPerson (ChatGroupPersonReq) returns (CommonRes);
 	post /message/chatGroupPerson (ChatGroupPersonReq) returns (CommonRes);
-	@handler chatGroupJoin
+	@handler chatGroupJoin    //拉人入群
 	post /message/chatGroupJoin (ChatGroupJoinReq) returns (CommonRes);
 	post /message/chatGroupJoin (ChatGroupJoinReq) returns (CommonRes);
-	@handler groupNameUpdate
+	@handler groupNameUpdate  //群组名称修改
 	post /message/groupNameUpdate (GroupNameUpdateReq) returns (CommonRes);
 	post /message/groupNameUpdate (GroupNameUpdateReq) returns (CommonRes);
-	@handler groupNoticeAdd
+	@handler groupNoticeAdd	  //群任务发布
 	post /message/groupNoticeAdd (GroupNoticeAddReq) returns (CommonRes);
 	post /message/groupNoticeAdd (GroupNoticeAddReq) returns (CommonRes);
-	@handler groupNoticeUpdate
+	@handler groupNoticeUpdate  //群任务修改
 	post /message/groupNoticeUpdate (GroupNoticeUpdateReq) returns (CommonRes);
 	post /message/groupNoticeUpdate (GroupNoticeUpdateReq) returns (CommonRes);
-	@handler groupNoticeGet
+	@handler groupNoticeGet		//群任务获取
 	post /message/groupNoticeGet (ChatGroupPersonReq) returns (CommonRes);
 	post /message/groupNoticeGet (ChatGroupPersonReq) returns (CommonRes);
 	@handler withdrawMessage //撤回消息
 	@handler withdrawMessage //撤回消息
 	post /message/withdrawMessage (ReadWithdrawReq) returns (CommonRes);
 	post /message/withdrawMessage (ReadWithdrawReq) returns (CommonRes);

+ 0 - 1
rpc/messagecenter/internal/logic/groupnameupdatelogic.go

@@ -30,6 +30,5 @@ func (l *GroupNameUpdateLogic) GroupNameUpdate(in *messagecenter.GroupNameUpdate
 	return &messagecenter.CommonReq{
 	return &messagecenter.CommonReq{
 		ErrorCode: 0,
 		ErrorCode: 0,
 		Status:    status,
 		Status:    status,
-		ErrorMsg:  msg,
 	}, nil
 	}, nil
 }
 }