| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- package com.izouma.nineth.web;
- import com.izouma.nineth.domain.Asset;
- import com.izouma.nineth.domain.MetaShowRoomAsset;
- import com.izouma.nineth.dto.MetaRestResult;
- import com.izouma.nineth.dto.PageQuery;
- import com.izouma.nineth.repo.MetaShowRoomAssetRepo;
- import com.izouma.nineth.service.MetaShowRoomAssetService;
- import com.izouma.nineth.utils.excel.ExcelUtils;
- import lombok.AllArgsConstructor;
- import org.springframework.data.domain.Page;
- import org.springframework.web.bind.annotation.*;
- import javax.servlet.http.HttpServletResponse;
- import java.io.IOException;
- import java.util.List;
- @RestController
- @RequestMapping("/metaShowRoomAsset")
- @AllArgsConstructor
- public class MetaShowRoomAssetController extends BaseController {
- private MetaShowRoomAssetService metaShowRoomAssetService;
- private MetaShowRoomAssetRepo metaShowRoomAssetRepo;
- //@PreAuthorize("hasRole('ADMIN')")
- @PostMapping("/all")
- public Page<MetaShowRoomAsset> all(@RequestBody PageQuery pageQuery) {
- return metaShowRoomAssetService.all(pageQuery);
- }
- @GetMapping("/excel")
- @ResponseBody
- public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
- List<MetaShowRoomAsset> data = all(pageQuery).getContent();
- ExcelUtils.export(response, data);
- }
- @GetMapping("/{userId}/noShowRoomAndBlindBox")
- public MetaRestResult<List<Asset>> noShowRoomAndBlindBox(@PathVariable Long userId) {
- return metaShowRoomAssetService.noShowRoomAndBlindBox(userId);
- }
- @GetMapping("/{userId}/noBlindBox")
- public MetaRestResult<List<Asset>> noBlindBox(@PathVariable Long userId) {
- return metaShowRoomAssetService.noBlindBox(userId);
- }
- @PostMapping("/putOn")
- public MetaRestResult<String> putOn(@RequestBody MetaShowRoomAsset metaShowRoomAsset) {
- return metaShowRoomAssetService.putOn(metaShowRoomAsset);
- }
- @PostMapping("/putOff")
- public MetaRestResult<Boolean> putOff(@RequestParam Long assetId) {
- return metaShowRoomAssetService.putOff(assetId);
- }
- @PostMapping("/putOffAll")
- public MetaRestResult<Boolean> putOffAll(@RequestParam Long showRoomId) {
- return metaShowRoomAssetService.putOffAll(showRoomId);
- }
- @GetMapping("/{showRoomId}/{spaceId}/findShowRoomAsset")
- public MetaRestResult<List<MetaShowRoomAsset>> findShowRoomAsset(@PathVariable Long showRoomId, @PathVariable Long spaceId) {
- return metaShowRoomAssetService.findShowRoomAsset(showRoomId, spaceId);
- }
- }
|