mirror of https://gitee.com/stylefeng/roses
commit
8477dc00d0
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>roses-kernel</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -0,0 +1,85 @@
|
|||
/*
|
||||
* Copyright [2020-2030] [https://www.stylefeng.cn]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
|
||||
*
|
||||
* 1.请不要删除和修改根目录下的LICENSE文件。
|
||||
* 2.请不要删除和修改Guns源码头部的版权声明。
|
||||
* 3.请保留源码和相关描述文件的项目出处,作者声明等。
|
||||
* 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||
* 6.若您的项目无法满足以上几点,可申请商业授权
|
||||
*/
|
||||
package cn.stylefeng.roses.kernel.rule.pojo.response;
|
||||
|
||||
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 返回基类,返回参数可继承此类
|
||||
* <p>
|
||||
* 可以用于封装通用返回包装器
|
||||
* <p>
|
||||
*
|
||||
* @author yxx
|
||||
* @date 2023/03/28 18:08
|
||||
*/
|
||||
@Data
|
||||
public class BaseResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ChineseDescription("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ChineseDescription("创建人")
|
||||
private Long createUser;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
@ChineseDescription("创建人姓名")
|
||||
private String createUserName;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ChineseDescription("更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@ChineseDescription("更新人")
|
||||
private Long updateUser;
|
||||
|
||||
/**
|
||||
* 更新人姓名
|
||||
*/
|
||||
@ChineseDescription("更新人姓名")
|
||||
private String updateUserName;
|
||||
|
||||
}
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-auth</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-auth</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -85,6 +85,8 @@ import org.springframework.stereotype.Service;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.stylefeng.roses.kernel.auth.api.exception.enums.AuthExceptionEnum.AUTH_EXPIRED_ERROR;
|
||||
import static cn.stylefeng.roses.kernel.auth.api.exception.enums.AuthExceptionEnum.TOKEN_PARSE_ERROR;
|
||||
|
@ -293,6 +295,13 @@ public class AuthServiceImpl implements AuthServiceApi {
|
|||
LoginUser loginUser = userLoginInfo.getLoginUser();
|
||||
loginUser.setTenantCode(tenantCode);
|
||||
|
||||
// 设置websocket url
|
||||
String webSocketWsUrl = WebSocketConfigExpander.getWebSocketWsUrl();
|
||||
Map<String, String> params = new HashMap<>(1);
|
||||
params.put("token", token);
|
||||
webSocketWsUrl = StrUtil.format(webSocketWsUrl, params);
|
||||
loginUser.setWsUrl(webSocketWsUrl);
|
||||
|
||||
// 创建用户会话信息
|
||||
sessionManagerApi.updateSession(token, loginUser);
|
||||
} finally {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-auth</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>roses-kernel</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-cache</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-cache</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-cache</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-cache</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>roses-kernel</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-cache</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-config</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-config</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-config</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-config</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-config</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>roses-kernel</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-db</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-db</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-db</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-db</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-db</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>roses-kernel</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-ds-container</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-ds-container</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-ds-container</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-ds-container</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>roses-kernel</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-email</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-email</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-email</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-email</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>roses-kernel</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-file</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* Copyright [2020-2030] [https://www.stylefeng.cn]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
|
||||
*
|
||||
* 1.请不要删除和修改根目录下的LICENSE文件。
|
||||
* 2.请不要删除和修改Guns源码头部的版权声明。
|
||||
* 3.请保留源码和相关描述文件的项目出处,作者声明等。
|
||||
* 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||
* 6.若您的项目无法满足以上几点,可申请商业授权
|
||||
*/
|
||||
package cn.stylefeng.roses.kernel.file.api;
|
||||
|
||||
import cn.stylefeng.roses.kernel.file.api.pojo.response.SysFileInfoResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文件业务信息绑定的API
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2023/3/31 13:38
|
||||
*/
|
||||
public interface FileBusinessApi {
|
||||
|
||||
/**
|
||||
* 添加业务和文件的绑定
|
||||
*
|
||||
* @param businessCode 业务编码
|
||||
* @param businessId 业务id
|
||||
* @param fileIdList 文件id集合
|
||||
* @author fengshuonan
|
||||
* @date 2023/3/31 13:43
|
||||
*/
|
||||
void addFileBusinessBind(String businessCode, Long businessId, List<Long> fileIdList);
|
||||
|
||||
/**
|
||||
* 获取业务绑定的文件列表信息
|
||||
*
|
||||
* @param businessId 业务id
|
||||
* @return 文件的信息,不包含文件本身的字节信息
|
||||
* @author fengshuonan
|
||||
* @date 2020/11/29 16:26
|
||||
*/
|
||||
List<SysFileInfoResponse> getBusinessFileInfoList(Long businessId);
|
||||
|
||||
/**
|
||||
* 新增文件下载次数
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2023/3/31 14:23
|
||||
*/
|
||||
void addFileDownloadCount(Long businessId, Long fileId);
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package cn.stylefeng.roses.kernel.file.api.format;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.stylefeng.roses.kernel.file.api.FileInfoApi;
|
||||
import cn.stylefeng.roses.kernel.rule.format.BaseSimpleFieldFormatProcess;
|
||||
|
||||
/**
|
||||
* Json响应,针对返回的文件信息,响应一个文件的具体url
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2023/3/28 9:30
|
||||
*/
|
||||
public class FileUrlFormatProcess extends BaseSimpleFieldFormatProcess {
|
||||
|
||||
@Override
|
||||
public Class<?> getItemClass() {
|
||||
return Long.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object simpleItemFormat(Object businessId) {
|
||||
FileInfoApi fileInfoApi = SpringUtil.getBean(FileInfoApi.class);
|
||||
return fileInfoApi.getFileUnAuthUrl(Convert.toLong(businessId));
|
||||
}
|
||||
|
||||
}
|
|
@ -27,6 +27,8 @@ package cn.stylefeng.roses.kernel.file.api.pojo.response;
|
|||
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 文件信息结果集
|
||||
*
|
||||
|
@ -130,4 +132,22 @@ public class SysFileInfoResponse {
|
|||
@ChineseDescription("文件访问路径")
|
||||
private String fileUrl;
|
||||
|
||||
/**
|
||||
* 下载次数
|
||||
*/
|
||||
@ChineseDescription("下载次数")
|
||||
private Integer downloadCount;
|
||||
|
||||
/**
|
||||
* 上传人id
|
||||
*/
|
||||
@ChineseDescription("上传人id")
|
||||
private Long uploadUserId;
|
||||
|
||||
/**
|
||||
* 上传时间
|
||||
*/
|
||||
@ChineseDescription("上传时间")
|
||||
private Date uploadTime;
|
||||
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-file</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -24,6 +24,13 @@
|
|||
<version>${roses.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--格式化用户id展示姓名使用-->
|
||||
<dependency>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>system-api</artifactId>
|
||||
<version>${roses.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--资源api模块-->
|
||||
<!--用在资源控制器,资源扫描上-->
|
||||
<dependency>
|
||||
|
|
|
@ -0,0 +1,99 @@
|
|||
/*
|
||||
* Copyright [2020-2030] [https://www.stylefeng.cn]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
|
||||
*
|
||||
* 1.请不要删除和修改根目录下的LICENSE文件。
|
||||
* 2.请不要删除和修改Guns源码头部的版权声明。
|
||||
* 3.请保留源码和相关描述文件的项目出处,作者声明等。
|
||||
* 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||
* 6.若您的项目无法满足以上几点,可申请商业授权
|
||||
*/
|
||||
package cn.stylefeng.roses.kernel.file.modular.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.stylefeng.roses.kernel.file.api.pojo.response.SysFileInfoResponse;
|
||||
import cn.stylefeng.roses.kernel.file.modular.pojo.request.SysFileBusinessRequest;
|
||||
import cn.stylefeng.roses.kernel.file.modular.pojo.vo.SysFileInfoRes;
|
||||
import cn.stylefeng.roses.kernel.file.modular.service.SysFileBusinessService;
|
||||
import cn.stylefeng.roses.kernel.rule.enums.ResBizTypeEnum;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.PostResource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文件和业务绑定的接口
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2023/3/31 15:31
|
||||
*/
|
||||
@RestController
|
||||
@ApiResource(name = "文件和业务绑定的接口", resBizType = ResBizTypeEnum.SYSTEM)
|
||||
public class SysFileBusinessController {
|
||||
|
||||
@Resource
|
||||
private SysFileBusinessService sysFileBusinessService;
|
||||
|
||||
/**
|
||||
* 增加文件下载次数
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2023/3/31 15:31
|
||||
*/
|
||||
@PostResource(name = "增加文件下载次数", path = "/sysFileInfo/addFileDownloadCount", requiredPermission = false, requiredLogin = false)
|
||||
public ResponseData<?> upload(@RequestBody @Validated(SysFileBusinessRequest.addFileDownloadCount.class) SysFileBusinessRequest sysFileBusinessRequest) {
|
||||
sysFileBusinessService.addFileDownloadCount(sysFileBusinessRequest.getBusinessId(), sysFileBusinessRequest.getFileId());
|
||||
return new SuccessResponseData<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取业务关联的文件信息列表
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2023/4/5 16:00
|
||||
*/
|
||||
@GetResource(name = "获取业务关联的文件信息列表", path = "/sysFileInfo/getBusinessFileList")
|
||||
public ResponseData<List<SysFileInfoRes>> getBusinessFileList(@Validated(SysFileBusinessRequest.getBusinessFileList.class) SysFileBusinessRequest sysFileBusinessRequest) {
|
||||
List<SysFileInfoResponse> list = sysFileBusinessService.getBusinessFileInfoList(sysFileBusinessRequest.getBusinessId());
|
||||
List<SysFileInfoRes> sysFileInfoRes = BeanUtil.copyToList(list, SysFileInfoRes.class);
|
||||
return new SuccessResponseData<>(sysFileInfoRes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增绑定业务和文件
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2023/4/4 20:56
|
||||
*/
|
||||
@PostResource(name = "新增绑定业务和文件", path = "/sysFileInfo/bindFile")
|
||||
public ResponseData<?> bindFile(@RequestBody @Validated(SysFileBusinessRequest.bindFile.class) SysFileBusinessRequest sysFileBusinessRequest) {
|
||||
sysFileBusinessService.addFileBusinessBind(
|
||||
sysFileBusinessRequest.getBusinessCode(),
|
||||
sysFileBusinessRequest.getBusinessId(),
|
||||
ListUtil.list(false, sysFileBusinessRequest.getFileId()));
|
||||
return new SuccessResponseData<>();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
package cn.stylefeng.roses.kernel.file.modular.entity;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseEntity;
|
||||
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 业务关联的文件实例类
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2023/03/31 13:30
|
||||
*/
|
||||
@TableName("sys_file_business")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysFileBusiness extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "file_business_id", type = IdType.ASSIGN_ID)
|
||||
@ChineseDescription("主键id")
|
||||
private Long fileBusinessId;
|
||||
|
||||
/**
|
||||
* 业务的编码,业务自定义
|
||||
*/
|
||||
@TableField("business_code")
|
||||
@ChineseDescription("业务的编码,业务自定义")
|
||||
private String businessCode;
|
||||
|
||||
/**
|
||||
* 业务主键id
|
||||
*/
|
||||
@TableField("business_id")
|
||||
@ChineseDescription("业务主键id")
|
||||
private Long businessId;
|
||||
|
||||
/**
|
||||
* 关联文件表的id
|
||||
*/
|
||||
@TableField("file_id")
|
||||
@ChineseDescription("关联文件表的id")
|
||||
private Long fileId;
|
||||
|
||||
/**
|
||||
* 下载次数
|
||||
*/
|
||||
@TableField("download_count")
|
||||
@ChineseDescription("下载次数")
|
||||
private Integer downloadCount;
|
||||
|
||||
/**
|
||||
* 租户id
|
||||
*/
|
||||
@TableField("tenant_id")
|
||||
@ChineseDescription("租户id")
|
||||
private Long tenantId;
|
||||
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package cn.stylefeng.roses.kernel.file.modular.enums;
|
||||
|
||||
import cn.stylefeng.roses.kernel.rule.constants.RuleConstants;
|
||||
import cn.stylefeng.roses.kernel.rule.exception.AbstractExceptionEnum;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 业务关联的文件异常相关枚举
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2023/03/31 13:30
|
||||
*/
|
||||
@Getter
|
||||
public enum SysFileBusinessExceptionEnum implements AbstractExceptionEnum {
|
||||
|
||||
/**
|
||||
* 查询结果不存在
|
||||
*/
|
||||
SYS_FILE_BUSINESS_NOT_EXISTED(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10001", "查询结果不存在");
|
||||
|
||||
/**
|
||||
* 错误编码
|
||||
*/
|
||||
private final String errorCode;
|
||||
|
||||
/**
|
||||
* 提示用户信息
|
||||
*/
|
||||
private final String userTip;
|
||||
|
||||
SysFileBusinessExceptionEnum(String errorCode, String userTip) {
|
||||
this.errorCode = errorCode;
|
||||
this.userTip = userTip;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package cn.stylefeng.roses.kernel.file.modular.mapper;
|
||||
|
||||
import cn.stylefeng.roses.kernel.file.modular.entity.SysFileBusiness;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* 业务关联的文件 Mapper 接口
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2023/03/31 13:30
|
||||
*/
|
||||
public interface SysFileBusinessMapper extends BaseMapper<SysFileBusiness> {
|
||||
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
<?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="cn.stylefeng.roses.kernel.file.modular.mapper.SysFileBusinessMapper">
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
package cn.stylefeng.roses.kernel.file.modular.pojo.request;
|
||||
|
||||
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 业务关联的文件封装类
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2023/03/31 13:30
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class SysFileBusinessRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@NotNull(message = "主键id不能为空", groups = {edit.class, delete.class})
|
||||
@ChineseDescription("主键id")
|
||||
private Long fileBusinessId;
|
||||
|
||||
/**
|
||||
* 业务的编码,业务自定义
|
||||
*/
|
||||
@ChineseDescription("业务的编码,业务自定义")
|
||||
@NotBlank(message = "业务的编码不能为空", groups = {bindFile.class})
|
||||
private String businessCode;
|
||||
|
||||
/**
|
||||
* 业务主键id
|
||||
*/
|
||||
@ChineseDescription("业务主键id")
|
||||
@NotNull(message = "业务主键id不能为空", groups = {addFileDownloadCount.class, getBusinessFileList.class, bindFile.class})
|
||||
private Long businessId;
|
||||
|
||||
/**
|
||||
* 关联文件表的id
|
||||
*/
|
||||
@ChineseDescription("关联文件表的id")
|
||||
@NotNull(message = "文件id不能为空", groups = {addFileDownloadCount.class, bindFile.class})
|
||||
private Long fileId;
|
||||
|
||||
/**
|
||||
* 下载次数
|
||||
*/
|
||||
@ChineseDescription("下载次数")
|
||||
private Integer downloadCount;
|
||||
|
||||
/**
|
||||
* 租户id
|
||||
*/
|
||||
@ChineseDescription("租户id")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 添加文件下载次数
|
||||
*/
|
||||
public @interface addFileDownloadCount {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取业务关联的文件信息列表
|
||||
*/
|
||||
public @interface getBusinessFileList {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务数据绑定文件
|
||||
*/
|
||||
public @interface bindFile {
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* Copyright [2020-2030] [https://www.stylefeng.cn]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
|
||||
*
|
||||
* 1.请不要删除和修改根目录下的LICENSE文件。
|
||||
* 2.请不要删除和修改Guns源码头部的版权声明。
|
||||
* 3.请保留源码和相关描述文件的项目出处,作者声明等。
|
||||
* 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns
|
||||
* 6.若您的项目无法满足以上几点,可申请商业授权
|
||||
*/
|
||||
package cn.stylefeng.roses.kernel.file.modular.pojo.vo;
|
||||
|
||||
import cn.stylefeng.roses.kernel.file.api.pojo.response.SysFileInfoResponse;
|
||||
import cn.stylefeng.roses.kernel.rule.annotation.SimpleFieldFormat;
|
||||
import cn.stylefeng.roses.kernel.rule.enums.FormatTypeEnum;
|
||||
import cn.stylefeng.roses.kernel.system.api.format.UserFormatProcess;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 文件信息结果集
|
||||
*
|
||||
* @author stylefeng
|
||||
* @date 2020/6/7 22:15
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class SysFileInfoRes extends SysFileInfoResponse {
|
||||
|
||||
@Override
|
||||
@SimpleFieldFormat(formatType = FormatTypeEnum.ADD_FIELD, processClass = UserFormatProcess.class)
|
||||
public Long getUploadUserId() {
|
||||
return super.getUploadUserId();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package cn.stylefeng.roses.kernel.file.modular.service;
|
||||
|
||||
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
||||
import cn.stylefeng.roses.kernel.file.api.FileBusinessApi;
|
||||
import cn.stylefeng.roses.kernel.file.modular.entity.SysFileBusiness;
|
||||
import cn.stylefeng.roses.kernel.file.modular.pojo.request.SysFileBusinessRequest;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务关联的文件 服务类
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2023/03/31 13:30
|
||||
*/
|
||||
public interface SysFileBusinessService extends IService<SysFileBusiness>, FileBusinessApi {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param sysFileBusinessRequest 请求参数
|
||||
* @author fengshuonan
|
||||
* @date 2023/03/31 13:30
|
||||
*/
|
||||
void add(SysFileBusinessRequest sysFileBusinessRequest);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param sysFileBusinessRequest 请求参数
|
||||
* @author fengshuonan
|
||||
* @date 2023/03/31 13:30
|
||||
*/
|
||||
void del(SysFileBusinessRequest sysFileBusinessRequest);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param sysFileBusinessRequest 请求参数
|
||||
* @author fengshuonan
|
||||
* @date 2023/03/31 13:30
|
||||
*/
|
||||
void edit(SysFileBusinessRequest sysFileBusinessRequest);
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*
|
||||
* @param sysFileBusinessRequest 请求参数
|
||||
* @author fengshuonan
|
||||
* @date 2023/03/31 13:30
|
||||
*/
|
||||
SysFileBusiness detail(SysFileBusinessRequest sysFileBusinessRequest);
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
*
|
||||
* @param sysFileBusinessRequest 请求参数
|
||||
* @return List<SysFileBusiness> 返回结果
|
||||
* @author fengshuonan
|
||||
* @date 2023/03/31 13:30
|
||||
*/
|
||||
List<SysFileBusiness> findList(SysFileBusinessRequest sysFileBusinessRequest);
|
||||
|
||||
/**
|
||||
* 获取列表(带分页)
|
||||
*
|
||||
* @param sysFileBusinessRequest 请求参数
|
||||
* @return PageResult<SysFileBusiness> 返回结果
|
||||
* @author fengshuonan
|
||||
* @date 2023/03/31 13:30
|
||||
*/
|
||||
PageResult<SysFileBusiness> findPage(SysFileBusinessRequest sysFileBusinessRequest);
|
||||
|
||||
}
|
|
@ -0,0 +1,173 @@
|
|||
package cn.stylefeng.roses.kernel.file.modular.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.stylefeng.roses.kernel.db.api.factory.PageFactory;
|
||||
import cn.stylefeng.roses.kernel.db.api.factory.PageResultFactory;
|
||||
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
||||
import cn.stylefeng.roses.kernel.file.api.FileInfoApi;
|
||||
import cn.stylefeng.roses.kernel.file.api.pojo.response.SysFileInfoResponse;
|
||||
import cn.stylefeng.roses.kernel.file.modular.entity.SysFileBusiness;
|
||||
import cn.stylefeng.roses.kernel.file.modular.enums.SysFileBusinessExceptionEnum;
|
||||
import cn.stylefeng.roses.kernel.file.modular.mapper.SysFileBusinessMapper;
|
||||
import cn.stylefeng.roses.kernel.file.modular.pojo.request.SysFileBusinessRequest;
|
||||
import cn.stylefeng.roses.kernel.file.modular.service.SysFileBusinessService;
|
||||
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务关联的文件业务实现层
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2023/03/31 13:30
|
||||
*/
|
||||
@Service
|
||||
public class SysFileBusinessServiceImpl extends ServiceImpl<SysFileBusinessMapper, SysFileBusiness> implements SysFileBusinessService {
|
||||
|
||||
@Resource
|
||||
private FileInfoApi fileInfoApi;
|
||||
|
||||
@Override
|
||||
public void add(SysFileBusinessRequest sysFileBusinessRequest) {
|
||||
SysFileBusiness sysFileBusiness = new SysFileBusiness();
|
||||
BeanUtil.copyProperties(sysFileBusinessRequest, sysFileBusiness);
|
||||
this.save(sysFileBusiness);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void del(SysFileBusinessRequest sysFileBusinessRequest) {
|
||||
SysFileBusiness sysFileBusiness = this.querySysFileBusiness(sysFileBusinessRequest);
|
||||
this.removeById(sysFileBusiness.getFileBusinessId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(SysFileBusinessRequest sysFileBusinessRequest) {
|
||||
SysFileBusiness sysFileBusiness = this.querySysFileBusiness(sysFileBusinessRequest);
|
||||
BeanUtil.copyProperties(sysFileBusinessRequest, sysFileBusiness);
|
||||
this.updateById(sysFileBusiness);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysFileBusiness detail(SysFileBusinessRequest sysFileBusinessRequest) {
|
||||
return this.querySysFileBusiness(sysFileBusinessRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<SysFileBusiness> findPage(SysFileBusinessRequest sysFileBusinessRequest) {
|
||||
LambdaQueryWrapper<SysFileBusiness> wrapper = createWrapper(sysFileBusinessRequest);
|
||||
Page<SysFileBusiness> sysRolePage = this.page(PageFactory.defaultPage(), wrapper);
|
||||
return PageResultFactory.createPageResult(sysRolePage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysFileBusiness> findList(SysFileBusinessRequest sysFileBusinessRequest) {
|
||||
LambdaQueryWrapper<SysFileBusiness> wrapper = this.createWrapper(sysFileBusinessRequest);
|
||||
return this.list(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addFileBusinessBind(String businessCode, Long businessId, List<Long> fileIdList) {
|
||||
|
||||
if (ObjectUtil.isEmpty(fileIdList) || ObjectUtil.isEmpty(businessCode) || ObjectUtil.isEmpty(businessId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
ArrayList<SysFileBusiness> sysFileBusinesses = new ArrayList<>();
|
||||
for (Long fileId : fileIdList) {
|
||||
SysFileBusiness sysFileBusiness = new SysFileBusiness();
|
||||
sysFileBusiness.setBusinessCode(businessCode);
|
||||
sysFileBusiness.setBusinessId(businessId);
|
||||
sysFileBusiness.setFileId(fileId);
|
||||
sysFileBusinesses.add(sysFileBusiness);
|
||||
}
|
||||
|
||||
this.saveBatch(sysFileBusinesses);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysFileInfoResponse> getBusinessFileInfoList(Long businessId) {
|
||||
|
||||
// 获取业务下绑定的文件列表
|
||||
LambdaQueryWrapper<SysFileBusiness> sysFileBusinessLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
sysFileBusinessLambdaQueryWrapper.eq(SysFileBusiness::getBusinessId, businessId);
|
||||
List<SysFileBusiness> list = this.list(sysFileBusinessLambdaQueryWrapper);
|
||||
|
||||
if (ObjectUtil.isEmpty(list)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
// 填充文件的详细信息
|
||||
ArrayList<SysFileInfoResponse> sysFileInfoResponses = new ArrayList<>();
|
||||
for (SysFileBusiness sysFileBusiness : list) {
|
||||
|
||||
// 获取每个文件的详情
|
||||
Long fileId = sysFileBusiness.getFileId();
|
||||
SysFileInfoResponse fileInfoWithoutContent = fileInfoApi.getFileInfoWithoutContent(fileId);
|
||||
if (fileInfoWithoutContent != null) {
|
||||
// 设置下载次数
|
||||
fileInfoWithoutContent.setDownloadCount(sysFileBusiness.getDownloadCount());
|
||||
|
||||
// 设置上传人id
|
||||
fileInfoWithoutContent.setUploadUserId(sysFileBusiness.getCreateUser());
|
||||
|
||||
// 设置上传时间
|
||||
fileInfoWithoutContent.setUploadTime(sysFileBusiness.getCreateTime());
|
||||
sysFileInfoResponses.add(fileInfoWithoutContent);
|
||||
}
|
||||
}
|
||||
|
||||
return sysFileInfoResponses;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addFileDownloadCount(Long businessId, Long fileId) {
|
||||
|
||||
LambdaQueryWrapper<SysFileBusiness> sysFileBusinessLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
sysFileBusinessLambdaQueryWrapper.eq(SysFileBusiness::getBusinessId, businessId);
|
||||
sysFileBusinessLambdaQueryWrapper.eq(SysFileBusiness::getFileId, fileId);
|
||||
SysFileBusiness sysFileBusiness = this.getOne(sysFileBusinessLambdaQueryWrapper, false);
|
||||
|
||||
if (sysFileBusiness != null) {
|
||||
sysFileBusiness.setDownloadCount(sysFileBusiness.getDownloadCount() + 1);
|
||||
this.updateById(sysFileBusiness);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取信息
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2023/03/31 13:30
|
||||
*/
|
||||
private SysFileBusiness querySysFileBusiness(SysFileBusinessRequest sysFileBusinessRequest) {
|
||||
SysFileBusiness sysFileBusiness = this.getById(sysFileBusinessRequest.getFileBusinessId());
|
||||
if (ObjectUtil.isEmpty(sysFileBusiness)) {
|
||||
throw new ServiceException(SysFileBusinessExceptionEnum.SYS_FILE_BUSINESS_NOT_EXISTED);
|
||||
}
|
||||
return sysFileBusiness;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建查询wrapper
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2023/03/31 13:30
|
||||
*/
|
||||
private LambdaQueryWrapper<SysFileBusiness> createWrapper(SysFileBusinessRequest sysFileBusinessRequest) {
|
||||
LambdaQueryWrapper<SysFileBusiness> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
Long businessId = sysFileBusinessRequest.getBusinessId();
|
||||
queryWrapper.eq(ObjectUtil.isNotNull(businessId), SysFileBusiness::getBusinessId, businessId);
|
||||
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
}
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-file</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-file</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-file</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-file</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-file</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>roses-kernel</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-groovy</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-groovy</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-groovy</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>roses-kernel</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-i18n</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-i18n</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-i18n</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-i18n</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>roses-kernel</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-jwt</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-jwt</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-jwt</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>roses-kernel</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-log</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-log</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-log</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-log</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-log</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-log</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-log</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>roses-kernel</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-mongodb</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mongodb-api</artifactId>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-mongodb</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mongodb-integration-beetl</artifactId>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-mongodb</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mongodb-sdk-file</artifactId>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-mongodb</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mongodb-sdk-springboot</artifactId>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-mongodb</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>mongodb-spring-boot-starter</artifactId>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>roses-kernel</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>kernel-d-mongodb</artifactId>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-office</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-office</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-office</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>roses-kernel</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>kernel-d-openapi</artifactId>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>kernel-d-openapi</artifactId>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>kernel-d-openapi</artifactId>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>roses-kernel</artifactId>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-pinyin</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-pinyin</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-pinyin</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>roses-kernel</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>roses-kernel</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-scanner</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-scanner</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-scanner</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>roses-kernel</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>kernel-d-seata</artifactId>
|
||||
<version>7.3.3</version>
|
||||
<version>7.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue