转移项目管理及部署管理代码

This commit is contained in:
akun 2024-04-23 18:09:26 +08:00
parent 7fbb842597
commit 487649c164
17 changed files with 1308 additions and 1 deletions

View File

@ -146,6 +146,12 @@
<artifactId>sf-file</artifactId>
<version>${sf.version}</version>
</dependency>
<dependency>
<groupId>com.smarterFramework</groupId>
<artifactId>sf-service</artifactId>
<version>${sf.version}</version>
</dependency>
<!-- 核心模块-->
<dependency>
@ -207,6 +213,7 @@
<module>sf-apijson</module>
<module>sf-vertx</module>
<module>sf-vertx-api</module>
<module>sf-service</module>
</modules>
<packaging>pom</packaging>

View File

@ -60,7 +60,12 @@
<groupId>com.smarterFramework</groupId>
<artifactId>sf-file</artifactId>
</dependency>
<!-- 业务模块-->
<dependency>
<groupId>com.smarterFramework</groupId>
<artifactId>sf-service</artifactId>
</dependency>
</dependencies>
<build>

View File

@ -46,4 +46,14 @@ public class IdUtils
{
return UUID.fastUUID().toString(true);
}
/**
* 生成一个由时间错与字母组成的唯一id
*
* @return
*/
public static String randomTime(String data) {
long uniqueID = System.currentTimeMillis();
return data + "_" + uniqueID;
}
}

47
sf-service/pom.xml Normal file
View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>smarterFramework</artifactId>
<groupId>com.smarterFramework</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>sf-service</artifactId>
<description>
业务模块
</description>
<dependencies>
<!-- 通用工具-->
<dependency>
<groupId>com.smarterFramework</groupId>
<artifactId>sf-common</artifactId>
</dependency>
<!-- 通用工具-->
<dependency>
<groupId>com.smarterFramework</groupId>
<artifactId>sf-framework</artifactId>
</dependency>
<!-- swagger3-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
</dependency>
<!-- 防止进入swagger页面报类型转换错误排除3.0.0中的引用手动增加1.6.2版本 -->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.6.2</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,105 @@
package com.sf.service.deploy.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.sf.service.deploy.domain.SysApkInfo;
import com.sf.service.deploy.service.ISysApkInfoService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.sf.common.annotation.Log;
import com.sf.common.core.controller.BaseController;
import com.sf.common.core.domain.AjaxResult;
import com.sf.common.enums.BusinessType;
import com.sf.common.utils.poi.ExcelUtil;
import com.sf.common.core.page.TableDataInfo;
/**
* 安装包管理Controller
*
* @author ztzh
* @date 2024-04-11
*/
@RestController
@RequestMapping("/deploy/INFO")
public class SysApkInfoController extends BaseController
{
@Autowired
private ISysApkInfoService sysApkInfoService;
/**
* 查询安装包管理列表
*/
@PreAuthorize("@ss.hasPermi('deploy:INFO:list')")
@GetMapping("/list")
public TableDataInfo list(SysApkInfo sysApkInfo)
{
startPage();
List<SysApkInfo> list = sysApkInfoService.selectSysApkInfoList(sysApkInfo);
return getDataTable(list);
}
/**
* 导出安装包管理列表
*/
@PreAuthorize("@ss.hasPermi('deploy:INFO:export')")
@Log(title = "安装包管理(新)", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SysApkInfo sysApkInfo)
{
List<SysApkInfo> list = sysApkInfoService.selectSysApkInfoList(sysApkInfo);
ExcelUtil<SysApkInfo> util = new ExcelUtil<SysApkInfo>(SysApkInfo.class);
util.exportExcel(response, list, "安装包管理(新)数据");
}
/**
* 获取安装包管理详细信息
*/
@PreAuthorize("@ss.hasPermi('deploy:INFO:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(sysApkInfoService.selectSysApkInfoById(id));
}
/**
* 新增安装包管理
*/
@PreAuthorize("@ss.hasPermi('deploy:INFO:add')")
@Log(title = "安装包管理(新)", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SysApkInfo sysApkInfo)
{
return toAjax(sysApkInfoService.insertSysApkInfo(sysApkInfo));
}
/**
* 修改安装包管理
*/
@PreAuthorize("@ss.hasPermi('deploy:INFO:edit')")
@Log(title = "安装包管理(新)", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SysApkInfo sysApkInfo)
{
return toAjax(sysApkInfoService.updateSysApkInfo(sysApkInfo));
}
/**
* 删除安装包管理
*/
@PreAuthorize("@ss.hasPermi('deploy:INFO:remove')")
@Log(title = "安装包管理(新)", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(sysApkInfoService.deleteSysApkInfoByIds(ids));
}
}

View File

@ -0,0 +1,202 @@
package com.sf.service.deploy.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.sf.common.annotation.Excel;
import com.sf.common.core.domain.BaseEntity;
/**
* 安装包管理对象 SYS_APK_INFO
*
* @author ztzh
* @date 2024-04-11
*/
public class SysApkInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 上传类型 */
@Excel(name = "上传类型")
private String uploadingType;
/** 安装包名称 */
@Excel(name = "安装包名称")
private String sysApkName;
/** 版本号 */
@Excel(name = "版本号")
private String version;
/** 安装包 */
@Excel(name = "安装包")
private String sysApk;
/** 安装包大小 */
@Excel(name = "安装包大小")
private String sysApkSize;
/** 安装包类型 */
@Excel(name = "安装包类型")
private String sysType;
/** 上传状态 */
private Long uploadingStatus;
/** 日志id */
private Long uploadingLogId;
/** 排序 */
private Long orderNum;
/** 逻辑删除,0:未删除,1:删除 */
private Long isDelete;
/** 创建人 */
@Excel(name = "创建人")
private String created;
/** 更新人 */
private String modified;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setUploadingType(String uploadingType)
{
this.uploadingType = uploadingType;
}
public String getUploadingType()
{
return uploadingType;
}
public void setSysApkName(String sysApkName)
{
this.sysApkName = sysApkName;
}
public String getSysApkName()
{
return sysApkName;
}
public void setVersion(String version)
{
this.version = version;
}
public String getVersion()
{
return version;
}
public void setSysApk(String sysApk)
{
this.sysApk = sysApk;
}
public String getSysApk()
{
return sysApk;
}
public void setSysApkSize(String sysApkSize)
{
this.sysApkSize = sysApkSize;
}
public String getSysApkSize()
{
return sysApkSize;
}
public void setSysType(String sysType)
{
this.sysType = sysType;
}
public String getSysType()
{
return sysType;
}
public void setUploadingStatus(Long uploadingStatus)
{
this.uploadingStatus = uploadingStatus;
}
public Long getUploadingStatus()
{
return uploadingStatus;
}
public void setUploadingLogId(Long uploadingLogId)
{
this.uploadingLogId = uploadingLogId;
}
public Long getUploadingLogId()
{
return uploadingLogId;
}
public void setOrderNum(Long orderNum)
{
this.orderNum = orderNum;
}
public Long getOrderNum()
{
return orderNum;
}
public void setIsDelete(Long isDelete)
{
this.isDelete = isDelete;
}
public Long getIsDelete()
{
return isDelete;
}
public void setCreated(String created)
{
this.created = created;
}
public String getCreated()
{
return created;
}
public void setModified(String modified)
{
this.modified = modified;
}
public String getModified()
{
return modified;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("uploadingType", getUploadingType())
.append("sysApkName", getSysApkName())
.append("version", getVersion())
.append("sysApk", getSysApk())
.append("sysApkSize", getSysApkSize())
.append("sysType", getSysType())
.append("uploadingStatus", getUploadingStatus())
.append("uploadingLogId", getUploadingLogId())
.append("orderNum", getOrderNum())
.append("isDelete", getIsDelete())
.append("created", getCreated())
.append("modified", getModified())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,62 @@
package com.sf.service.deploy.mapper;
import com.sf.service.deploy.domain.SysApkInfo;
import java.util.List;
/**
* 安装包管理Mapper接口
*
* @author ztzh
* @date 2024-04-11
*/
public interface SysApkInfoMapper
{
/**
* 查询安装包管理
*
* @param id 安装包管理主键
* @return 安装包管理
*/
public SysApkInfo selectSysApkInfoById(Long id);
/**
* 查询安装包管理列表
*
* @param sysApkInfo 安装包管理
* @return 安装包管理集合
*/
public List<SysApkInfo> selectSysApkInfoList(SysApkInfo sysApkInfo);
/**
* 新增安装包管理
*
* @param sysApkInfo 安装包管理
* @return 结果
*/
public int insertSysApkInfo(SysApkInfo sysApkInfo);
/**
* 修改安装包管理
*
* @param sysApkInfo 安装包管理
* @return 结果
*/
public int updateSysApkInfo(SysApkInfo sysApkInfo);
/**
* 删除安装包管理
*
* @param id 安装包管理主键
* @return 结果
*/
public int deleteSysApkInfoById(Long id);
/**
* 批量删除安装包管理
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSysApkInfoByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.sf.service.deploy.service;
import java.util.List;
import com.sf.service.deploy.domain.SysApkInfo;
/**
* 安装包管理Service接口
*
* @author ztzh
* @date 2024-04-11
*/
public interface ISysApkInfoService
{
/**
* 查询安装包管理
*
* @param id 安装包管理主键
* @return 安装包管理
*/
public SysApkInfo selectSysApkInfoById(Long id);
/**
* 查询安装包管理列表
*
* @param sysApkInfo 安装包管理
* @return 安装包管理集合
*/
public List<SysApkInfo> selectSysApkInfoList(SysApkInfo sysApkInfo);
/**
* 新增安装包管理
*
* @param sysApkInfo 安装包管理
* @return 结果
*/
public int insertSysApkInfo(SysApkInfo sysApkInfo);
/**
* 修改安装包管理
*
* @param sysApkInfo 安装包管理
* @return 结果
*/
public int updateSysApkInfo(SysApkInfo sysApkInfo);
/**
* 批量删除安装包管理
*
* @param ids 需要删除的安装包管理主键集合
* @return 结果
*/
public int deleteSysApkInfoByIds(Long[] ids);
/**
* 删除安装包管理信息
*
* @param id 安装包管理主键
* @return 结果
*/
public int deleteSysApkInfoById(Long id);
}

View File

@ -0,0 +1,96 @@
package com.sf.service.deploy.service.impl;
import java.util.List;
import com.sf.common.utils.DateUtils;
import com.sf.service.deploy.domain.SysApkInfo;
import com.sf.service.deploy.mapper.SysApkInfoMapper;
import com.sf.service.deploy.service.ISysApkInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 安装包管理Service业务层处理
*
* @author ztzh
* @date 2024-04-11
*/
@Service
public class SysApkInfoServiceImpl implements ISysApkInfoService
{
@Autowired
private SysApkInfoMapper sysApkInfoMapper;
/**
* 查询安装包管理
*
* @param id 安装包管理主键
* @return 安装包管理
*/
@Override
public SysApkInfo selectSysApkInfoById(Long id)
{
return sysApkInfoMapper.selectSysApkInfoById(id);
}
/**
* 查询安装包管理列表
*
* @param sysApkInfo 安装包管理
* @return 安装包管理
*/
@Override
public List<SysApkInfo> selectSysApkInfoList(SysApkInfo sysApkInfo)
{
return sysApkInfoMapper.selectSysApkInfoList(sysApkInfo);
}
/**
* 新增安装包管理
*
* @param sysApkInfo 安装包管理
* @return 结果
*/
@Override
public int insertSysApkInfo(SysApkInfo sysApkInfo)
{
sysApkInfo.setCreateTime(DateUtils.getNowDate());
return sysApkInfoMapper.insertSysApkInfo(sysApkInfo);
}
/**
* 修改安装包管理
*
* @param sysApkInfo 安装包管理
* @return 结果
*/
@Override
public int updateSysApkInfo(SysApkInfo sysApkInfo)
{
sysApkInfo.setUpdateTime(DateUtils.getNowDate());
return sysApkInfoMapper.updateSysApkInfo(sysApkInfo);
}
/**
* 批量删除安装包管理
*
* @param ids 需要删除的安装包管理主键
* @return 结果
*/
@Override
public int deleteSysApkInfoByIds(Long[] ids)
{
return sysApkInfoMapper.deleteSysApkInfoByIds(ids);
}
/**
* 删除安装包管理信息
*
* @param id 安装包管理主键
* @return 结果
*/
@Override
public int deleteSysApkInfoById(Long id)
{
return sysApkInfoMapper.deleteSysApkInfoById(id);
}
}

View File

@ -0,0 +1,105 @@
package com.sf.service.index.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.sf.service.index.domain.ApplyListInfo;
import com.sf.service.index.service.IApplyListInfoService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.sf.common.annotation.Log;
import com.sf.common.core.controller.BaseController;
import com.sf.common.core.domain.AjaxResult;
import com.sf.common.enums.BusinessType;
import com.sf.common.utils.poi.ExcelUtil;
import com.sf.common.core.page.TableDataInfo;
/**
* 应用列Controller
*
* @author ztzh
* @date 2024-04-11
*/
@RestController
@RequestMapping("/index/list")
public class ApplyListInfoController extends BaseController
{
@Autowired
private IApplyListInfoService applyListInfoService;
/**
* 查询应用列列表
*/
@PreAuthorize("@ss.hasPermi('index:list:list')")
@GetMapping("/list")
public TableDataInfo list(ApplyListInfo applyListInfo)
{
startPage();
List<ApplyListInfo> list = applyListInfoService.selectApplyListInfoList(applyListInfo);
return getDataTable(list);
}
/**
* 导出应用列列表
*/
@PreAuthorize("@ss.hasPermi('index:list:export')")
@Log(title = "应用列", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ApplyListInfo applyListInfo)
{
List<ApplyListInfo> list = applyListInfoService.selectApplyListInfoList(applyListInfo);
ExcelUtil<ApplyListInfo> util = new ExcelUtil<ApplyListInfo>(ApplyListInfo.class);
util.exportExcel(response, list, "应用列数据");
}
/**
* 获取应用列详细信息
*/
@PreAuthorize("@ss.hasPermi('index:list:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(applyListInfoService.selectApplyListInfoById(id));
}
/**
* 新增应用列
*/
@PreAuthorize("@ss.hasPermi('index:list:add')")
@Log(title = "应用列", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ApplyListInfo applyListInfo)
{
return toAjax(applyListInfoService.insertApplyListInfo(applyListInfo));
}
/**
* 修改应用列
*/
@PreAuthorize("@ss.hasPermi('index:list:edit')")
@Log(title = "应用列", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ApplyListInfo applyListInfo)
{
return toAjax(applyListInfoService.updateApplyListInfo(applyListInfo));
}
/**
* 删除应用列
*/
@PreAuthorize("@ss.hasPermi('index:list:remove')")
@Log(title = "应用列", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(applyListInfoService.deleteApplyListInfoByIds(ids));
}
}

View File

@ -0,0 +1,153 @@
package com.sf.service.index.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.sf.common.annotation.Excel;
import com.sf.common.core.domain.BaseEntity;
/**
* 应用列对象 APPLY_LIST_INFO
*
* @author ztzh
* @date 2024-04-11
*/
public class ApplyListInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private Long id;
/**
* 应用code
*/
@Excel(name = "应用编号")
private String appCode;
/**
* 应用名称
*/
@Excel(name = "应用名称")
private String appName;
/**
* 应用描述
*/
@Excel(name = "应用描述")
private String appDesc;
/**
* 图片
*/
@Excel(name = "图片")
private String picture;
/**
* 排序
*/
private Long orderNum;
/**
* 逻辑删除,0:未删除,1:删除
*/
private Long isDelete;
/**
* 创建人
*/
private String created;
/**
* 更新人
*/
private String modified;
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public void setAppName(String appName) {
this.appName = appName;
}
public String getAppName() {
return appName;
}
public void setAppDesc(String appDesc) {
this.appDesc = appDesc;
}
public String getAppDesc() {
return appDesc;
}
public void setPicture(String picture) {
this.picture = picture;
}
public String getPicture() {
return picture;
}
public void setOrderNum(Long orderNum) {
this.orderNum = orderNum;
}
public Long getOrderNum() {
return orderNum;
}
public void setIsDelete(Long isDelete) {
this.isDelete = isDelete;
}
public Long getIsDelete() {
return isDelete;
}
public void setCreated(String created) {
this.created = created;
}
public String getCreated() {
return created;
}
public void setModified(String modified) {
this.modified = modified;
}
public String getModified() {
return modified;
}
public void setAppCode(String appCode) {
this.appCode = appCode;
}
public String getAppCode() {
return appCode;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("appCode",getAppCode())
.append("appName", getAppName())
.append("appDesc", getAppDesc())
.append("picture", getPicture())
.append("orderNum", getOrderNum())
.append("isDelete", getIsDelete())
.append("created", getCreated())
.append("modified", getModified())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,62 @@
package com.sf.service.index.mapper;
import com.sf.service.index.domain.ApplyListInfo;
import java.util.List;
/**
* 应用列Mapper接口
*
* @author ztzh
* @date 2024-04-11
*/
public interface ApplyListInfoMapper
{
/**
* 查询应用列
*
* @param id 应用列主键
* @return 应用列
*/
public ApplyListInfo selectApplyListInfoById(Long id);
/**
* 查询应用列列表
*
* @param applyListInfo 应用列
* @return 应用列集合
*/
public List<ApplyListInfo> selectApplyListInfoList(ApplyListInfo applyListInfo);
/**
* 新增应用列
*
* @param applyListInfo 应用列
* @return 结果
*/
public int insertApplyListInfo(ApplyListInfo applyListInfo);
/**
* 修改应用列
*
* @param applyListInfo 应用列
* @return 结果
*/
public int updateApplyListInfo(ApplyListInfo applyListInfo);
/**
* 删除应用列
*
* @param id 应用列主键
* @return 结果
*/
public int deleteApplyListInfoById(Long id);
/**
* 批量删除应用列
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteApplyListInfoByIds(Long[] ids);
}

View File

@ -0,0 +1,62 @@
package com.sf.service.index.service;
import com.sf.service.index.domain.ApplyListInfo;
import java.util.List;
/**
* 应用列Service接口
*
* @author ztzh
* @date 2024-04-11
*/
public interface IApplyListInfoService
{
/**
* 查询应用列
*
* @param id 应用列主键
* @return 应用列
*/
public ApplyListInfo selectApplyListInfoById(Long id);
/**
* 查询应用列列表
*
* @param applyListInfo 应用列
* @return 应用列集合
*/
public List<ApplyListInfo> selectApplyListInfoList(ApplyListInfo applyListInfo);
/**
* 新增应用列
*
* @param applyListInfo 应用列
* @return 结果
*/
public int insertApplyListInfo(ApplyListInfo applyListInfo);
/**
* 修改应用列
*
* @param applyListInfo 应用列
* @return 结果
*/
public int updateApplyListInfo(ApplyListInfo applyListInfo);
/**
* 批量删除应用列
*
* @param ids 需要删除的应用列主键集合
* @return 结果
*/
public int deleteApplyListInfoByIds(Long[] ids);
/**
* 删除应用列信息
*
* @param id 应用列主键
* @return 结果
*/
public int deleteApplyListInfoById(Long id);
}

View File

@ -0,0 +1,98 @@
package com.sf.service.index.service.impl;
import java.util.List;
import com.sf.common.utils.DateUtils;
import com.sf.common.utils.uuid.IdUtils;
import com.sf.service.index.domain.ApplyListInfo;
import com.sf.service.index.mapper.ApplyListInfoMapper;
import com.sf.service.index.service.IApplyListInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 应用列Service业务层处理
*
* @author ztzh
* @date 2024-04-11
*/
@Service
public class ApplyListInfoServiceImpl implements IApplyListInfoService
{
@Autowired
private ApplyListInfoMapper applyListInfoMapper;
/**
* 查询应用列
*
* @param id 应用列主键
* @return 应用列
*/
@Override
public ApplyListInfo selectApplyListInfoById(Long id)
{
return applyListInfoMapper.selectApplyListInfoById(id);
}
/**
* 查询应用列列表
*
* @param applyListInfo 应用列
* @return 应用列
*/
@Override
public List<ApplyListInfo> selectApplyListInfoList(ApplyListInfo applyListInfo)
{
return applyListInfoMapper.selectApplyListInfoList(applyListInfo);
}
/**
* 新增应用列
*
* @param applyListInfo 应用列
* @return 结果
*/
@Override
public int insertApplyListInfo(ApplyListInfo applyListInfo)
{
applyListInfo.setCreateTime(DateUtils.getNowDate());
applyListInfo.setAppCode(IdUtils.randomTime("ZT"));
return applyListInfoMapper.insertApplyListInfo(applyListInfo);
}
/**
* 修改应用列
*
* @param applyListInfo 应用列
* @return 结果
*/
@Override
public int updateApplyListInfo(ApplyListInfo applyListInfo)
{
applyListInfo.setUpdateTime(DateUtils.getNowDate());
return applyListInfoMapper.updateApplyListInfo(applyListInfo);
}
/**
* 批量删除应用列
*
* @param ids 需要删除的应用列主键
* @return 结果
*/
@Override
public int deleteApplyListInfoByIds(Long[] ids)
{
return applyListInfoMapper.deleteApplyListInfoByIds(ids);
}
/**
* 删除应用列信息
*
* @param id 应用列主键
* @return 结果
*/
@Override
public int deleteApplyListInfoById(Long id)
{
return applyListInfoMapper.deleteApplyListInfoById(id);
}
}

View File

@ -0,0 +1,27 @@
package com.sf.service.index.util;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
/**
* 功能描述: 应用工具类
*
* @author a_kun
* @date 2024/4/22 15:48
*/
@Slf4j
@Component
public class AppUtils {
public static String getAppCodeFromRequestHeader(){
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest request = servletRequestAttributes.getRequest();
return request.getHeader("appCode");
}
}

View File

@ -0,0 +1,113 @@
<?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.sf.service.deploy.mapper.SysApkInfoMapper">
<resultMap type="SysApkInfo" id="SysApkInfoResult">
<result property="id" column="id" />
<result property="uploadingType" column="uploading_type" />
<result property="sysApkName" column="sys_apk_name" />
<result property="version" column="version" />
<result property="sysApk" column="sys_apk" />
<result property="sysApkSize" column="sys_apk_size" />
<result property="sysType" column="sys_type" />
<result property="uploadingStatus" column="uploading_status" />
<result property="uploadingLogId" column="uploading_log_id" />
<result property="orderNum" column="order_num" />
<result property="isDelete" column="is_delete" />
<result property="created" column="created" />
<result property="modified" column="modified" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectSysApkInfoVo">
select id, uploading_type, sys_apk_name, version, sys_apk, sys_apk_size, sys_type, uploading_status, uploading_log_id, order_num, is_delete, created, modified, create_time, update_time from SYS_APK_INFO
</sql>
<select id="selectSysApkInfoList" parameterType="SysApkInfo" resultMap="SysApkInfoResult">
<include refid="selectSysApkInfoVo"/>
<where>
<if test="uploadingType != null and uploadingType != ''"> and uploading_type = #{uploadingType}</if>
<if test="sysApkName != null and sysApkName != ''"> and sys_apk_name like concat('%', #{sysApkName}, '%')</if>
<if test="version != null and version != ''"> and version = #{version}</if>
<if test="sysType != null and sysType != ''"> and sys_type = #{sysType}</if>
<if test="uploadingStatus != null "> and uploading_status = #{uploadingStatus}</if>
<if test="created != null and created != ''"> and created = #{created}</if>
</where>
</select>
<select id="selectSysApkInfoById" parameterType="Long" resultMap="SysApkInfoResult">
<include refid="selectSysApkInfoVo"/>
where id = #{id}
</select>
<insert id="insertSysApkInfo" parameterType="SysApkInfo" useGeneratedKeys="true" keyProperty="id">
insert into SYS_APK_INFO
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="uploadingType != null and uploadingType != ''">uploading_type,</if>
<if test="sysApkName != null and sysApkName != ''">sys_apk_name,</if>
<if test="version != null and version != ''">version,</if>
<if test="sysApk != null">sys_apk,</if>
<if test="sysApkSize != null">sys_apk_size,</if>
<if test="sysType != null and sysType != ''">sys_type,</if>
<if test="uploadingStatus != null">uploading_status,</if>
<if test="uploadingLogId != null">uploading_log_id,</if>
<if test="orderNum != null">order_num,</if>
<if test="isDelete != null">is_delete,</if>
<if test="created != null">created,</if>
<if test="modified != null">modified,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="uploadingType != null and uploadingType != ''">#{uploadingType},</if>
<if test="sysApkName != null and sysApkName != ''">#{sysApkName},</if>
<if test="version != null and version != ''">#{version},</if>
<if test="sysApk != null">#{sysApk},</if>
<if test="sysApkSize != null">#{sysApkSize},</if>
<if test="sysType != null and sysType != ''">#{sysType},</if>
<if test="uploadingStatus != null">#{uploadingStatus},</if>
<if test="uploadingLogId != null">#{uploadingLogId},</if>
<if test="orderNum != null">#{orderNum},</if>
<if test="isDelete != null">#{isDelete},</if>
<if test="created != null">#{created},</if>
<if test="modified != null">#{modified},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateSysApkInfo" parameterType="SysApkInfo">
update SYS_APK_INFO
<trim prefix="SET" suffixOverrides=",">
<if test="uploadingType != null and uploadingType != ''">uploading_type = #{uploadingType},</if>
<if test="sysApkName != null and sysApkName != ''">sys_apk_name = #{sysApkName},</if>
<if test="version != null and version != ''">version = #{version},</if>
<if test="sysApk != null">sys_apk = #{sysApk},</if>
<if test="sysApkSize != null">sys_apk_size = #{sysApkSize},</if>
<if test="sysType != null and sysType != ''">sys_type = #{sysType},</if>
<if test="uploadingStatus != null">uploading_status = #{uploadingStatus},</if>
<if test="uploadingLogId != null">uploading_log_id = #{uploadingLogId},</if>
<if test="orderNum != null">order_num = #{orderNum},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="created != null">created = #{created},</if>
<if test="modified != null">modified = #{modified},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSysApkInfoById" parameterType="Long">
delete from SYS_APK_INFO where id = #{id}
</delete>
<delete id="deleteSysApkInfoByIds" parameterType="String">
delete from SYS_APK_INFO where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,92 @@
<?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.sf.service.index.mapper.ApplyListInfoMapper">
<resultMap type="ApplyListInfo" id="ApplyListInfoResult">
<result property="id" column="id" />
<result property="appCode" column="app_code" />
<result property="appName" column="app_name" />
<result property="appDesc" column="app_desc" />
<result property="picture" column="picture" />
<result property="orderNum" column="order_num" />
<result property="isDelete" column="is_delete" />
<result property="created" column="created" />
<result property="modified" column="modified" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectApplyListInfoVo">
select id, app_code, app_name, app_desc, picture, order_num, is_delete, created, modified, create_time, update_time from APPLY_LIST_INFO
</sql>
<select id="selectApplyListInfoList" parameterType="ApplyListInfo" resultMap="ApplyListInfoResult">
<include refid="selectApplyListInfoVo"/>
<where>
<if test="appName != null and appName != ''"> and app_name like concat('%', #{appName}, '%')</if>
</where>
</select>
<select id="selectApplyListInfoById" parameterType="Long" resultMap="ApplyListInfoResult">
<include refid="selectApplyListInfoVo"/>
where id = #{id}
</select>
<insert id="insertApplyListInfo" parameterType="ApplyListInfo" useGeneratedKeys="true" keyProperty="id">
insert into APPLY_LIST_INFO
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="appCode != null and appCode != ''">app_code,</if>
<if test="appName != null and appName != ''">app_name,</if>
<if test="appDesc != null and appDesc != ''">app_desc,</if>
<if test="picture != null">picture,</if>
<if test="orderNum != null">order_num,</if>
<if test="isDelete != null">is_delete,</if>
<if test="created != null">created,</if>
<if test="modified != null">modified,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="appCode != null and appCode != ''">#{appCode},</if>
<if test="appName != null and appName != ''">#{appName},</if>
<if test="appDesc != null and appDesc != ''">#{appDesc},</if>
<if test="picture != null">#{picture},</if>
<if test="orderNum != null">#{orderNum},</if>
<if test="isDelete != null">#{isDelete},</if>
<if test="created != null">#{created},</if>
<if test="modified != null">#{modified},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateApplyListInfo" parameterType="ApplyListInfo">
update APPLY_LIST_INFO
<trim prefix="SET" suffixOverrides=",">
<if test="appCode != null and appCode != ''">app_code = #{appCode},</if>
<if test="appName != null and appName != ''">app_name = #{appName},</if>
<if test="appDesc != null and appDesc != ''">app_desc = #{appDesc},</if>
<if test="picture != null">picture = #{picture},</if>
<if test="orderNum != null">order_num = #{orderNum},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="created != null">created = #{created},</if>
<if test="modified != null">modified = #{modified},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteApplyListInfoById" parameterType="Long">
delete from APPLY_LIST_INFO where id = #{id}
</delete>
<delete id="deleteApplyListInfoByIds" parameterType="String">
delete from APPLY_LIST_INFO where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>