use of com.pratilipi.api.annotation.Post in project pratilipi by Pratilipi.
the class PratilipiCoverApi method post.
@Post
public PostResponse post(PostRequest request) throws InvalidArgumentException, InsufficientAccessException, UnexpectedServerException {
BlobEntry blobEntry = DataAccessorFactory.getBlobAccessor().newBlob(request.getName());
blobEntry.setData(request.getData());
blobEntry.setMimeType(request.getMimeType());
blobEntry.setMetaName(request.getName());
String coverImageUrl = PratilipiDataUtil.savePratilipiCover(request.pratilipiId, blobEntry);
return new PostResponse(coverImageUrl);
}
use of com.pratilipi.api.annotation.Post in project pratilipi by Pratilipi.
the class AuthorApi method post.
@Post
public Response post(PostRequest request) throws InvalidArgumentException, InsufficientAccessException, UnexpectedServerException {
Gson gson = new Gson();
AuthorData authorData = gson.fromJson(gson.toJson(request), AuthorData.class);
if (// New authors (added by AEEs) are ACTIVE by default
request.getId() == null)
authorData.setState(AuthorState.ACTIVE);
authorData = AuthorDataUtil.saveAuthorData(authorData);
Task task = TaskQueueFactory.newTask().setUrl("/author/process").addParam("authorId", authorData.getId().toString()).addParam("processData", "true");
TaskQueueFactory.getAuthorTaskQueue().add(task);
return new Response(authorData);
}
use of com.pratilipi.api.annotation.Post in project pratilipi by Pratilipi.
the class BlogPostApi method post.
@Post
public Response post(PostRequest request) throws InvalidArgumentException, InsufficientAccessException {
BlogPostData blogPostData = new BlogPostData(request.blogPostId);
blogPostData.setBlogId(request.blogId);
blogPostData.setTitle(request.title);
blogPostData.setTitleEn(request.titleEn);
blogPostData.setContent(request.content);
blogPostData.setLanguage(UxModeFilter.getFilterLanguage());
blogPostData.setState(request.state);
blogPostData = BlogPostDataUtil.saveBlogPostData(blogPostData);
return new Response(blogPostData);
}
use of com.pratilipi.api.annotation.Post in project pratilipi by Pratilipi.
the class EventApi method post.
@Post
public Response post(PostRequest request) throws InvalidArgumentException, InsufficientAccessException {
Gson gson = new Gson();
EventData eventData = gson.fromJson(gson.toJson(request), EventData.class);
eventData = EventDataUtil.saveEventData(eventData);
return new Response(eventData);
}
use of com.pratilipi.api.annotation.Post in project pratilipi by Pratilipi.
the class EventBannerApi method post.
@Post
public GenericResponse post(PostRequest request) throws InsufficientAccessException, UnexpectedServerException {
BlobEntry blobEntry = DataAccessorFactory.getBlobAccessor().newBlob(request.getName());
blobEntry.setData(request.getData());
blobEntry.setMimeType(request.getMimeType());
EventDataUtil.saveEventBanner(request.eventId, blobEntry);
return new GenericResponse();
}
Aggregations