桩固件信息表新增 “url”、“使用范围”字段

This commit is contained in:
Lemon
2024-11-20 16:51:59 +08:00
parent c52e8137f8
commit 95f4efcdd0
8 changed files with 79 additions and 19 deletions

View File

@@ -5,12 +5,15 @@ import com.jsowell.common.core.controller.BaseController;
import com.jsowell.common.core.domain.AjaxResult;
import com.jsowell.common.core.page.TableDataInfo;
import com.jsowell.common.enums.BusinessType;
import com.jsowell.common.response.RestApiResponse;
import com.jsowell.common.util.file.AliyunOssUploadUtils;
import com.jsowell.common.util.poi.ExcelUtil;
import com.jsowell.pile.domain.PileFirmwareInfo;
import com.jsowell.pile.service.PileFirmwareInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@@ -88,4 +91,19 @@ public class PileFirmwareInfoController extends BaseController {
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(pileFirmwareInfoService.deletePileFirmwareInfoByIds(ids));
}
/**
* 上传蓝牙升级程序
* @param file
* @return
*/
@PostMapping("/uploadBlueToothFile")
public AjaxResult uploadBlueToothFile(@RequestParam("avatarfile") MultipartFile file) {
if (!file.isEmpty()) {
String result = AliyunOssUploadUtils.uploadBlueToothFile(file);
return AjaxResult.success();
}
return AjaxResult.error("上传文件错误!!");
}
}

View File

@@ -141,6 +141,8 @@ aliyunoss:
bucketName: ydc-oss-dev
# bucket下文件夹的路径
filehost: img
# 蓝牙小程序文件保存路径
bluetoothFileHost: bluetooth
# 访问域名
# url: https://ydc-oss-dev.oss-cn-shanghai.aliyuncs.com
url: http://img.sit.jsowellcloud.com

View File

@@ -140,6 +140,8 @@ aliyunoss:
bucketName: ydc-oss-prod
# bucket下文件夹的路径
filehost: img
# 蓝牙小程序文件保存路径
bluetoothFileHost: bluetooth
# 访问域名
# url: https://ydc-oss-prod.oss-cn-shanghai.aliyuncs.com
url: https://img.jsowellcloud.com

View File

@@ -140,6 +140,8 @@ aliyunoss:
bucketName: ydc-oss-prod
# bucket下文件夹的路径
filehost: img
# 蓝牙小程序文件保存路径
bluetoothFileHost: bluetooth
# 访问域名
# url: https://ydc-oss-prod.oss-cn-shanghai.aliyuncs.com
url: https://img.jsowellcloud.com

View File

@@ -140,6 +140,8 @@ aliyunoss:
bucketName: ydc-oss-dev
# bucket下文件夹的路径
filehost: img
# 蓝牙小程序文件保存路径
bluetoothFileHost: bluetooth
# 访问域名
# url: https://ydc-oss-dev.oss-cn-shanghai.aliyuncs.com
url: http://img.sit.jsowellcloud.com

View File

@@ -1,5 +1,6 @@
package com.jsowell.common.config;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@@ -31,6 +32,11 @@ public class AliyunOssConfig {
*/
private String filehost;
/**
* 蓝牙小程序文件路径
*/
private String bluetoothFileHost;
/**
* 访问域名
*/
@@ -76,6 +82,14 @@ public class AliyunOssConfig {
this.filehost = filehost;
}
public String getBluetoothFileHost() {
return bluetoothFileHost;
}
public void setBluetoothFileHost(String bluetoothFileHost) {
this.bluetoothFileHost = bluetoothFileHost;
}
public String getUrl() {
return url;
}
@@ -86,13 +100,14 @@ public class AliyunOssConfig {
@Override
public String toString() {
return "AliyunOssConfig{" +
"endpoint='" + endpoint + '\'' +
", accessKeyId='" + accessKeyId + '\'' +
", accessKeySecret='" + accessKeySecret + '\'' +
", bucketName='" + bucketName + '\'' +
", filehost='" + filehost + '\'' +
", url='" + url + '\'' +
'}';
return new ToStringBuilder(this)
.append("endpoint", endpoint)
.append("accessKeyId", accessKeyId)
.append("accessKeySecret", accessKeySecret)
.append("bucketName", bucketName)
.append("filehost", filehost)
.append("bluetoothFileHost", bluetoothFileHost)
.append("url", url)
.toString();
}
}

View File

@@ -47,6 +47,18 @@ public class PileFirmwareInfo extends BaseEntity {
@Excel(name = "适用类型")
private String applyType;
/**
* 使用范围
*/
@Excel(name = "使用范围")
private String useRange;
/**
* 下载链接url
*/
@Excel(name = "下载链接url")
private String downloadUrl;
/**
* 删除标识0-正常1-删除)
*/
@@ -54,16 +66,15 @@ public class PileFirmwareInfo extends BaseEntity {
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.JSON_STYLE)
.append("id", getId())
.append("name", getName())
.append("desc", getDescription())
.append("filePath", getFilePath())
.append("createTime", getCreateTime())
.append("createBy", getCreateBy())
.append("updateTime", getUpdateTime())
.append("updateBy", getUpdateBy())
.append("delFlag", getDelFlag())
return new ToStringBuilder(this)
.append("id", id)
.append("name", name)
.append("description", description)
.append("filePath", filePath)
.append("applyType", applyType)
.append("useRange", useRange)
.append("downloadUrl", downloadUrl)
.append("delFlag", delFlag)
.toString();
}
}

View File

@@ -10,6 +10,8 @@
<result property="description" column="description" />
<result property="filePath" column="file_path" />
<result property="applyType" column="apply_type" />
<result property="useRange" column="use_range" />
<result property="downloadUrl" column="download_url" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
@@ -18,7 +20,7 @@
</resultMap>
<sql id="selectPileFirmwareInfoVo">
select id, name, description, file_path, apply_type, create_time, create_by, update_time, update_by, del_flag from pile_firmware_info
select id, name, description, file_path, apply_type, use_range, download_url, create_time, create_by, update_time, update_by, del_flag from pile_firmware_info
</sql>
<select id="selectPileFirmwareInfoList" parameterType="com.jsowell.pile.domain.PileFirmwareInfo" resultMap="PileFirmwareInfoResult">
@@ -41,6 +43,8 @@
<if test="description != null">description,</if>
<if test="filePath != null">file_path,</if>
<if test="applyType != null">apply_type,</if>
<if test="useRange != null">use_range,</if>
<if test="downloadUrl != null">download_url,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
@@ -53,6 +57,8 @@
<if test="description != null">#{description},</if>
<if test="filePath != null">#{filePath},</if>
<if test="applyType != null">#{applyType},</if>
<if test="useRange != null">#{useRange},</if>
<if test="downloadUrl != null">#{downloadUrl},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
@@ -68,6 +74,8 @@
<if test="description != null">description = #{description},</if>
<if test="filePath != null">file_path = #{filePath},</if>
<if test="applyType != null">apply_type = #{applyType},</if>
<if test="useRange != null">use_range = #{useRange},</if>
<if test="downloadUrl != null">download_url = #{downloadUrl},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>