|
@ -1,6 +1,7 @@ |
|
|
package com.storeroom.modules.system.controller; |
|
|
package com.storeroom.modules.system.controller; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.storeroom.annotaion.rest.AnonymousDeleteMapping; |
|
|
import com.storeroom.annotaion.rest.AnonymousGetMapping; |
|
|
import com.storeroom.annotaion.rest.AnonymousGetMapping; |
|
|
import com.storeroom.annotaion.rest.AnonymousPostMapping; |
|
|
import com.storeroom.annotaion.rest.AnonymousPostMapping; |
|
|
import com.storeroom.exception.BaseException; |
|
|
import com.storeroom.exception.BaseException; |
|
@ -19,6 +20,8 @@ import org.springframework.web.bind.annotation.RequestBody; |
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.Set; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RestController |
|
|
@RestController |
|
|
@RequiredArgsConstructor |
|
|
@RequiredArgsConstructor |
|
@ -51,4 +54,14 @@ public class NoticeController { |
|
|
public ApiResponse<Object> list(NoticeQueryCriteria criteria, Pageable pageable) { |
|
|
public ApiResponse<Object> list(NoticeQueryCriteria criteria, Pageable pageable) { |
|
|
return ApiResponse.success(noticeService.queryAll(criteria, pageable)); |
|
|
return ApiResponse.success(noticeService.queryAll(criteria, pageable)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("批量删除") |
|
|
|
|
|
@AnonymousDeleteMapping("delete") |
|
|
|
|
|
public ApiResponse<Object> deleteAll(@RequestBody Set<String> ids) { |
|
|
|
|
|
if (ids.size() == 0) { |
|
|
|
|
|
throw new BaseException("id异常"); |
|
|
|
|
|
} |
|
|
|
|
|
noticeService.deleteByIds(ids); |
|
|
|
|
|
return ApiResponse.success(ResponseStatus.SUCCESS); |
|
|
|
|
|
} |
|
|
} |
|
|
} |