| | |
| | | import com.mzl.flower.base.BaseController; |
| | | import com.mzl.flower.base.R; |
| | | import com.mzl.flower.base.ReturnDataDTO; |
| | | import com.mzl.flower.dto.BatchDTO; |
| | | import com.mzl.flower.dto.request.film.FilmLocationDTO; |
| | | import com.mzl.flower.dto.request.film.FilmLocationQueryDTO; |
| | | import com.mzl.flower.dto.response.film.FilmLocationVO; |
| | | import com.mzl.flower.dto.response.film.FilmWorksVO; |
| | | import com.mzl.flower.service.film.FilmLocationService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 影视拍摄场地信息表前端控制器 |
| | |
| | | private final FilmLocationService filmLocationService; |
| | | |
| | | @GetMapping("/filmLocation/list") |
| | | @ApiOperation(value = "影视作品列表", httpMethod = "GET") |
| | | @ApiOperation(value = "影视拍摄场地列表", httpMethod = "GET") |
| | | public ResponseEntity<ReturnDataDTO<Page<FilmLocationVO>>> getFilmLocationList(Page page, FilmLocationQueryDTO dto) { |
| | | return returnData(R.SUCCESS.getCode(), filmLocationService.queryPage(dto, page)); |
| | | } |
| | | |
| | | @GetMapping("/filmLocation/getTop3") |
| | | @ApiOperation(value = "影视拍摄场地前三", httpMethod = "GET") |
| | | public ResponseEntity<ReturnDataDTO<List<FilmLocationVO>>> getFilmLocationListTop3() { |
| | | return returnData(R.SUCCESS.getCode(), filmLocationService.getFilmLocationListTop3()); |
| | | } |
| | | |
| | | |
| | | @GetMapping(value = "/filmLocation/delete") |
| | | @ApiOperation(value = "删除影视作品 ", httpMethod = "GET", notes = "ID") |
| | | @ApiOperation(value = "删除影视拍摄场地 ", httpMethod = "GET", notes = "ID") |
| | | public ResponseEntity delete(@NotNull(message = "id不能为空") Long id) { |
| | | filmLocationService.deleteFilmLocation(String.valueOf(id)); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | } |
| | | |
| | | @PostMapping(value = "/filmLocation/new") |
| | | @ApiOperation(value = "保存影视作品", httpMethod = "POST") |
| | | @ApiOperation(value = "保存影视拍摄场地", httpMethod = "POST") |
| | | public ResponseEntity insert(@RequestBody FilmLocationDTO filmLocationDTO) { |
| | | filmLocationService.saveFilmLocation(filmLocationDTO); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | } |
| | | |
| | | @PostMapping(value = "/filmLocation/edit") |
| | | @ApiOperation(value = "更新影视作品", httpMethod = "POST") |
| | | @ApiOperation(value = "更新影视拍摄场地", httpMethod = "POST") |
| | | public ResponseEntity update(@RequestBody FilmLocationDTO filmLocationDTO) { |
| | | filmLocationService.updateFilmLocation(filmLocationDTO); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | } |
| | | |
| | | @GetMapping("/filmLocation/list/view") |
| | | @ApiOperation(value = "详情", notes = "详情") |
| | | public ResponseEntity<ReturnDataDTO<FilmLocationVO>> detail(@NotNull(message = "id不能为空") Long id) { |
| | | return returnData(R.SUCCESS.getCode(),filmLocationService.detail(id)); |
| | | } |
| | | |
| | | @GetMapping("/filmLocation/setDown") |
| | | @ApiOperation(value = "清除权重", notes = "清除权重") |
| | | public ResponseEntity<ReturnDataDTO> setDown(@NotNull(message = "id不能为空") Long id) { |
| | | filmLocationService.changeDownState(id); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | } |
| | | |
| | | @GetMapping("/filmLocation/isEnable") |
| | | @ApiOperation(value = "启用/禁用", notes = "启用/禁用景点") |
| | | public ResponseEntity<ReturnDataDTO<String>> isEnable(@NotNull(message = "id不能为空") Long id) { |
| | | filmLocationService.isEnable(id); |
| | | return returnData(R.SUCCESS.getCode(),null); |
| | | } |
| | | |
| | | @PostMapping("/filmLocation/merge/batch") |
| | | @ApiOperation(value = "批量发布", notes = "批量发布") |
| | | public ResponseEntity<ReturnDataDTO> batchMerge(@Validated @RequestBody BatchDTO dto) { |
| | | filmLocationService.batchMerge(dto); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | } |
| | | |
| | | @PostMapping("/filmLocation/delete/batch") |
| | | @ApiOperation(value = "批量删除", notes = "批量删除") |
| | | public ResponseEntity<ReturnDataDTO> batchDelete(@Validated @RequestBody BatchDTO dto) { |
| | | filmLocationService.batchDelete(dto); |
| | | return returnData(R.SUCCESS.getCode(),null); |
| | | } |
| | | |
| | | @GetMapping("/filmLocation/related") |
| | | @ApiOperation(value = "景点对应的影视作品", notes = "景点对应的影视作品") |
| | | public ResponseEntity<ReturnDataDTO<List<FilmWorksVO>>> related(@NotNull(message = "id不能为空") Long locationId) { |
| | | return returnData(R.SUCCESS.getCode(), filmLocationService.related(locationId)); |
| | | } |
| | | |
| | | } |