コード例 #1
0
        public FaceResult FaceDelete(string userId, string groupId)
        {
            var url = $"/rest/2.0/face/v2/faceset/user/delete";

            FaceResult result = TryApiWithAccessToken <FaceResult>(url, new Dictionary <string, object>
            {
                { _paramUserId, userId },
                { _paramGroupId, groupId }
            });

            return(result);
        }
コード例 #2
0
        private FaceResult FaceAddOrUpdate(UserFaceRegister userInfo, bool isAdd)
        {
            var url = $"/rest/2.0/face/v2/faceset/user/{(isAdd ? "add" : "update")}";

            if (string.IsNullOrEmpty(userInfo.Image))
            {
                return(new FaceResult
                {
                    error_code = "-1",
                    error_msg = "无图片信息"
                });
            }

            userInfo.ImageBase64 = ToBase64(userInfo.Image);

            if (!isAdd)
            {
                userInfo.ActionType = ActionType.Replace;
            }

            FaceResult result = TryApiWithAccessToken <FaceResult>(url, userInfo.ToRequestParameter());

            return(result);
        }