| | |
| | | import com.xiaopeng.api.model.operation.XpOpenCity; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.controller.BaseController; |
| | | import com.xiaopeng.common.core.web.domain.AjaxResult; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.operation.dto.OpenCityAddDTO; |
| | | import com.xiaopeng.operation.dto.OpenCityEditDTO; |
| | | import com.xiaopeng.operation.query.OpenCityPageQuery; |
| | | import com.xiaopeng.operation.service.XpOpenCityService; |
| | | import com.xiaopeng.operation.vo.OpenCityListVO; |
| | | import com.xiaopeng.operation.vo.XpOpenCityVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | |
| | | return R.ok(nameLists); |
| | | } |
| | | |
| | | /** |
| | | * 管理后台-开通城市管理-开通城市分页列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "开通城市分页列表", tags = {"管理后台-开通城市管理"}) |
| | | @PostMapping("/api/v1/openCity/pageList") |
| | | public R<PageInfo<XpOpenCity>> getPageList(@RequestBody OpenCityPageQuery query) { |
| | | return R.ok(xpOpenCityService.getPageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 管理后台-开通城市管理-新增开通城市 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "新增开通城市", tags = {"管理后台-开通城市管理"}) |
| | | @PostMapping("/api/v1/openCity/add") |
| | | public R<?> add(@Valid @RequestBody OpenCityAddDTO dto) { |
| | | xpOpenCityService.add(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 管理后台-开通城市管理-编辑开通城市 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "编辑开通城市", tags = {"管理后台-开通城市管理"}) |
| | | @PostMapping("/api/v1/openCity/edit") |
| | | public R<?> add(@Valid @RequestBody OpenCityEditDTO dto) { |
| | | xpOpenCityService.edit(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 管理后台-开通城市管理-删除开通城市 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "删除开通城市", tags = {"管理后台-开通城市管理"}) |
| | | @DeleteMapping("/api/v1/openCity/delete/{id}") |
| | | public R<?> deleteById(@ApiParam(name = "id", value = "开通城市ID") @PathVariable Long id) { |
| | | xpOpenCityService.deleteById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 管理后台-开通城市管理-启用/禁用 |
| | | * @param id |
| | | * @param status |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "启用/禁用", tags = {"管理后台-开通城市管理"}) |
| | | @PostMapping("/api/v1/openCity/upDown") |
| | | public R<?> upDown(Long id, Integer status) { |
| | | xpOpenCityService.upDown(id, status); |
| | | return R.ok(); |
| | | } |
| | | } |