| | |
| | | package com.oying.modules.message.rest; |
| | | |
| | | import com.oying.annotation.Log; |
| | | import com.oying.modules.message.domain.MesOrderItemEvaluation; |
| | | import com.oying.modules.message.domain.MesOrderItemEvaluationDto; |
| | | import com.oying.modules.message.service.MesOrderItemEvaluationService; |
| | | import com.oying.modules.message.domain.dto.MesOrderItemEvaluationQueryCriteria; |
| | | import com.oying.utils.R; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import java.util.List; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import io.swagger.annotations.*; |
| | | import java.io.IOException; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.oying.utils.PageResult; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @author 李萌 |
| | | * @date 2025-07-25 |
| | | **/ |
| | | * @author 李萌 |
| | | * @date 2025-07-25 |
| | | **/ |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "消息") |
| | | @Api(tags = "消息中心:订单") |
| | | @RequestMapping("/api/mesOrderItemEvaluation") |
| | | public class MesOrderItemEvaluationController { |
| | | |
| | | private final MesOrderItemEvaluationService mesOrderItemEvaluationService; |
| | | |
| | | @ApiOperation("导出数据") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('mesOrderItemEvaluation:list')") |
| | | public void exportMesOrderItemEvaluation(HttpServletResponse response, MesOrderItemEvaluationQueryCriteria criteria) throws IOException { |
| | | mesOrderItemEvaluationService.download(mesOrderItemEvaluationService.queryAll(criteria), response); |
| | | } |
| | | |
| | | @GetMapping |
| | | @ApiOperation("查询消息") |
| | | @PreAuthorize("@el.check('mesOrderItemEvaluation:list')") |
| | | public ResponseEntity<PageResult<MesOrderItemEvaluation>> queryMesOrderItemEvaluation(MesOrderItemEvaluationQueryCriteria criteria){ |
| | | Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize()); |
| | | return new ResponseEntity<>(mesOrderItemEvaluationService.queryAll(criteria,page),HttpStatus.OK); |
| | | } |
| | | |
| | | @PostMapping |
| | | @Log("新增消息") |
| | | @ApiOperation("新增消息") |
| | | @PreAuthorize("@el.check('mesOrderItemEvaluation:add')") |
| | | public ResponseEntity<Object> createMesOrderItemEvaluation(@Validated @RequestBody MesOrderItemEvaluation resources){ |
| | | mesOrderItemEvaluationService.create(resources); |
| | | return new ResponseEntity<>(HttpStatus.CREATED); |
| | | } |
| | | |
| | | @PutMapping |
| | | @Log("修改消息") |
| | | @ApiOperation("修改消息") |
| | | @PreAuthorize("@el.check('mesOrderItemEvaluation:edit')") |
| | | public ResponseEntity<Object> updateMesOrderItemEvaluation(@Validated @RequestBody MesOrderItemEvaluation resources){ |
| | | mesOrderItemEvaluationService.update(resources); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @Log("删除消息") |
| | | @ApiOperation("删除消息") |
| | | @PreAuthorize("@el.check('mesOrderItemEvaluation:del')") |
| | | public ResponseEntity<Object> deleteMesOrderItemEvaluation(@ApiParam(value = "传ID数组[]") @RequestBody List<Long> ids) { |
| | | mesOrderItemEvaluationService.deleteAll(ids); |
| | | return new ResponseEntity<>(HttpStatus.OK); |
| | | } |
| | | // |
| | | // @ApiOperation("导出数据") |
| | | // @GetMapping(value = "/download") |
| | | // @PreAuthorize("@el.check('mesOrderItemEvaluation:list')") |
| | | // public void exportMesOrderItemEvaluation(HttpServletResponse response, MesOrderItemEvaluationQueryCriteria criteria) throws IOException { |
| | | // mesOrderItemEvaluationService.download(mesOrderItemEvaluationService.queryAll(criteria), response); |
| | | // } |
| | | // |
| | | // @GetMapping |
| | | // @ApiOperation("查询消息") |
| | | // @PreAuthorize("@el.check('mesOrderItemEvaluation:list')") |
| | | // public ResponseEntity<PageResult<MesOrderItemEvaluation>> queryMesOrderItemEvaluation(MesOrderItemEvaluationQueryCriteria criteria){ |
| | | // Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize()); |
| | | // return new ResponseEntity<>(mesOrderItemEvaluationService.queryAll(criteria,page),HttpStatus.OK); |
| | | // } |
| | | // |
| | | // @PostMapping |
| | | // @Log("新增消息") |
| | | // @ApiOperation("新增消息") |
| | | // @PreAuthorize("@el.check('mesOrderItemEvaluation:add')") |
| | | // public ResponseEntity<Object> createMesOrderItemEvaluation(@Validated @RequestBody MesOrderItemEvaluation resources){ |
| | | // mesOrderItemEvaluationService.create(resources); |
| | | // return new ResponseEntity<>(HttpStatus.CREATED); |
| | | // } |
| | | // |
| | | // @PutMapping |
| | | // @Log("修改消息") |
| | | // @ApiOperation("修改消息") |
| | | // @PreAuthorize("@el.check('mesOrderItemEvaluation:edit')") |
| | | // public ResponseEntity<Object> updateMesOrderItemEvaluation(@Validated @RequestBody MesOrderItemEvaluation resources){ |
| | | // mesOrderItemEvaluationService.update(resources); |
| | | // return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | // } |
| | | // |
| | | // @DeleteMapping |
| | | // @Log("删除消息") |
| | | // @ApiOperation("删除消息") |
| | | // @PreAuthorize("@el.check('mesOrderItemEvaluation:del')") |
| | | // public ResponseEntity<Object> deleteMesOrderItemEvaluation(@ApiParam(value = "传ID数组[]") @RequestBody List<Long> ids) { |
| | | // mesOrderItemEvaluationService.deleteAll(ids); |
| | | // return new ResponseEntity<>(HttpStatus.OK); |
| | | // } |
| | | //对一个商品评价 + 打分 |
| | | //order_eval_id, order_item_id, goods_id, goods_name, goods_pic, score, content, imgs, buyer_id |
| | | @PostMapping("/addGoodsEvaluation") |
| | | @ApiOperation("对一个商品评价 + 打分") |
| | | public R<Object> addGoodsEvaluation(@RequestBody MesOrderItemEvaluationDto resources){ |
| | | public R<Object> addGoodsEvaluation(@RequestBody MesOrderItemEvaluationDto resources) { |
| | | try { |
| | | mesOrderItemEvaluationService.addGoodsEvaluation(resources); |
| | | return R.success(); |