Commit fcc6e899 authored by 黄奎's avatar 黄奎

页面修改

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