Răsfoiți Sursa

Resolved merge conflicts

boweniac 7 luni în urmă
părinte
comite
0ea651509a

+ 3 - 0
desc/wechat/message_records.api

@@ -68,6 +68,9 @@ type (
     MessageRecordsListReq {
         PageInfo
 
+		// 群发消息ID
+		BatchMsgId *uint64 `json:"batchMsgId,optional"`
+
         // 机器人微信 id 
         BotWxid  *string `json:"botWxid,optional"`
 

+ 2 - 2
internal/logic/employee/get_employee_by_id_logic.go

@@ -36,7 +36,7 @@ func (l *GetEmployeeByIdLogic) GetEmployeeById(req *types.IDReq) (*types.Employe
 		return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
 	}
 
-	workExperience := make([]types.WorkExperienceInfo, 0)
+	workExperience := make([]types.WorkExperienceInfo, 0, len(data.Edges.EmWorkExperiences))
 	for _, work := range data.Edges.EmWorkExperiences {
 		workExperience = append(workExperience, types.WorkExperienceInfo{
 			BaseIDInfo: types.BaseIDInfo{
@@ -54,7 +54,7 @@ func (l *GetEmployeeByIdLogic) GetEmployeeById(req *types.IDReq) (*types.Employe
 		})
 	}
 
-	tutorial := make([]types.TutorialInfo, 0)
+	tutorial := make([]types.TutorialInfo, 0, len(data.Edges.EmTutorial))
 	for _, tt := range data.Edges.EmTutorial {
 		tutorial = append(tutorial, types.TutorialInfo{
 			BaseIDInfo: types.BaseIDInfo{

+ 2 - 2
internal/logic/employee/get_employee_list_logic.go

@@ -52,7 +52,7 @@ func (l *GetEmployeeListLogic) GetEmployeeList(req *types.EmployeeListReq) (*typ
 	resp.Data.Total = data.PageDetails.Total
 
 	for _, v := range data.List {
-		workExperience := make([]types.WorkExperienceInfo, 0)
+		workExperience := make([]types.WorkExperienceInfo, 0, len(v.Edges.EmWorkExperiences))
 		for _, work := range v.Edges.EmWorkExperiences {
 			workExperience = append(workExperience, types.WorkExperienceInfo{
 				BaseIDInfo: types.BaseIDInfo{
@@ -70,7 +70,7 @@ func (l *GetEmployeeListLogic) GetEmployeeList(req *types.EmployeeListReq) (*typ
 			})
 		}
 
-		tutorial := make([]types.TutorialInfo, 0)
+		tutorial := make([]types.TutorialInfo, 0, len(v.Edges.EmTutorial))
 		for _, tt := range v.Edges.EmTutorial {
 			tutorial = append(tutorial, types.TutorialInfo{
 				BaseIDInfo: types.BaseIDInfo{

+ 4 - 0
internal/logic/message_records/get_message_records_list_logic.go

@@ -31,7 +31,11 @@ func NewGetMessageRecordsListLogic(ctx context.Context, svcCtx *svc.ServiceConte
 func (l *GetMessageRecordsListLogic) GetMessageRecordsList(req *types.MessageRecordsListReq) (*types.MessageRecordsListResp, error) {
 	organizationId := l.ctx.Value("organizationId").(uint64)
 	var predicates []predicate.MessageRecords
+	// 按机构ID搜
 	predicates = append(predicates, messagerecords.OrganizationIDEQ(organizationId))
+	// 按群发ID搜
+	predicates = append(predicates, messagerecords.SourceIDEQ(*req.BatchMsgId))
+
 	if req.BotWxid != nil {
 		predicates = append(predicates, messagerecords.BotWxidContains(*req.BotWxid))
 	}

+ 2 - 0
internal/types/types.go

@@ -1060,6 +1060,8 @@ type MessageRecordsListInfo struct {
 // swagger:model MessageRecordsListReq
 type MessageRecordsListReq struct {
 	PageInfo
+	// 群发消息ID
+	BatchMsgId *uint64 `json:"batchMsgId,optional"`
 	// 机器人微信 id
 	BotWxid *string `json:"botWxid,optional"`
 	// 接收方微信 id