Esempio n. 1
0
 public DestroyLogoRequest(PortraitRequest b)
 {
     this.AuthUid = b.AuthUid;
     this.AuthUser = b.AuthUser;
     this.Method = DefineRestfulMethod.Destroy;
     this.Token = b.Token;
     this.Type = b.Type.HasValue ? b.Type.Value : ThumnImageType.Logo;
 }
Esempio n. 2
0
 public DestroyLogoRequest(PortraitRequest b)
 {
     this.AuthUid  = b.AuthUid;
     this.AuthUser = b.AuthUser;
     this.Method   = DefineRestfulMethod.Destroy;
     this.Token    = b.Token;
     this.Type     = b.Type.HasValue ? b.Type.Value : ThumnImageType.Logo;
 }
        public RestfulResult Portrait(PortraitRequest request, int? authuid, UserModel authUser)
        {
            request.AuthUid = authuid.Value;
            request.AuthUser = authUser;

            switch (request.Method.ToLower())
            {
                case DefineRestfulMethod.Create:
                    var r = new UploadLogoRequest(request) { Files = Request.Files };
                    return new RestfulResult { Data = this._customerService.UploadLogo(r) };
                case DefineRestfulMethod.Destroy:
                    var d = new DestroyLogoRequest(request);
                    return new RestfulResult { Data = this._customerService.DestroyLogo(d) };
            }

            return new RestfulResult { Data = new ExecuteResult { StatusCode = StatusCode.ClientError, Message = "参数错误" } };
        }