| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.dto.LocationTypeDTO; |
| | | import com.ruoyi.system.model.TLocationType; |
| | | import com.ruoyi.system.query.LocationTypeListQuery; |
| | | import com.ruoyi.system.service.TLocationTypeService; |
| | | import com.ruoyi.system.vo.system.LocationTypeListVO; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/t-location-type") |
| | | public class TLocationTypeController { |
| | | @Resource |
| | | private TLocationTypeService locationTypeService; |
| | | @ApiOperation(value = "点位类型分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<LocationTypeListVO>> pageList(@RequestBody LocationTypeListQuery query) { |
| | | return R.ok(locationTypeService.pageList(query)); |
| | | } |
| | | @Log(title = "新增点位类型", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "新增点位类型") |
| | | @PostMapping(value = "/add") |
| | | public R<Boolean> add(@RequestBody LocationTypeDTO dto) { |
| | | locationTypeService.save(dto); |
| | | return R.ok(); |
| | | } |
| | | @Log(title = "编辑点位类型", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "编辑点位类型") |
| | | @PostMapping(value = "/edit") |
| | | public R<Boolean> edit(@RequestBody LocationTypeDTO dto) { |
| | | locationTypeService.updateById(dto); |
| | | return R.ok(); |
| | | } |
| | | @ApiOperation(value = "详情点位类型") |
| | | @GetMapping(value = "/detail") |
| | | public R<TLocationType> detail(@RequestParam String id) { |
| | | |
| | | return R.ok(locationTypeService.getById(id)); |
| | | } |
| | | @Log(title = "批量删除点位类型", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "批量删除点位类型") |
| | | @DeleteMapping(value = "/delete") |
| | | public R<Boolean> edit(@RequestParam String ids) { |
| | | String[] split = ids.split(","); |
| | | locationTypeService.removeBatchByIds(Arrays.asList(split)); |
| | | return R.ok(); |
| | | } |
| | | } |
| | | |