新增功能

This commit is contained in:
yangjun 2024-05-20 18:18:30 +08:00
parent 2aacae23e8
commit a5c5faf429
12 changed files with 609 additions and 0 deletions

View File

@ -0,0 +1,175 @@
package org.jeecg.modules.kc.zyTlq.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.kc.zyTlq.entity.ZyTlq;
import org.jeecg.modules.kc.zyTlq.service.IZyTlqService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: 讨论区
* @Author: jeecg-boot
* @Date: 2024-05-20
* @Version: V1.0
*/
@Api(tags="讨论区")
@RestController
@RequestMapping("/zyTlq/zyTlq")
@Slf4j
public class ZyTlqController extends JeecgController<ZyTlq, IZyTlqService> {
@Autowired
private IZyTlqService zyTlqService;
/**
* 分页列表查询
*
* @param zyTlq
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "讨论区-分页列表查询")
@ApiOperation(value="讨论区-分页列表查询", notes="讨论区-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<ZyTlq>> queryPageList(ZyTlq zyTlq,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ZyTlq> queryWrapper = QueryGenerator.initQueryWrapper(zyTlq, req.getParameterMap());
Page<ZyTlq> page = new Page<ZyTlq>(pageNo, pageSize);
IPage<ZyTlq> pageList = zyTlqService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param zyTlq
* @return
*/
@AutoLog(value = "讨论区-添加")
@ApiOperation(value="讨论区-添加", notes="讨论区-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody ZyTlq zyTlq) {
zyTlqService.save(zyTlq);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param zyTlq
* @return
*/
@AutoLog(value = "讨论区-编辑")
@ApiOperation(value="讨论区-编辑", notes="讨论区-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody ZyTlq zyTlq) {
zyTlqService.updateById(zyTlq);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "讨论区-通过id删除")
@ApiOperation(value="讨论区-通过id删除", notes="讨论区-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
zyTlqService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "讨论区-批量删除")
@ApiOperation(value="讨论区-批量删除", notes="讨论区-批量删除")
@RequiresPermissions("zyTlq:zy_tlq:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.zyTlqService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "讨论区-通过id查询")
@ApiOperation(value="讨论区-通过id查询", notes="讨论区-通过id查询")
@GetMapping(value = "/queryById")
public Result<ZyTlq> queryById(@RequestParam(name="id",required=true) String id) {
ZyTlq zyTlq = zyTlqService.getById(id);
if(zyTlq==null) {
return Result.error("未找到对应数据");
}
return Result.OK(zyTlq);
}
/**
* 导出excel
*
* @param request
* @param zyTlq
*/
@RequiresPermissions("zyTlq:zy_tlq:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ZyTlq zyTlq) {
return super.exportXls(request, zyTlq, ZyTlq.class, "讨论区");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("zyTlq:zy_tlq:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, ZyTlq.class);
}
}

View File

@ -0,0 +1,73 @@
package org.jeecg.modules.kc.zyTlq.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 讨论区
* @Author: jeecg-boot
* @Date: 2024-05-20
* @Version: V1.0
*/
@Data
@TableName("zy_tlq")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="zy_tlq对象", description="讨论区")
public class ZyTlq implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private java.lang.String id;
/**createBy*/
@ApiModelProperty(value = "createBy")
private java.lang.String createBy;
/**createTime*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "createTime")
private java.util.Date createTime;
/**updateBy*/
@ApiModelProperty(value = "updateBy")
private java.lang.String updateBy;
/**updateTime*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "updateTime")
private java.util.Date updateTime;
/**mainId*/
@Excel(name = "mainId", width = 15)
@ApiModelProperty(value = "mainId")
private java.lang.String mainId;
/**标题*/
@Excel(name = "标题", width = 15)
@ApiModelProperty(value = "标题")
private java.lang.String title;
private java.lang.String picPath;
private java.lang.String filePath;
private java.lang.String dianzan;//点赞数量
private java.lang.String sfzd;//是否指定
private java.lang.String sfjp;//是否精品
private java.lang.String xqxn;
private java.lang.String rwbh;
private java.lang.String sffb;
}

View File

@ -0,0 +1,17 @@
package org.jeecg.modules.kc.zyTlq.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.kc.zyTlq.entity.ZyTlq;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 讨论区
* @Author: jeecg-boot
* @Date: 2024-05-20
* @Version: V1.0
*/
public interface ZyTlqMapper extends BaseMapper<ZyTlq> {
}

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.kc.zyTlq.mapper.ZyTlqMapper">
</mapper>

View File

@ -0,0 +1,14 @@
package org.jeecg.modules.kc.zyTlq.service;
import org.jeecg.modules.kc.zyTlq.entity.ZyTlq;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 讨论区
* @Author: jeecg-boot
* @Date: 2024-05-20
* @Version: V1.0
*/
public interface IZyTlqService extends IService<ZyTlq> {
}

View File

@ -0,0 +1,19 @@
package org.jeecg.modules.kc.zyTlq.service.impl;
import org.jeecg.modules.kc.zyTlq.entity.ZyTlq;
import org.jeecg.modules.kc.zyTlq.mapper.ZyTlqMapper;
import org.jeecg.modules.kc.zyTlq.service.IZyTlqService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 讨论区
* @Author: jeecg-boot
* @Date: 2024-05-20
* @Version: V1.0
*/
@Service
public class ZyTlqServiceImpl extends ServiceImpl<ZyTlqMapper, ZyTlq> implements IZyTlqService {
}

View File

@ -0,0 +1,175 @@
package org.jeecg.modules.kc.zyTlqContent.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.kc.zyTlqContent.entity.ZyTlqContent;
import org.jeecg.modules.kc.zyTlqContent.service.IZyTlqContentService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: 讨论内容
* @Author: jeecg-boot
* @Date: 2024-05-20
* @Version: V1.0
*/
@Api(tags="讨论内容")
@RestController
@RequestMapping("/zyTlqContent/zyTlqContent")
@Slf4j
public class ZyTlqContentController extends JeecgController<ZyTlqContent, IZyTlqContentService> {
@Autowired
private IZyTlqContentService zyTlqContentService;
/**
* 分页列表查询
*
* @param zyTlqContent
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "讨论内容-分页列表查询")
@ApiOperation(value="讨论内容-分页列表查询", notes="讨论内容-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<ZyTlqContent>> queryPageList(ZyTlqContent zyTlqContent,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ZyTlqContent> queryWrapper = QueryGenerator.initQueryWrapper(zyTlqContent, req.getParameterMap());
Page<ZyTlqContent> page = new Page<ZyTlqContent>(pageNo, pageSize);
IPage<ZyTlqContent> pageList = zyTlqContentService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param zyTlqContent
* @return
*/
@AutoLog(value = "讨论内容-添加")
@ApiOperation(value="讨论内容-添加", notes="讨论内容-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody ZyTlqContent zyTlqContent) {
zyTlqContentService.save(zyTlqContent);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param zyTlqContent
* @return
*/
@AutoLog(value = "讨论内容-编辑")
@ApiOperation(value="讨论内容-编辑", notes="讨论内容-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody ZyTlqContent zyTlqContent) {
zyTlqContentService.updateById(zyTlqContent);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "讨论内容-通过id删除")
@ApiOperation(value="讨论内容-通过id删除", notes="讨论内容-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
zyTlqContentService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "讨论内容-批量删除")
@ApiOperation(value="讨论内容-批量删除", notes="讨论内容-批量删除")
@RequiresPermissions("zyTlqContent:zy_tlq_content:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.zyTlqContentService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "讨论内容-通过id查询")
@ApiOperation(value="讨论内容-通过id查询", notes="讨论内容-通过id查询")
@GetMapping(value = "/queryById")
public Result<ZyTlqContent> queryById(@RequestParam(name="id",required=true) String id) {
ZyTlqContent zyTlqContent = zyTlqContentService.getById(id);
if(zyTlqContent==null) {
return Result.error("未找到对应数据");
}
return Result.OK(zyTlqContent);
}
/**
* 导出excel
*
* @param request
* @param zyTlqContent
*/
@RequiresPermissions("zyTlqContent:zy_tlq_content:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ZyTlqContent zyTlqContent) {
return super.exportXls(request, zyTlqContent, ZyTlqContent.class, "讨论内容");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("zyTlqContent:zy_tlq_content:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, ZyTlqContent.class);
}
}

View File

@ -0,0 +1,76 @@
package org.jeecg.modules.kc.zyTlqContent.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 讨论内容
* @Author: jeecg-boot
* @Date: 2024-05-20
* @Version: V1.0
*/
@Data
@TableName("zy_tlq_content")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="zy_tlq_content对象", description="讨论内容")
public class ZyTlqContent implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private java.lang.String id;
/**createBy*/
@ApiModelProperty(value = "createBy")
private java.lang.String createBy;
/**createTime*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "createTime")
private java.util.Date createTime;
/**updateBy*/
@ApiModelProperty(value = "updateBy")
private java.lang.String updateBy;
/**updateTime*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "updateTime")
private java.util.Date updateTime;
/**mainId*/
@Excel(name = "mainId", width = 15)
@ApiModelProperty(value = "mainId")
private java.lang.String mainId;
/**讨论信息*/
@Excel(name = "讨论信息", width = 15)
@ApiModelProperty(value = "讨论信息")
private java.lang.String content;
/**图片*/
@Excel(name = "图片", width = 15)
@ApiModelProperty(value = "图片")
private java.lang.String picPath;
/**附件*/
@Excel(name = "附件", width = 15)
@ApiModelProperty(value = "附件")
private java.lang.String filePath;
/**点赞*/
@Excel(name = "点赞", width = 15)
@ApiModelProperty(value = "点赞")
private java.lang.Integer dianzan;
private java.lang.Integer studentName;
}

View File

@ -0,0 +1,17 @@
package org.jeecg.modules.kc.zyTlqContent.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.kc.zyTlqContent.entity.ZyTlqContent;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 讨论内容
* @Author: jeecg-boot
* @Date: 2024-05-20
* @Version: V1.0
*/
public interface ZyTlqContentMapper extends BaseMapper<ZyTlqContent> {
}

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.kc.zyTlqContent.mapper.ZyTlqContentMapper">
</mapper>

View File

@ -0,0 +1,14 @@
package org.jeecg.modules.kc.zyTlqContent.service;
import org.jeecg.modules.kc.zyTlqContent.entity.ZyTlqContent;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 讨论内容
* @Author: jeecg-boot
* @Date: 2024-05-20
* @Version: V1.0
*/
public interface IZyTlqContentService extends IService<ZyTlqContent> {
}

View File

@ -0,0 +1,19 @@
package org.jeecg.modules.kc.zyTlqContent.service.impl;
import org.jeecg.modules.kc.zyTlqContent.entity.ZyTlqContent;
import org.jeecg.modules.kc.zyTlqContent.mapper.ZyTlqContentMapper;
import org.jeecg.modules.kc.zyTlqContent.service.IZyTlqContentService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 讨论内容
* @Author: jeecg-boot
* @Date: 2024-05-20
* @Version: V1.0
*/
@Service
public class ZyTlqContentServiceImpl extends ServiceImpl<ZyTlqContentMapper, ZyTlqContent> implements IZyTlqContentService {
}