| | |
| | | import com.oying.modules.rider.domain.RiderInfo; |
| | | import com.oying.modules.rider.service.RiderInfoService; |
| | | import com.oying.modules.rider.domain.dto.RiderInfoQueryCriteria; |
| | | import com.oying.utils.R; |
| | | import lombok.RequiredArgsConstructor; |
| | | import java.util.List; |
| | | import org.springframework.http.HttpStatus; |
| | |
| | | **/ |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "三方骑手数据信息") |
| | | @RequestMapping("/api/riderInfo") |
| | | @Api(tags = "骑手:三方骑手数据信息") |
| | | @RequestMapping("/api/rider/riderInfo") |
| | | public class RiderInfoController { |
| | | |
| | | private final RiderInfoService riderInfoService; |
| | |
| | | @GetMapping |
| | | @ApiOperation("查询三方骑手数据信息") |
| | | @PreAuthorize("@el.check('riderInfo:list')") |
| | | public ResponseEntity<PageResult<RiderInfo>> queryRiderInfo(RiderInfoQueryCriteria criteria){ |
| | | public ResponseEntity<Object> queryRiderInfo(RiderInfoQueryCriteria criteria){ |
| | | Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize()); |
| | | return new ResponseEntity<>(riderInfoService.queryAll(criteria,page),HttpStatus.OK); |
| | | return new ResponseEntity<>(R.success(riderInfoService.queryAll(criteria,page)),HttpStatus.OK); |
| | | } |
| | | |
| | | @PostMapping |
| | |
| | | @PreAuthorize("@el.check('riderInfo:add')") |
| | | public ResponseEntity<Object> createRiderInfo(@Validated @RequestBody RiderInfo resources){ |
| | | riderInfoService.create(resources); |
| | | return new ResponseEntity<>(HttpStatus.CREATED); |
| | | return new ResponseEntity<>(R.success(),HttpStatus.CREATED); |
| | | } |
| | | |
| | | @PutMapping |
| | |
| | | @PreAuthorize("@el.check('riderInfo:edit')") |
| | | public ResponseEntity<Object> updateRiderInfo(@Validated @RequestBody RiderInfo resources){ |
| | | riderInfoService.update(resources); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | return new ResponseEntity<>(R.success(),HttpStatus.NO_CONTENT); |
| | | } |
| | | |
| | | @DeleteMapping |
| | |
| | | @PreAuthorize("@el.check('riderInfo:del')") |
| | | public ResponseEntity<Object> deleteRiderInfo(@ApiParam(value = "传ID数组[]") @RequestBody List<Long> ids) { |
| | | riderInfoService.deleteAll(ids); |
| | | return new ResponseEntity<>(HttpStatus.OK); |
| | | return new ResponseEntity<>(R.success(),HttpStatus.OK); |
| | | } |
| | | } |