|
@@ -46,9 +46,15 @@ func (l *GetWhatsappListLogic) GetWhatsappList(req *types.WhatsappListReq) (*typ
|
|
|
resp.Data.Total = data.PageDetails.Total
|
|
|
|
|
|
for _, v := range data.List {
|
|
|
- departmentInfo, err := l.svcCtx.CoreRpc.GetDepartmentById(l.ctx, &core.IDReq{Id: v.OrganizationID})
|
|
|
- if err != nil {
|
|
|
- l.Error("获取部门信息失败", err)
|
|
|
+ organizationName := ""
|
|
|
+ if v.OrganizationID > 0 {
|
|
|
+ departmentInfo, err := l.svcCtx.CoreRpc.GetDepartmentById(l.ctx, &core.IDReq{Id: v.OrganizationID})
|
|
|
+ if err != nil {
|
|
|
+ l.Error("获取部门信息失败", err)
|
|
|
+ }
|
|
|
+ if departmentInfo != nil {
|
|
|
+ organizationName = *departmentInfo.Name
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
agent := types.AgentInfo{}
|
|
@@ -81,7 +87,7 @@ func (l *GetWhatsappListLogic) GetWhatsappList(req *types.WhatsappListReq) (*typ
|
|
|
PhoneName: &v.PhoneName,
|
|
|
PhoneStatus: &v.PhoneStatus,
|
|
|
OrganizationId: &v.OrganizationID,
|
|
|
- OrganizationName: departmentInfo.Name,
|
|
|
+ OrganizationName: &organizationName,
|
|
|
AgentId: &v.AgentID,
|
|
|
AgentInfo: &agent,
|
|
|
ApiBase: &v.APIBase,
|