使用者評論程式碼實現

啊猿發表於2020-12-08

使用者評論程式碼實現

注意評論編號要用UUIDUtils生成

 @Log(title = "課後評價", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    @ResponseBody
    @ApiOperation(value = "新增評價", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "insert", name = "plCreateuser", value = "使用者ID", required = true, dataType = "String"),
            @ApiImplicitParam(paramType = "insert", name = "plCurriculumid", value = "課程編號", required = true, dataType = "Integer"),
            @ApiImplicitParam(paramType = "insert", name = "parentId", value = "父級ID", required = false, dataType = "Integer"),
            @ApiImplicitParam(paramType = "insert", name = "type", value = "評論型別", required = false, dataType = "String"),
            @ApiImplicitParam(paramType = "insert", name = "plImage", value = "圖片URL", required = true, dataType = "String")})
    public void addSave(HttpServletResponse response, JrComments jrComments) throws IOException {

        jrComments.setPlId(UUIDUtils.getByUUId());
        jrComments.setPlCreatetime(new Date());
        writeJSON(jrCommentsService.insertJrComments(jrComments), response, "200", "success");
    }

相關文章