package com.rongwei.bsserver.sys.controller;

import com.rongwei.bscommon.sys.service.KnowledgebaseCommentsService;
import com.rongwei.rwcommon.base.R;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
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;
import java.util.Map;

/**
 * @author ChenGuangYu
 * @version 1.0
 * @email chenguangyu@irongwei.com
 * @date 2024/1/9 11:24
 * @description 知识库查看前端接口
 */
@RestController
@RequestMapping("/KnowledgeView")
public class KnowledgeViewController {
    @Autowired
    private KnowledgebaseCommentsService knowledgebaseCommentsService;
    private final Logger log = LoggerFactory.getLogger(this.getClass().getName());

    /**
     * 知识库查看 详情页评论
     */
    @PostMapping("/commentSave")
    public R purOrderWarehouse(@RequestBody Map<String,Object> objectMap){
        try{
            knowledgebaseCommentsService.KnowledgebaseCommentsSave(objectMap);
        }catch (Exception e){
            e.printStackTrace();
            log.error("评论保存异常",e);
            return R.error("评论保存异常");
        }
        return R.ok();
    }


}
