| | |
| | | package com.jilongda.manage.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.manage.model.TOptometrist; |
| | | import com.jilongda.manage.query.TOptometristQuery; |
| | | import com.jilongda.manage.query.TicketQuery; |
| | | import com.jilongda.manage.service.TOptometristService; |
| | | import com.jilongda.manage.vo.TOptometristVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author 无关风月 |
| | | * @since 2024-12-09 |
| | | */ |
| | | @Api(tags = "验光师管理") |
| | | @RestController |
| | | @RequestMapping("/t-optometrist") |
| | | public class TOptometristController { |
| | | @Autowired |
| | | private TOptometristService optometristService; |
| | | |
| | | @ApiOperation(value = "验光师列表") |
| | | @PostMapping(value = "/pageList") |
| | | public ApiResult<PageInfo<TOptometristVO>> pageList(@RequestBody TOptometristQuery query) { |
| | | PageInfo<TOptometristVO> optometristVOPageInfo = optometristService.pageList1(query); |
| | | return ApiResult.success(optometristVOPageInfo); |
| | | } |
| | | |
| | | @ApiOperation(value = "通过门店id查询验光师列表") |
| | | @PostMapping(value = "/queryListByStoreId") |
| | | public ApiResult<List<TOptometrist>> queryListByStoreId(@RequestParam Integer storeId) { |
| | | List<TOptometrist> optometristVOPageInfo = optometristService.list(Wrappers.lambdaQuery(TOptometrist.class) |
| | | .eq(TOptometrist::getStoreId,storeId)); |
| | | return ApiResult.success(optometristVOPageInfo); |
| | | } |
| | | @ApiOperation(value = "验光师详情") |
| | | @GetMapping(value = "/detail") |
| | | public ApiResult<TOptometrist> detail(Integer id) { |
| | | return ApiResult.success(optometristService.getById(id)); |
| | | } |
| | | @ApiOperation(value = "验光师添加") |
| | | @PostMapping(value = "/add") |
| | | public ApiResult<String> add(@RequestBody TOptometrist dto) { |
| | | optometristService.save(dto); |
| | | return ApiResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "验光师编辑") |
| | | @PostMapping(value = "/update") |
| | | public ApiResult<String> update(@RequestBody TOptometrist dto) { |
| | | optometristService.updateById(dto); |
| | | return ApiResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "验光师上下架") |
| | | @GetMapping(value = "/upAndDown") |
| | | public ApiResult<Boolean> upAndDown(@RequestParam Integer id, |
| | | @RequestParam Integer status) { |
| | | return ApiResult.success(optometristService.upAndDown(id,status)); |
| | | } |
| | | } |
| | | |