Search in sources :

Example 26 with Disc

use of mingzuozhibi.persist.disc.Disc in project mzzb-server by mingzuozhibi.

the class DiscSpiderController method createDisc.

private Disc createDisc(@PathVariable String asin, JSONObject discJson) {
    Disc disc = new Disc(asin, createTitle(discJson), createType(discJson), createDate(discJson));
    dao.save(disc);
    return disc;
}
Also used : Disc(mingzuozhibi.persist.disc.Disc)

Example 27 with Disc

use of mingzuozhibi.persist.disc.Disc in project mzzb-server by mingzuozhibi.

the class DiscUtils method needUpdateAsins.

public static Set<String> needUpdateAsins(Session session) {
    Set<String> asins = new LinkedHashSet<>();
    findActiveDiscGroups(session).forEach(discGroup -> {
        for (Disc disc : discGroup.getDiscs()) {
            asins.add(disc.getAsin());
        }
    });
    return asins;
}
Also used : LinkedHashSet(java.util.LinkedHashSet) Disc(mingzuozhibi.persist.disc.Disc)

Aggregations

Disc (mingzuozhibi.persist.disc.Disc)27 Transactional (org.springframework.transaction.annotation.Transactional)14 JSONObject (org.json.JSONObject)9 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)9 LocalDate (java.time.LocalDate)8 Sakura (mingzuozhibi.persist.disc.Sakura)6 LocalDateTime (java.time.LocalDateTime)4 GetMapping (org.springframework.web.bind.annotation.GetMapping)4 PutMapping (org.springframework.web.bind.annotation.PutMapping)4 LinkedHashSet (java.util.LinkedHashSet)3 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)3 UpdateType (mingzuozhibi.persist.disc.Disc.UpdateType)3 DiscGroup (mingzuozhibi.persist.disc.DiscGroup)3 ViewType (mingzuozhibi.persist.disc.Sakura.ViewType)3 DateTimeFormatter (java.time.format.DateTimeFormatter)2 java.util (java.util)2 AtomicReference (java.util.concurrent.atomic.AtomicReference)2 Collectors (java.util.stream.Collectors)2 Stream (java.util.stream.Stream)2 DiscType (mingzuozhibi.persist.disc.Disc.DiscType)2