cloudroam
4 天以前 46715d892da947c31f07796fdc79dbbef06677b3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package com.mzl.flower.web.film;
 
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.FilmHotCityDTO;
import com.mzl.flower.dto.request.film.FilmHotCityQueryDTO;
import com.mzl.flower.dto.response.film.FilmHotCityVO;
import com.mzl.flower.service.film.FilmHotCityService;
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;
 
/**
 * FilmHotCity热门城市表前端控制器
 *
 * @author generator@Fang
 */
@Api(value = "热门城市信息管理", tags = "热门城市信息管理")
@RestController
@RequestMapping("/api")
@RequiredArgsConstructor
public class FilmHotCityController extends BaseController {
 
 
    private final FilmHotCityService filmHotCityService;
 
    @GetMapping("/filmHotCity/list")
    @ApiOperation(value = "热门城市列表", httpMethod = "GET")
    public ResponseEntity<ReturnDataDTO<Page<FilmHotCityVO>>> getFilmHotCityList(Page page, FilmHotCityQueryDTO dto) {
        return returnData(R.SUCCESS.getCode(), filmHotCityService.queryPage(dto, page));
    }
 
 
    @GetMapping(value = "/filmHotCity/delete")
    @ApiOperation(value = "删除热门城市 ", httpMethod = "GET", notes = "ID")
    public ResponseEntity delete(@NotNull(message = "id不能为空") Long id) {
        filmHotCityService.deleteFilmHotCity(String.valueOf(id));
        return returnData(R.SUCCESS.getCode(), null);
    }
 
    @PostMapping(value = "/filmHotCity/new")
    @ApiOperation(value = "保存热门城市", httpMethod = "POST")
    public ResponseEntity insert(@RequestBody FilmHotCityDTO filmHotCityDTO) {
        filmHotCityService.saveFilmHotCity(filmHotCityDTO);
        return returnData(R.SUCCESS.getCode(), null);
    }
 
    @PostMapping(value = "/filmHotCity/edit")
    @ApiOperation(value = "更新热门城市", httpMethod = "POST")
    public ResponseEntity update(@RequestBody FilmHotCityDTO filmHotCityDTO) {
        filmHotCityService.updateFilmHotCity(filmHotCityDTO);
        return returnData(R.SUCCESS.getCode(), null);
    }
 
    @GetMapping("/filmHotCity/list/view")
    @ApiOperation(value = "详情", notes = "详情")
    public ResponseEntity<ReturnDataDTO<FilmHotCityVO>> detail(@NotNull(message = "id不能为空") Long id) {
        return returnData(R.SUCCESS.getCode(), filmHotCityService.detail(id));
    }
 
 
    @GetMapping("/filmHotCity/isEnable")
    @ApiOperation(value = "启用/禁用", notes = "启用/禁用景点")
    public ResponseEntity<ReturnDataDTO<String>> isEnable(@NotNull(message = "id不能为空") Long id) {
        filmHotCityService.isEnable(id);
        return returnData(R.SUCCESS.getCode(), null);
    }
 
 
    @PostMapping("/filmHotCity/delete/batch")
    @ApiOperation(value = "批量删除", notes = "批量删除")
    public ResponseEntity<ReturnDataDTO> batchDelete(@Validated @RequestBody BatchDTO dto) {
        filmHotCityService.batchDelete(dto);
        return returnData(R.SUCCESS.getCode(), null);
    }
 
 
}