| @@ -2,5 +2,7 @@ | |||||
| scp xueyi-modules/xueyi-system/target/xueyi-modules-system.jar root@39.107.77.235:/tmp | scp xueyi-modules/xueyi-system/target/xueyi-modules-system.jar root@39.107.77.235:/tmp | ||||
| docker cp /tmp/xueyi-modules-system.jar xueyi-modules-system:/home/xueyi | |||||
| docker restart xueyi-modules-system | |||||
| #服务器执行以下命令 | |||||
| # | |||||
| # docker cp /tmp/xueyi-modules-system.jar xueyi-modules-system:/home/xueyi | |||||
| # docker restart xueyi-modules-system | |||||
| @@ -41,6 +41,7 @@ public class HeaderInterceptor implements AsyncHandlerInterceptor { | |||||
| String token = SecurityUtils.getToken(); | String token = SecurityUtils.getToken(); | ||||
| System.err.println(SecurityUtils.getAccountType()); | |||||
| if (StrUtil.isNotEmpty(token)) { | if (StrUtil.isNotEmpty(token)) { | ||||
| TenantConstants.AccountType accountType = TenantConstants.AccountType.getByCode(SecurityUtils.getAccountType()); | TenantConstants.AccountType accountType = TenantConstants.AccountType.getByCode(SecurityUtils.getAccountType()); | ||||
| if(ObjectUtil.isNotNull(accountType)) { | if(ObjectUtil.isNotNull(accountType)) { | ||||
| @@ -1,6 +1,5 @@ | |||||
| package com.xueyi.system.intercepts; | package com.xueyi.system.intercepts; | ||||
| import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; | |||||
| import org.springframework.context.annotation.Bean; | import org.springframework.context.annotation.Bean; | ||||
| import org.springframework.context.annotation.Configuration; | import org.springframework.context.annotation.Configuration; | ||||
| @@ -18,4 +18,5 @@ public class DmMeetingRoomsDto extends DmMeetingRoomsPo { | |||||
| @Serial | @Serial | ||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| } | } | ||||
| @@ -1,17 +1,14 @@ | |||||
| package com.xueyi.system.meeting.domain.po; | package com.xueyi.system.meeting.domain.po; | ||||
| import com.xueyi.common.core.web.tenant.base.TBaseEntity; | |||||
| import com.xueyi.system.meeting.domain.dto.DmMeetingRoomsDto; | |||||
| import com.xueyi.common.core.annotation.Excel; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import com.xueyi.common.core.annotation.Excel; | |||||
| import com.xueyi.common.core.web.tenant.base.TBaseEntity; | |||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||
| import java.io.Serial; | import java.io.Serial; | ||||
| import static com.xueyi.common.core.constant.basic.EntityConstants.STATUS; | |||||
| import static com.xueyi.common.core.constant.basic.EntityConstants.SORT; | |||||
| import static com.xueyi.common.core.constant.basic.EntityConstants.REMARK; | |||||
| import static com.xueyi.common.core.constant.basic.EntityConstants.*; | |||||
| /** | /** | ||||
| * 会议室 持久化对象 | * 会议室 持久化对象 | ||||
| @@ -10,4 +10,6 @@ import com.xueyi.common.web.entity.manager.IBaseManager; | |||||
| * @author xueyi | * @author xueyi | ||||
| */ | */ | ||||
| public interface IDmMeetingRoomsManager extends IBaseManager<DmMeetingRoomsQuery, DmMeetingRoomsDto> { | public interface IDmMeetingRoomsManager extends IBaseManager<DmMeetingRoomsQuery, DmMeetingRoomsDto> { | ||||
| public DmMeetingRoomsDto getDeptName(DmMeetingRoomsDto dto); | |||||
| } | } | ||||
| @@ -7,6 +7,9 @@ import com.xueyi.system.meeting.domain.query.DmMeetingRoomsQuery; | |||||
| import com.xueyi.system.meeting.domain.model.DmMeetingRoomsConverter; | import com.xueyi.system.meeting.domain.model.DmMeetingRoomsConverter; | ||||
| import com.xueyi.system.meeting.mapper.DmMeetingRoomsMapper; | import com.xueyi.system.meeting.mapper.DmMeetingRoomsMapper; | ||||
| import com.xueyi.system.meeting.manager.IDmMeetingRoomsManager; | import com.xueyi.system.meeting.manager.IDmMeetingRoomsManager; | ||||
| import com.xueyi.system.organize.manager.impl.SysDeptManagerImpl; | |||||
| import com.xueyi.system.organize.mapper.SysDeptMapper; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
| /** | /** | ||||
| @@ -16,4 +19,15 @@ import org.springframework.stereotype.Component; | |||||
| */ | */ | ||||
| @Component | @Component | ||||
| public class DmMeetingRoomsManager extends BaseManagerImpl<DmMeetingRoomsQuery, DmMeetingRoomsDto, DmMeetingRoomsPo, DmMeetingRoomsMapper, DmMeetingRoomsConverter> implements IDmMeetingRoomsManager { | public class DmMeetingRoomsManager extends BaseManagerImpl<DmMeetingRoomsQuery, DmMeetingRoomsDto, DmMeetingRoomsPo, DmMeetingRoomsMapper, DmMeetingRoomsConverter> implements IDmMeetingRoomsManager { | ||||
| @Autowired | |||||
| SysDeptMapper sysDeptMapper; | |||||
| @Override | |||||
| public DmMeetingRoomsDto getDeptName(DmMeetingRoomsDto dto) { | |||||
| // sy | |||||
| if (null != dto.getDeptId()) { | |||||
| // sysDeptMapper.selectByField() | |||||
| } | |||||
| return null; | |||||
| } | |||||
| } | } | ||||
| @@ -0,0 +1,146 @@ | |||||
| package com.xueyi.system.resource.controller; | |||||
| import com.xueyi.common.core.utils.core.ObjectUtil; | |||||
| import com.xueyi.common.core.utils.core.StrUtil; | |||||
| import com.xueyi.common.core.utils.file.FileTypeUtil; | |||||
| import com.xueyi.common.core.utils.file.MimeTypeUtil; | |||||
| import com.xueyi.common.core.web.result.AjaxResult; | |||||
| import com.xueyi.common.core.web.result.R; | |||||
| import com.xueyi.common.core.web.validate.V_E; | |||||
| import com.xueyi.common.log.annotation.Log; | |||||
| import com.xueyi.common.log.enums.BusinessType; | |||||
| import com.xueyi.common.security.annotation.RequiresPermissions; | |||||
| import com.xueyi.common.web.entity.controller.BaseController; | |||||
| import com.xueyi.file.api.domain.SysFile; | |||||
| import com.xueyi.file.api.feign.RemoteFileService; | |||||
| import com.xueyi.system.resource.domain.dto.DmResourcesDto; | |||||
| import com.xueyi.system.resource.domain.po.DmResourcesPo; | |||||
| import com.xueyi.system.resource.domain.query.DmResourcesQuery; | |||||
| import com.xueyi.system.resource.service.IDmResourcesService; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.validation.annotation.Validated; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import org.springframework.web.multipart.MultipartFile; | |||||
| import java.io.Serializable; | |||||
| import java.util.Arrays; | |||||
| import java.util.List; | |||||
| /** | |||||
| * 静态资源管理 业务处理 | |||||
| * | |||||
| * @author xueyi | |||||
| */ | |||||
| @RestController | |||||
| @RequestMapping("/resources") | |||||
| public class DmResourcesController extends BaseController<DmResourcesQuery, DmResourcesDto, IDmResourcesService> { | |||||
| /** 定义节点名称 */ | |||||
| @Override | |||||
| protected String getNodeName() { | |||||
| return "静态资源" ; | |||||
| } | |||||
| @Autowired | |||||
| private RemoteFileService remoteFileService; | |||||
| @Autowired | |||||
| private IDmResourcesService iDmResourcesService; | |||||
| /** | |||||
| * 查询静态资源列表 | |||||
| */ | |||||
| @Override | |||||
| @GetMapping("/list") | |||||
| @RequiresPermissions(Auth.DM_RESOURCES_LIST) | |||||
| public AjaxResult list(DmResourcesQuery dmResources) { | |||||
| return super.list(dmResources); | |||||
| } | |||||
| /** | |||||
| * 查询静态资源详细 | |||||
| */ | |||||
| @Override | |||||
| @GetMapping(value = "/{id}") | |||||
| @RequiresPermissions(Auth.DM_RESOURCES_SINGLE) | |||||
| public AjaxResult getInfo(@PathVariable Serializable id) { | |||||
| return super.getInfo(id); | |||||
| } | |||||
| /** | |||||
| * 静态资源修改 | |||||
| */ | |||||
| @Override | |||||
| @PutMapping | |||||
| @RequiresPermissions(Auth.DM_RESOURCES_EDIT) | |||||
| @Log(title = "静态资源管理", businessType = BusinessType.UPDATE) | |||||
| public AjaxResult edit(@Validated({V_E.class}) @RequestBody DmResourcesDto dmResources) { | |||||
| return super.edit(dmResources); | |||||
| } | |||||
| /** | |||||
| * 静态资源批量删除 | |||||
| */ | |||||
| @Override | |||||
| @DeleteMapping("/batch/{idList}") | |||||
| @RequiresPermissions(Auth.DM_RESOURCES_DEL) | |||||
| @Log(title = "静态资源管理", businessType = BusinessType.DELETE) | |||||
| public AjaxResult batchRemove(@PathVariable List<Long> idList) { | |||||
| return super.batchRemove(idList); | |||||
| } | |||||
| /** | |||||
| * 获取静态资源选择框列表 | |||||
| */ | |||||
| @Override | |||||
| @GetMapping("/option") | |||||
| public AjaxResult option() { | |||||
| return super.option(); | |||||
| } | |||||
| interface Auth { | |||||
| /** 系统 - 静态资源管理 - 列表 */ | |||||
| String DM_RESOURCES_LIST = "resource:resources:list"; | |||||
| /** 系统 - 静态资源管理 - 详情 */ | |||||
| String DM_RESOURCES_SINGLE = "resource:resources:single"; | |||||
| /** 系统 - 静态资源管理 - 新增 */ | |||||
| String DM_RESOURCES_ADD = "resource:resources:add"; | |||||
| /** 系统 - 静态资源管理 - 修改 */ | |||||
| String DM_RESOURCES_EDIT = "resource:resources:edit"; | |||||
| /** 系统 - 静态资源管理 - 删除 */ | |||||
| String DM_RESOURCES_DEL = "resource:resources:delete"; | |||||
| } | |||||
| /** | |||||
| * 头像上传 | |||||
| */ | |||||
| @PostMapping("/upload") | |||||
| @Log(title = "资源管理 - 上传资源", businessType = BusinessType.UPDATE) | |||||
| public AjaxResult upload(@RequestParam("file") MultipartFile file) { | |||||
| if (!file.isEmpty()) { | |||||
| String extension = FileTypeUtil.getExtension(file); | |||||
| if (!StrUtil.equalsAnyIgnoreCase(extension, MimeTypeUtil.IMAGE_EXTENSION)) { | |||||
| return error("文件格式不正确,请上传" + Arrays.toString(MimeTypeUtil.IMAGE_EXTENSION) + "格式"); | |||||
| } | |||||
| R<SysFile> fileResult = remoteFileService.upload(file); | |||||
| if (ObjectUtil.isNull(fileResult) || ObjectUtil.isNull(fileResult.getData())) | |||||
| return error("文件服务异常,请联系管理员!"); | |||||
| String url = fileResult.getData().getUrl(); | |||||
| // 预留人脸识别与图像质量监测接口,如果监测异常返回错误 | |||||
| DmResourcesDto dto = new DmResourcesDto(); | |||||
| dto.setName(file.getOriginalFilename()); | |||||
| dto.setUrl(url); | |||||
| dto.setType(DmResourcesPo.TYPE_PIC); | |||||
| Long id = iDmResourcesService.addOne(dto); | |||||
| // dto.set | |||||
| AjaxResult ajax = success(); | |||||
| ajax.put(AjaxResult.URL_TAG, id); | |||||
| return ajax; | |||||
| } | |||||
| return error("上传图片异常,请联系管理员!"); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,21 @@ | |||||
| package com.xueyi.system.resource.domain.dto; | |||||
| import com.xueyi.system.resource.domain.po.DmResourcesPo; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import java.io.Serial; | |||||
| /** | |||||
| * 静态资源 数据传输对象 | |||||
| * | |||||
| * @author xueyi | |||||
| */ | |||||
| @Data | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class DmResourcesDto extends DmResourcesPo { | |||||
| @Serial | |||||
| private static final long serialVersionUID = 1L; | |||||
| } | |||||
| @@ -0,0 +1,17 @@ | |||||
| package com.xueyi.system.resource.domain.model; | |||||
| import com.xueyi.common.core.web.entity.model.BaseConverter; | |||||
| import com.xueyi.system.resource.domain.dto.DmResourcesDto; | |||||
| import com.xueyi.system.resource.domain.po.DmResourcesPo; | |||||
| import com.xueyi.system.resource.domain.query.DmResourcesQuery; | |||||
| import org.mapstruct.Mapper; | |||||
| import org.mapstruct.MappingConstants; | |||||
| /** | |||||
| * 静态资源 对象映射器 | |||||
| * | |||||
| * @author xueyi | |||||
| */ | |||||
| @Mapper(componentModel = MappingConstants.ComponentModel.SPRING) | |||||
| public interface DmResourcesConverter extends BaseConverter<DmResourcesQuery, DmResourcesDto, DmResourcesPo> { | |||||
| } | |||||
| @@ -0,0 +1,51 @@ | |||||
| package com.xueyi.system.resource.domain.po; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import com.xueyi.common.core.annotation.Excel; | |||||
| import com.xueyi.common.core.web.tenant.base.TBaseEntity; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import java.io.Serial; | |||||
| import static com.xueyi.common.core.constant.basic.EntityConstants.*; | |||||
| /** | |||||
| * 静态资源 持久化对象 | |||||
| * | |||||
| * @author xueyi | |||||
| */ | |||||
| @Data | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| @TableName(value = "dm_resources", excludeProperty = { STATUS, SORT, REMARK }) | |||||
| public class DmResourcesPo extends TBaseEntity { | |||||
| @Serial | |||||
| private static final long serialVersionUID = 1L; | |||||
| public static final Integer TYPE_PIC = 1; | |||||
| public static final Integer TYPE_VIDEO = 2; | |||||
| /** 资源tag */ | |||||
| @Excel(name = "资源tag") | |||||
| protected String tag; | |||||
| /** 数字人ID */ | |||||
| @Excel(name = "数字人ID") | |||||
| protected Long manId; | |||||
| /** 物理地址 */ | |||||
| @Excel(name = "物理地址") | |||||
| protected String physicalAddr; | |||||
| /** url地址 */ | |||||
| @Excel(name = "url地址") | |||||
| protected String url; | |||||
| /** 所属组织ID */ | |||||
| @Excel(name = "所属组织ID") | |||||
| protected Long deptId; | |||||
| protected Integer type; | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| package com.xueyi.system.resource.domain.query; | |||||
| import com.xueyi.system.resource.domain.po.DmResourcesPo; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import java.io.Serial; | |||||
| /** | |||||
| * 静态资源 数据查询对象 | |||||
| * | |||||
| * @author xueyi | |||||
| */ | |||||
| @Data | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class DmResourcesQuery extends DmResourcesPo { | |||||
| @Serial | |||||
| private static final long serialVersionUID = 1L; | |||||
| } | |||||
| @@ -0,0 +1,13 @@ | |||||
| package com.xueyi.system.resource.manager; | |||||
| import com.xueyi.system.resource.domain.dto.DmResourcesDto; | |||||
| import com.xueyi.system.resource.domain.query.DmResourcesQuery; | |||||
| import com.xueyi.common.web.entity.manager.IBaseManager; | |||||
| /** | |||||
| * 静态资源管理 数据封装层 | |||||
| * | |||||
| * @author xueyi | |||||
| */ | |||||
| public interface IDmResourcesManager extends IBaseManager<DmResourcesQuery, DmResourcesDto> { | |||||
| } | |||||
| @@ -0,0 +1,19 @@ | |||||
| package com.xueyi.system.resource.manager.impl; | |||||
| import com.xueyi.system.resource.domain.po.DmResourcesPo; | |||||
| import com.xueyi.system.resource.domain.dto.DmResourcesDto; | |||||
| import com.xueyi.system.resource.domain.query.DmResourcesQuery; | |||||
| import com.xueyi.system.resource.domain.model.DmResourcesConverter; | |||||
| import com.xueyi.system.resource.mapper.DmResourcesMapper; | |||||
| import com.xueyi.common.web.entity.manager.impl.BaseManagerImpl; | |||||
| import com.xueyi.system.resource.manager.IDmResourcesManager; | |||||
| import org.springframework.stereotype.Component; | |||||
| /** | |||||
| * 静态资源管理 数据封装层处理 | |||||
| * | |||||
| * @author xueyi | |||||
| */ | |||||
| @Component | |||||
| public class DmResourcesManager extends BaseManagerImpl<DmResourcesQuery, DmResourcesDto, DmResourcesPo, DmResourcesMapper, DmResourcesConverter> implements IDmResourcesManager { | |||||
| } | |||||
| @@ -0,0 +1,17 @@ | |||||
| package com.xueyi.system.resource.mapper; | |||||
| import com.xueyi.system.resource.domain.query.DmResourcesQuery; | |||||
| import com.xueyi.system.resource.domain.dto.DmResourcesDto; | |||||
| import com.xueyi.system.resource.domain.po.DmResourcesPo; | |||||
| import com.xueyi.common.web.entity.mapper.BaseMapper; | |||||
| import com.xueyi.common.datasource.annotation.Isolate; | |||||
| /** | |||||
| * 静态资源管理 数据层 | |||||
| * | |||||
| * @author xueyi | |||||
| */ | |||||
| @Isolate | |||||
| public interface DmResourcesMapper extends BaseMapper<DmResourcesQuery, DmResourcesDto, DmResourcesPo> { | |||||
| Long insertOne(DmResourcesPo dmResourcesPo); | |||||
| } | |||||
| @@ -0,0 +1,16 @@ | |||||
| package com.xueyi.system.resource.service; | |||||
| import com.xueyi.system.resource.domain.po.DmResourcesPo; | |||||
| import com.xueyi.system.resource.domain.query.DmResourcesQuery; | |||||
| import com.xueyi.system.resource.domain.dto.DmResourcesDto; | |||||
| import com.xueyi.common.web.entity.service.IBaseService; | |||||
| /** | |||||
| * 静态资源管理 服务层 | |||||
| * | |||||
| * @author xueyi | |||||
| */ | |||||
| public interface IDmResourcesService extends IBaseService<DmResourcesQuery, DmResourcesDto> { | |||||
| Long addOne(DmResourcesPo dmResourcesPo); | |||||
| } | |||||
| @@ -0,0 +1,41 @@ | |||||
| package com.xueyi.system.resource.service.impl; | |||||
| import com.xueyi.system.resource.domain.dto.DmResourcesDto; | |||||
| import com.xueyi.system.resource.domain.po.DmResourcesPo; | |||||
| import com.xueyi.system.resource.domain.query.DmResourcesQuery; | |||||
| import com.xueyi.system.resource.mapper.DmResourcesMapper; | |||||
| import com.xueyi.system.resource.service.IDmResourcesService; | |||||
| import com.xueyi.system.resource.manager.IDmResourcesManager; | |||||
| import com.xueyi.common.web.entity.service.impl.BaseServiceImpl; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import java.util.List; | |||||
| /** | |||||
| * 静态资源管理 服务层处理 | |||||
| * | |||||
| * @author xueyi | |||||
| */ | |||||
| @Service | |||||
| public class DmResourcesServiceImpl extends BaseServiceImpl<DmResourcesQuery, DmResourcesDto, IDmResourcesManager> implements IDmResourcesService { | |||||
| @Autowired | |||||
| DmResourcesMapper dmResourcesMapper; | |||||
| /** | |||||
| * 查询静态资源对象列表 | 数据权限 | |||||
| * | |||||
| * @param dmResources 静态资源对象 | |||||
| * @return 静态资源对象集合 | |||||
| */ | |||||
| @Override | |||||
| //@DataScope(userAlias = "createBy", mapperScope = {"DmResourcesMapper"}) | |||||
| public List<DmResourcesDto> selectListScope(DmResourcesQuery dmResources) { | |||||
| return baseManager.selectList(dmResources); | |||||
| } | |||||
| @Override | |||||
| public Long addOne(DmResourcesPo dmResourcesPo) { | |||||
| return dmResourcesMapper.insertOne(dmResourcesPo); | |||||
| } | |||||
| } | |||||
| @@ -1,6 +1,6 @@ | |||||
| # Tomcat | # Tomcat | ||||
| server: | server: | ||||
| port: 9600 | |||||
| port: 9602 | |||||
| # Spring | # Spring | ||||
| spring: | spring: | ||||
| @@ -17,17 +17,12 @@ spring: | |||||
| cloud: | cloud: | ||||
| nacos: | nacos: | ||||
| discovery: | discovery: | ||||
| # namespace: 6d0ee265-2a92-44cc-a6de-f34b3ea104e6 | |||||
| # namespace: fa62d4b3-e7b6-4ffa-aa90-8e322dafecfd | |||||
| # 服务注册地址 | # 服务注册地址 | ||||
| server-addr: 172.17.0.1:18848 | |||||
| # server-addr: 39.107.77.235:18848 | |||||
| server-addr: 172.17.0.0.1:18848 | |||||
| config: | config: | ||||
| # namespace: fa62d4b3-e7b6-4ffa-aa90-8e322dafecfd | |||||
| # 配置中心地址 | # 配置中心地址 | ||||
| # server-addr: 127.0.0.1:8848 | |||||
| server-addr: 172.17.0.1:18848 | |||||
| server-addr: 172.17.0.0.1:18848 | |||||
| # 配置文件格式 | # 配置文件格式 | ||||
| file-extension: yml | file-extension: yml | ||||
| # 共享配置 | # 共享配置 | ||||
| @@ -0,0 +1,11 @@ | |||||
| <?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.xueyi.system.resource.mapper.DmResourcesMapper"> | |||||
| <insert id="insertOne" parameterType="com.xueyi.system.resource.domain.po.DmResourcesPo" useGeneratedKeys = "true" keyProperty = "id" > | |||||
| insert into dm_resources(url, name, type) values (#{url}, #{name}, ${type}) | |||||
| </insert > | |||||
| </mapper> | |||||