package com.njcn.cssystem.controller.feedback;


import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.cssystem.pojo.param.CsFeedbackChatAddParm;
import com.njcn.cssystem.pojo.param.CsFeedbackChatCheckParm;
import com.njcn.cssystem.service.CsFeedbackChatService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
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;

/**
 * Description:
 * 接口文档访问地址：http://serverIP:port/swagger-ui.html
 * Date: 2023/3/27  10:54【需求编号】
 *
 * @author clam
 * @version V1.0.0
 */
@Slf4j
@RestController
@RequestMapping("/feedbackChat")
@Api(tags = "问题反馈聊天")
@AllArgsConstructor
public class FeedBackChatController extends BaseController {


    private final CsFeedbackChatService csFeedbackChatService;


    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/AddFeedbackChat")
    @ApiOperation("新增反馈聊天")
    @ApiImplicitParam(name = "csFeedbackAddParm", value = "新增反馈聊天参数", required = true)
    public HttpResult<Boolean> AddFeedbackChat(@RequestBody @Validated CsFeedbackChatAddParm csFeedbackAddParm){
        String methodDescribe = getMethodDescribe("AddFeedbackChat");

        Boolean flag = csFeedbackChatService.AddFeedbackChat(csFeedbackAddParm);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);

    }
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/updateChatStatus")
    @ApiOperation("非反馈人员点击发送处理中消息")
    @ApiImplicitParam(name = "CsFeedbackChatCheckParm", value = "新增反馈聊天参数", required = true)
    public HttpResult<Boolean> updateChatStatus(@RequestBody@Validated CsFeedbackChatCheckParm CsFeedbackChatCheckParm){
        String methodDescribe = getMethodDescribe("updateChatStatus");

        Boolean flag = csFeedbackChatService.updateChatStatus(CsFeedbackChatCheckParm);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);

    }

}
