mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
added mailing class
This commit is contained in:
@@ -6,9 +6,9 @@ import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
import com.commafeed.backend.dao.ApplicationSettingsDAO;
|
||||
import com.commafeed.backend.model.ApplicationSettings;
|
||||
import com.commafeed.backend.model.UserRole.Role;
|
||||
import com.commafeed.backend.services.ApplicationSettingsService;
|
||||
import com.commafeed.frontend.SecurityCheck;
|
||||
|
||||
@SecurityCheck(Role.ADMIN)
|
||||
@@ -16,18 +16,18 @@ import com.commafeed.frontend.SecurityCheck;
|
||||
public class AdminSettingsREST {
|
||||
|
||||
@Inject
|
||||
ApplicationSettingsDAO applicationSettingsDAO;
|
||||
ApplicationSettingsService applicationSettingsService;
|
||||
|
||||
@Path("get")
|
||||
@GET
|
||||
public ApplicationSettings get() {
|
||||
return applicationSettingsDAO.get();
|
||||
return applicationSettingsService.get();
|
||||
}
|
||||
|
||||
@Path("save")
|
||||
@POST
|
||||
public Response save(ApplicationSettings settings) {
|
||||
applicationSettingsDAO.save(settings);
|
||||
applicationSettingsService.save(settings);
|
||||
return Response.ok().build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,15 +74,15 @@ public class EntriesREST extends AbstractREST {
|
||||
if (ALL.equals(id)) {
|
||||
entries.setName("All");
|
||||
List<FeedEntryStatus> unreadEntries = feedEntryStatusDAO
|
||||
.findAll(getUser(), unreadOnly, offset, limit,
|
||||
order, true);
|
||||
.findAll(getUser(), unreadOnly, offset, limit, order,
|
||||
true);
|
||||
for (FeedEntryStatus status : unreadEntries) {
|
||||
entries.getEntries().add(buildEntry(status));
|
||||
}
|
||||
|
||||
} else {
|
||||
FeedCategory feedCategory = feedCategoryDAO.findById(
|
||||
getUser(), Long.valueOf(id));
|
||||
FeedCategory feedCategory = feedCategoryDAO.findById(getUser(),
|
||||
Long.valueOf(id));
|
||||
if (feedCategory != null) {
|
||||
List<FeedCategory> childrenCategories = feedCategoryDAO
|
||||
.findAllChildrenCategories(getUser(), feedCategory);
|
||||
@@ -142,8 +142,8 @@ public class EntriesREST extends AbstractREST {
|
||||
feedEntryStatusDAO.update(status);
|
||||
} else if (type == Type.feed) {
|
||||
if (read) {
|
||||
FeedSubscription subscription = feedSubscriptionDAO
|
||||
.findById(getUser(), Long.valueOf(id));
|
||||
FeedSubscription subscription = feedSubscriptionDAO.findById(
|
||||
getUser(), Long.valueOf(id));
|
||||
feedEntryStatusDAO.markFeedEntries(getUser(),
|
||||
subscription.getFeed(), olderThan);
|
||||
} else {
|
||||
@@ -156,7 +156,8 @@ public class EntriesREST extends AbstractREST {
|
||||
feedEntryStatusDAO.markAllEntries(getUser(), olderThan);
|
||||
} else {
|
||||
List<FeedCategory> categories = feedCategoryDAO
|
||||
.findAllChildrenCategories(getUser(),
|
||||
.findAllChildrenCategories(
|
||||
getUser(),
|
||||
feedCategoryDAO.findById(getUser(),
|
||||
Long.valueOf(id)));
|
||||
feedEntryStatusDAO.markCategoryEntries(getUser(),
|
||||
|
||||
Reference in New Issue
Block a user