23
23
import com .sponus .sponusbe .domain .organization .company .dto .OrganizationGetResponse ;
24
24
import com .sponus .sponusbe .domain .organization .dto .OrganizationCreateRequest ;
25
25
import com .sponus .sponusbe .domain .organization .dto .OrganizationImageUploadResponse ;
26
+ import com .sponus .sponusbe .domain .organization .dto .OrganizationSearchRequest ;
26
27
import com .sponus .sponusbe .domain .organization .dto .OrganizationSearchResponse ;
27
28
import com .sponus .sponusbe .domain .organization .service .OrganizationService ;
28
29
@@ -68,13 +69,26 @@ public ApiResponse<Void> deleteOrganization(@PathVariable Long organizationId) {
68
69
@ GetMapping ("/search" )
69
70
public ApiResponse <PageResponse <OrganizationSearchResponse >> searchOrganization (
70
71
@ ModelAttribute @ Valid PageCondition pageCondition ,
71
- @ RequestParam ("search " ) String keyword ,
72
+ @ RequestParam ("keyword " ) String keyword ,
72
73
@ AuthOrganization Organization organization
73
74
) {
74
75
return ApiResponse .onSuccess (
75
76
organizationService .searchOrganizations (pageCondition , keyword , organization .getId ()));
76
77
}
77
78
79
+ @ DeleteMapping ("/search" )
80
+ public ApiResponse <Void > deleteAllSearchKeyword (@ AuthOrganization Organization organization ) {
81
+ organizationService .deleteAllSearchKeyword (organization .getId ());
82
+ return ApiResponse .onSuccess (null );
83
+ }
84
+
85
+ @ PostMapping ("/search/keywords" )
86
+ public ApiResponse <Void > createSearchHistory (@ AuthOrganization Organization organization ,
87
+ @ RequestBody @ Valid OrganizationSearchRequest request ) {
88
+ organizationService .createSearchHistory (organization .getId (), request .keyword ());
89
+ return ApiResponse .onSuccess (null );
90
+ }
91
+
78
92
@ GetMapping ("/search/keywords" )
79
93
public ApiResponse <List <String >> getSearchHistory (@ AuthOrganization Organization organization ) {
80
94
return ApiResponse .onSuccess (organizationService .getSearchHistory (organization .getId ()));
@@ -83,9 +97,9 @@ public ApiResponse<List<String>> getSearchHistory(@AuthOrganization Organization
83
97
@ DeleteMapping ("/search/keywords" )
84
98
public ApiResponse <Void > deleteSearchKeyword (
85
99
@ AuthOrganization Organization organization ,
86
- @ RequestParam ( "keyword" ) String keyword
100
+ @ RequestBody @ Valid OrganizationSearchRequest request
87
101
) {
88
- organizationService .deleteSearchKeyword (organization .getId (), keyword );
102
+ organizationService .deleteSearchKeyword (organization .getId (), request . keyword () );
89
103
return ApiResponse .onSuccess (null );
90
104
}
91
105
}
0 commit comments