Commit fcc6e899 authored by 黄奎's avatar 黄奎

页面修改

parent f07a1611
...@@ -25,34 +25,34 @@ namespace Edu.ThirdCore.TenCloud ...@@ -25,34 +25,34 @@ namespace Edu.ThirdCore.TenCloud
/// <returns></returns> /// <returns></returns>
public async Task<(bool result, string message)> SetUserToCCCUser(Employee_ViewModel employee) public async Task<(bool result, string message)> SetUserToCCCUser(Employee_ViewModel employee)
{ {
CreateStaffRequest req = new CreateStaffRequest(); CreateStaffRequest req = new CreateStaffRequest
req.SdkAppId = SDKAPPID; {
SeatUserInfo seatUserInfo1 = new SeatUserInfo(); SdkAppId = SDKAPPID
seatUserInfo1.Name = employee.EmployeeName; };
seatUserInfo1.Mail = employee.Email; SeatUserInfo seatUserInfo1 = new SeatUserInfo
seatUserInfo1.Phone = employee.EmployeeTel; {
seatUserInfo1.Nick = employee.EmployeeName.ToCharArray()[0] + "老师"; Name = employee.EmployeeName,
seatUserInfo1.UserId = employee.Id.ToString(); Mail = employee.Email,
seatUserInfo1.StaffNumber = employee.Id.ToString(); Phone = employee.EmployeeTel,
Nick = employee.EmployeeName.ToCharArray()[0] + "老师",
UserId = employee.Id.ToString(),
StaffNumber = employee.Id.ToString()
};
req.Staffs = new SeatUserInfo[] { seatUserInfo1 }; req.Staffs = new SeatUserInfo[] { seatUserInfo1 };
var credential = TenCloudCredential._instance; var credential = TenCloudCredential._instance;
CreateStaffResponse resp = credential.CreateStaffSync(req); CreateStaffResponse resp = credential.CreateStaffSync(req);
//JObject result = JObject.Parse(AbstractModel.ToJsonString(resp)); if (resp.ErrorStaffList != null && resp.ErrorStaffList.Length > 0)
if (resp.ErrorStaffList!=null && resp.ErrorStaffList.Length>0)
{ {
return (false, resp.ErrorStaffList[0].Message); return (false, resp.ErrorStaffList[0].Message);
} }
else else
{ {
var groupId = QueryDescribeSkillGroup(); var groupId = QueryDescribeSkillGroup();
if (groupId == null) if (groupId == null)
{ {
return (false, "电话客服添加成功,但是关联技能组失败"); return (false, "电话客服添加成功,但是关联技能组失败");
} }
else else
{ {
SetTenUserStaffSkillGroupList(employee.Email, groupId); SetTenUserStaffSkillGroupList(employee.Email, groupId);
} }
...@@ -63,10 +63,12 @@ namespace Edu.ThirdCore.TenCloud ...@@ -63,10 +63,12 @@ namespace Edu.ThirdCore.TenCloud
public void SetTenUserStaffSkillGroupList(string mail, long?[] list) public void SetTenUserStaffSkillGroupList(string mail, long?[] list)
{ {
var credential = TenCloudCredential._instance; var credential = TenCloudCredential._instance;
BindStaffSkillGroupListRequest req = new BindStaffSkillGroupListRequest(); BindStaffSkillGroupListRequest req = new BindStaffSkillGroupListRequest
req.SdkAppId = SDKAPPID; {
req.StaffEmail = mail; SdkAppId = SDKAPPID,
req.SkillGroupList = list; StaffEmail = mail,
SkillGroupList = list
};
BindStaffSkillGroupListResponse resp = credential.BindStaffSkillGroupListSync(req); BindStaffSkillGroupListResponse resp = credential.BindStaffSkillGroupListSync(req);
} }
...@@ -74,19 +76,21 @@ namespace Edu.ThirdCore.TenCloud ...@@ -74,19 +76,21 @@ namespace Edu.ThirdCore.TenCloud
/// 获取技能组数组 /// 获取技能组数组
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public long?[] QueryDescribeSkillGroup() public long?[] QueryDescribeSkillGroup()
{ {
var credential = TenCloudCredential._instance; var credential = TenCloudCredential._instance;
DescribeSkillGroupInfoListRequest req = new DescribeSkillGroupInfoListRequest(); DescribeSkillGroupInfoListRequest req = new DescribeSkillGroupInfoListRequest
req.SdkAppId = SDKAPPID; {
req.PageSize = 1; SdkAppId = SDKAPPID,
req.PageNumber = 100; PageSize = 1,
PageNumber = 100
};
DescribeSkillGroupInfoListResponse resp = credential.DescribeSkillGroupInfoListSync(req); DescribeSkillGroupInfoListResponse resp = credential.DescribeSkillGroupInfoListSync(req);
if (resp.SkillGroupList != null && resp.SkillGroupList.Length > 0) if (resp.SkillGroupList != null && resp.SkillGroupList.Length > 0)
{ {
return resp.SkillGroupList.Select(x => x.SkillGroupId).ToArray(); return resp.SkillGroupList.Select(x => x.SkillGroupId).ToArray();
} }
else else
{ {
return null; return null;
} }
...@@ -100,11 +104,12 @@ namespace Edu.ThirdCore.TenCloud ...@@ -100,11 +104,12 @@ namespace Edu.ThirdCore.TenCloud
public async Task<(bool result, string message)> DelUserToCCCUser(Employee_ViewModel employee) public async Task<(bool result, string message)> DelUserToCCCUser(Employee_ViewModel employee)
{ {
var credential = TenCloudCredential._instance; var credential = TenCloudCredential._instance;
DeleteStaffRequest req = new DeleteStaffRequest(); DeleteStaffRequest req = new DeleteStaffRequest
req.SdkAppId = SDKAPPID; {
req.StaffList = new string[] { employee.Email }; SdkAppId = SDKAPPID,
StaffList = new string[] { employee.Email }
};
DeleteStaffResponse resp = credential.DeleteStaffSync(req); DeleteStaffResponse resp = credential.DeleteStaffSync(req);
return (resp.OnlineStaffList == null, ""); return (resp.OnlineStaffList == null, "");
} }
...@@ -116,14 +121,15 @@ namespace Edu.ThirdCore.TenCloud ...@@ -116,14 +121,15 @@ namespace Edu.ThirdCore.TenCloud
{ {
var credential = TenCloudCredential._instance; var credential = TenCloudCredential._instance;
var tenCccTokenItem = new TenCccTokenItem(); var tenCccTokenItem = new TenCccTokenItem();
CreateSDKLoginTokenRequest req = new CreateSDKLoginTokenRequest(); CreateSDKLoginTokenRequest req = new CreateSDKLoginTokenRequest
req.SdkAppId = SDKAPPID; {
req.SeatUserId = mail; SdkAppId = SDKAPPID,
SeatUserId = mail
};
CreateSDKLoginTokenResponse resp = credential.CreateSDKLoginTokenSync(req); CreateSDKLoginTokenResponse resp = credential.CreateSDKLoginTokenSync(req);
tenCccTokenItem.SdkURL = resp.SdkURL; tenCccTokenItem.SdkURL = resp.SdkURL;
tenCccTokenItem.Token = resp.Token; tenCccTokenItem.Token = resp.Token;
return tenCccTokenItem; return tenCccTokenItem;
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment