package com.zm.order.tool.server.controller;

import com.zm.order.tool.server.service.ExceptionConstants;
import com.zm.order.tool.server.service.OrderCommentService;
import com.zm.util.dto.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author nianchang
 * @ClassName OrderCommentController
 * @date 2021/08/30 2:13 下午
 */
@Api(value = "评价脚本", tags = "评价脚本")
@RestController
@RequestMapping("/qapi/order/comment")
@SuppressWarnings("all")
public class OrderCommentController {

    private static final Logger logger = LoggerFactory.getLogger(OrderCommentController.class);

    @Autowired
    private OrderCommentService commentService;

    @ApiOperation("修改评价")
    @RequestMapping(value = "/update/comment", method = RequestMethod.POST)
    public Result updateComment() {
        Result result = new Result<>();
        try {
            result = commentService.updateComment();
        } catch (Exception e) {
            logger.error("TemporaryController[updateComment]failed,cause by: {}", e);
            result.setException(ExceptionConstants.SYSTEM_ERROR);
        }
        return result;
    }
}
