添加发版日志功能
This commit is contained in:
parent
704448f43b
commit
b496865795
|
@ -0,0 +1,164 @@
|
|||
package com.nu.modules.IssueInfo.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
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 com.nu.modules.IssueInfo.entity.IssueInfo;
|
||||
import com.nu.modules.IssueInfo.service.IIssueInfoService;
|
||||
|
||||
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.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
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: 2025-07-01
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="发版日志")
|
||||
@RestController
|
||||
//@RequestMapping("/IssueInfo/nuIssueInfo")
|
||||
@RequestMapping("/admin/issueInfo")
|
||||
@Slf4j
|
||||
public class IssueInfoController extends JeecgController<IssueInfo, IIssueInfoService> {
|
||||
@Autowired
|
||||
private IIssueInfoService nuIssueInfoService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param nuIssueInfo
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "发版日志-分页列表查询")
|
||||
@ApiOperation(value="发版日志-分页列表查询", notes="发版日志-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<IssueInfo>> queryPageList(IssueInfo nuIssueInfo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<IssueInfo> queryWrapper = QueryGenerator.initQueryWrapper(nuIssueInfo, req.getParameterMap());
|
||||
Page<IssueInfo> page = new Page<IssueInfo>(pageNo, pageSize);
|
||||
IPage<IssueInfo> pageList = nuIssueInfoService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param nuIssueInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "发版日志-添加")
|
||||
@ApiOperation(value="发版日志-添加", notes="发版日志-添加")
|
||||
@RequiresPermissions("IssueInfo:nu_issue_info:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody IssueInfo nuIssueInfo) {
|
||||
nuIssueInfoService.save(nuIssueInfo);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param nuIssueInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "发版日志-编辑")
|
||||
@ApiOperation(value="发版日志-编辑", notes="发版日志-编辑")
|
||||
@RequiresPermissions("IssueInfo:nu_issue_info:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody IssueInfo nuIssueInfo) {
|
||||
nuIssueInfoService.updateById(nuIssueInfo);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "发版日志-通过id删除")
|
||||
@ApiOperation(value="发版日志-通过id删除", notes="发版日志-通过id删除")
|
||||
@RequiresPermissions("IssueInfo:nu_issue_info:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
nuIssueInfoService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "发版日志-批量删除")
|
||||
@ApiOperation(value="发版日志-批量删除", notes="发版日志-批量删除")
|
||||
@RequiresPermissions("IssueInfo:nu_issue_info:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.nuIssueInfoService.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<IssueInfo> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
IssueInfo nuIssueInfo = nuIssueInfoService.getById(id);
|
||||
if(nuIssueInfo==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(nuIssueInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param nuIssueInfo
|
||||
*/
|
||||
@RequiresPermissions("IssueInfo:nu_issue_info:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, IssueInfo nuIssueInfo) {
|
||||
return super.exportXls(request, nuIssueInfo, IssueInfo.class, "发版日志");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("IssueInfo:nu_issue_info:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, IssueInfo.class);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
package com.nu.modules.IssueInfo.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
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: 2025-07-01
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_issue_info")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_issue_info对象", description="发版日志")
|
||||
public class IssueInfo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**ID*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "ID")
|
||||
private String id;
|
||||
/**是否删除 0未删除 1删除*/
|
||||
@Excel(name = "是否删除 0未删除 1删除", width = 15)
|
||||
@ApiModelProperty(value = "是否删除 0未删除 1删除")
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private Date createTime;
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private Date updateTime;
|
||||
/**所属机构*/
|
||||
@ApiModelProperty(value = "所属机构")
|
||||
private String sysOrgCode;
|
||||
/**发版类型 0运维 1业务 2app 3小程序*/
|
||||
@Excel(name = "发版类型 0运维 1业务 2app 3小程序", width = 15, dicCode = "issue_type")
|
||||
@Dict(dicCode = "issue_type")
|
||||
@ApiModelProperty(value = "发版类型 0运维 1业务 2app 3小程序")
|
||||
private String issueType;
|
||||
/**发版内容*/
|
||||
@Excel(name = "发版内容", width = 15)
|
||||
@ApiModelProperty(value = "发版内容")
|
||||
private String content;
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.nu.modules.IssueInfo.mapper;
|
||||
|
||||
import com.nu.modules.IssueInfo.entity.IssueInfo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 发版日志
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-07-01
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IssueInfoMapper extends BaseMapper<IssueInfo> {
|
||||
|
||||
}
|
|
@ -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="com.nu.modules.IssueInfo.mapper.IssueInfoMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,14 @@
|
|||
package com.nu.modules.IssueInfo.service;
|
||||
|
||||
import com.nu.modules.IssueInfo.entity.IssueInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 发版日志
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-07-01
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IIssueInfoService extends IService<IssueInfo> {
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.nu.modules.IssueInfo.service.impl;
|
||||
|
||||
import com.nu.modules.IssueInfo.entity.IssueInfo;
|
||||
import com.nu.modules.IssueInfo.mapper.IssueInfoMapper;
|
||||
import com.nu.modules.IssueInfo.service.IIssueInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 发版日志
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-07-01
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class IssueInfoServiceImpl extends ServiceImpl<IssueInfoMapper, IssueInfo> implements IIssueInfoService {
|
||||
|
||||
}
|
Loading…
Reference in New Issue