4
4
import lombok .RequiredArgsConstructor ;
5
5
import no .nav .dolly .domain .resultset .entity .bestilling .RsMalBestilling ;
6
6
import no .nav .dolly .domain .resultset .entity .bestilling .RsMalBestillingSimple ;
7
+ import no .nav .dolly .domain .resultset .entity .bestilling .RsMalBestillingUtenFavoritter ;
7
8
import no .nav .dolly .domain .resultset .entity .bestilling .RsMalBestillingWrapper ;
8
9
import no .nav .dolly .service .MalBestillingService ;
9
10
import org .springframework .cache .annotation .CacheEvict ;
18
19
import org .springframework .web .bind .annotation .RequestParam ;
19
20
import org .springframework .web .bind .annotation .RestController ;
20
21
22
+ import java .util .List ;
23
+
21
24
import static no .nav .dolly .config .CachingConfig .CACHE_BESTILLING_MAL ;
22
25
import static org .apache .commons .lang3 .StringUtils .isBlank ;
23
26
@@ -31,8 +34,8 @@ public class MalBestillingController {
31
34
@ CacheEvict (value = { CACHE_BESTILLING_MAL }, allEntries = true )
32
35
@ PostMapping (value = "/ident/{ident}" )
33
36
@ Operation (description = "Opprett ny mal-bestilling fra ident" )
34
- public RsMalBestilling createTemplateFromIdent (@ PathVariable String ident ,
35
- @ RequestParam String malNavn ) {
37
+ public RsMalBestillingUtenFavoritter createTemplateFromIdent (@ PathVariable String ident ,
38
+ @ RequestParam String malNavn ) {
36
39
37
40
return malBestillingService .createFromIdent (ident , malNavn );
38
41
}
@@ -47,6 +50,15 @@ public RsMalBestillingWrapper getMalBestillinger(@RequestParam(required = false)
47
50
malBestillingService .getMalBestillinger () : malBestillingService .getMalbestillingByUser (brukerId );
48
51
}
49
52
53
+ @ Cacheable (value = CACHE_BESTILLING_MAL )
54
+ @ GetMapping ("/brukerId/{brukerId}" )
55
+ @ Transactional
56
+ @ Operation (description = "Hent mal-bestilling, for angitt brukerId, evt ALLE eller FELLES" )
57
+ public List <RsMalBestilling > getMalBestillingerBrukerId (@ PathVariable ("brukerId" ) String brukerId ) {
58
+
59
+ return malBestillingService .getMalBestillingerBrukerId (brukerId );
60
+ }
61
+
50
62
@ GetMapping ("/oversikt" )
51
63
@ Transactional (readOnly = true )
52
64
@ Operation (description = "Hent oversikt bestillinger" )
@@ -59,7 +71,7 @@ public RsMalBestillingSimple getMalBestillinger() {
59
71
@ PostMapping
60
72
@ Operation (description = "Opprett ny mal-bestilling fra bestillingId" )
61
73
@ Transactional
62
- public RsMalBestilling opprettMalbestilling (@ RequestParam Long bestillingId , @ RequestParam String malNavn ) {
74
+ public RsMalBestillingUtenFavoritter opprettMalbestilling (@ RequestParam Long bestillingId , @ RequestParam String malNavn ) {
63
75
64
76
return malBestillingService .saveBestillingMalFromBestillingId (bestillingId , malNavn );
65
77
}
@@ -77,7 +89,7 @@ public void deleteMalBestilling(@PathVariable Long id) {
77
89
@ PutMapping ("/id/{id}" )
78
90
@ Operation (description = "Rediger mal-bestilling" )
79
91
@ Transactional
80
- public RsMalBestilling redigerMalBestilling (@ PathVariable Long id , @ RequestParam String malNavn ) {
92
+ public RsMalBestillingUtenFavoritter redigerMalBestilling (@ PathVariable Long id , @ RequestParam String malNavn ) {
81
93
82
94
return malBestillingService .updateMalNavnById (id , malNavn );
83
95
}
0 commit comments