2023年1月17日17:12:20
This commit is contained in:
parent
d083fa2946
commit
adc94ba564
4
pom.xml
4
pom.xml
@ -20,8 +20,8 @@
|
||||
<java.version>1.8</java.version>
|
||||
<mybatisplus.spring.boot.version>2.1.9</mybatisplus.spring.boot.version>
|
||||
<mybatisplus.version>2.1.9</mybatisplus.version>
|
||||
<!-- <mysql.version>5.1.38</mysql.version>-->
|
||||
<mysql.version>8.0.26</mysql.version>
|
||||
<mysql.version>5.1.38</mysql.version>
|
||||
<!-- <mysql.version>8.0.26</mysql.version>-->
|
||||
<druid.version>1.1.3</druid.version>
|
||||
<quartz.version>2.3.0</quartz.version>
|
||||
<commons.lang.version>2.6</commons.lang.version>
|
||||
|
||||
@ -20,21 +20,21 @@ public class CorsConfig extends WebMvcConfigurerAdapter {
|
||||
.maxAge(3600);
|
||||
|
||||
}
|
||||
@Bean
|
||||
public CorsFilter corsFilter() {
|
||||
final UrlBasedCorsConfigurationSource urlBasedCorsConfigurationSource = new UrlBasedCorsConfigurationSource();
|
||||
final CorsConfiguration corsConfiguration = new CorsConfiguration();
|
||||
/*是否允许请求带有验证信息*/
|
||||
corsConfiguration.setAllowCredentials(true);
|
||||
/*允许访问的客户端域名*/
|
||||
corsConfiguration.addAllowedOrigin("*");
|
||||
/*允许服务端访问的客户端请求头*/
|
||||
corsConfiguration.addAllowedHeader("*");
|
||||
/*允许访问的方法名,GET POST等*/
|
||||
corsConfiguration.addAllowedMethod("*");
|
||||
urlBasedCorsConfigurationSource.registerCorsConfiguration("/**", corsConfiguration);
|
||||
return new CorsFilter(urlBasedCorsConfigurationSource);
|
||||
}
|
||||
// @Bean
|
||||
// public CorsFilter corsFilter() {
|
||||
// final UrlBasedCorsConfigurationSource urlBasedCorsConfigurationSource = new UrlBasedCorsConfigurationSource();
|
||||
// final CorsConfiguration corsConfiguration = new CorsConfiguration();
|
||||
// /*是否允许请求带有验证信息*/
|
||||
// corsConfiguration.setAllowCredentials(true);
|
||||
// /*允许访问的客户端域名*/
|
||||
// corsConfiguration.addAllowedOrigin("*");
|
||||
// /*允许服务端访问的客户端请求头*/
|
||||
// corsConfiguration.addAllowedHeader("*");
|
||||
// /*允许访问的方法名,GET POST等*/
|
||||
// corsConfiguration.addAllowedMethod("*");
|
||||
// urlBasedCorsConfigurationSource.registerCorsConfiguration("/**", corsConfiguration);
|
||||
// return new CorsFilter(urlBasedCorsConfigurationSource);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
@ -90,6 +90,9 @@ public class ShiroConfig {
|
||||
filterMap.put("/live/notify/*", "anon");
|
||||
filterMap.put("/foreign/token", "anon");
|
||||
filterMap.put("/foreign/live/**", "anon");
|
||||
//2023年1月17日11:22:21 在手机端获取栏目
|
||||
filterMap.put("/lives/syscolumn/**", "anon");
|
||||
//-------------------------------------
|
||||
filterMap.put("/homepage/**", "anon");
|
||||
// filterMap.put("/api/clips/**", "anon");
|
||||
filterMap.put("/clips/**", "anon");
|
||||
|
||||
@ -37,12 +37,12 @@ import io.swagger.annotations.ApiResponses;
|
||||
@RestController
|
||||
@RequestMapping("/app/live/scene")
|
||||
public class AppLiveSceneCountController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private LiveSceneCountService liveSceneCountService;
|
||||
@Autowired
|
||||
private RedisUtils redisUtils;
|
||||
|
||||
|
||||
@GetMapping("/counts")
|
||||
@ApiOperation("APP获取现场计数、并记录本次浏览数")
|
||||
@ApiImplicitParams({@ApiImplicitParam(value = "现场id", name = "sceneId", paramType = "query", dataType = "String")})
|
||||
@ -64,10 +64,11 @@ public class AppLiveSceneCountController {
|
||||
if (StringUtils.isBlank(subId)){
|
||||
return R.error("参数错误");
|
||||
}
|
||||
|
||||
//2023年1月16日14:19:20 根据存储默认转发头像和默认播放器头像进行获取回显
|
||||
|
||||
return R.ok().put("count", liveSceneCountService.getSceneCountByRedis(Integer.valueOf(subId)));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getCounts")
|
||||
@ApiOperation("APP获取现场列表计数")
|
||||
@ApiImplicitParams({@ApiImplicitParam(value = "现场id,多个ID用','分割", name = "sceneIds", paramType = "query", dataType = "String")})
|
||||
|
||||
@ -14,6 +14,7 @@ import com.platform.modules.sys.controller.AbstractController;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.platform.modules.sys.service.SysTenantService;
|
||||
import com.platform.modules.sys.vo.SysTenantVo;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -66,7 +67,9 @@ public class LiveForeignController {
|
||||
PageUtils pu = liveForeignService.getSceneList(cid, source, title, page, size);
|
||||
return R.ok().put("data", pu);
|
||||
}
|
||||
|
||||
//2023年1月16日15:09:01
|
||||
@Autowired
|
||||
private SysTenantService sysTenantService;
|
||||
@GetMapping("/scene/get/{id}")
|
||||
@ResponseBody
|
||||
public R sceneInfo(@PathVariable("id") String id) {
|
||||
@ -94,9 +97,11 @@ public class LiveForeignController {
|
||||
e.printStackTrace();
|
||||
return R.error("信息不存在");
|
||||
}
|
||||
//根据现场id获取到播放器图片、转发图片、转发名称
|
||||
SysTenantVo sysTenantVo=sysTenantService.selectTenantBySid(id);
|
||||
|
||||
|
||||
return R.ok().put("data", data);
|
||||
return R.ok().put("data", data).put("sysTenantVo",sysTenantVo);
|
||||
}
|
||||
|
||||
@GetMapping("/report/list")
|
||||
@ -111,8 +116,8 @@ public class LiveForeignController {
|
||||
String tenantUrl= sysTenantService.selectTenant(sceneId);
|
||||
return R.ok().put("data", pu).put("tenantUrl",tenantUrl);
|
||||
}
|
||||
@Autowired
|
||||
private SysTenantService sysTenantService;
|
||||
// @Autowired
|
||||
// private SysTenantService sysTenantService;
|
||||
@GetMapping("/comment/list")
|
||||
@ResponseBody
|
||||
public R commentList(Integer sceneId, Integer page, Integer size) {
|
||||
@ -246,6 +251,9 @@ public class LiveForeignController {
|
||||
@GetMapping("/weixin/getJsApiTicket")
|
||||
@ResponseBody
|
||||
public R getWeixinJsApiTicket (String url) {
|
||||
//2023年1月17日15:31:00 微信动态获取公众号编码
|
||||
|
||||
|
||||
if(StringUtils.isBlank(url)){
|
||||
return R.error("必填参数不能为空");
|
||||
}
|
||||
|
||||
@ -13,6 +13,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.platform.modules.sys.dao.SysTenantDao;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.lucene.document.Document;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -595,10 +596,18 @@ public class LiveForeignServiceImpl implements com.platform.modules.foreign.serv
|
||||
/**
|
||||
* 获取微信JS验证
|
||||
*/
|
||||
@Autowired
|
||||
private SysTenantDao sysTenantDao;
|
||||
public JSONObject getWeixinJsApiTicket(String url){
|
||||
//根据url获取到对应机构的微信公众号信息
|
||||
String wxappid=sysTenantDao.selectbyWxID(url);
|
||||
String wxappsecret=sysTenantDao.selectbysecret(url);
|
||||
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
|
||||
JsTicketApi jsTicketApi = new JsTicketApi(liveProperties.getWeixin().getAppId(), liveProperties.getWeixin().getAppSecret(), redisUtils);
|
||||
//JsTicketApi jsTicketApi = new JsTicketApi(liveProperties.getWeixin().getAppId(), liveProperties.getWeixin().getAppSecret(), redisUtils);
|
||||
JsTicketApi jsTicketApi = new JsTicketApi(wxappid, wxappsecret, redisUtils);
|
||||
|
||||
String timeStamp = System.currentTimeMillis() / 1000 + "";
|
||||
String nonceStr = StringKit.getRandomString(16);
|
||||
@ -610,7 +619,8 @@ public class LiveForeignServiceImpl implements com.platform.modules.foreign.serv
|
||||
JsSignature signature = new JsSignature(nonceStr, jsapi_ticket, timeStamp, url);
|
||||
|
||||
String sign = JsSignKit.sign(signature);
|
||||
jsonObject.put("appid", liveProperties.getWeixin().getAppId());
|
||||
//jsonObject.put("appid", liveProperties.getWeixin().getAppId());
|
||||
jsonObject.put("appid",wxappid );
|
||||
jsonObject.put("timeStamp", timeStamp);
|
||||
jsonObject.put("nonceStr", nonceStr);
|
||||
jsonObject.put("sign", sign);
|
||||
|
||||
@ -529,7 +529,7 @@ public class LiveSceneController extends AbstractController {
|
||||
@GetMapping("/channels")
|
||||
@ApiOperation(value = "获取所有栏目", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@RequiresPermissions("live:livescene:channels")
|
||||
public R channels(Integer sid){
|
||||
public R channels(Long id){
|
||||
// return R.ok().put("list", liveChannelService.getAllList());
|
||||
//return R.ok().put("list", liveChannelService.getAllChannel());
|
||||
//获取对应机构下的栏目
|
||||
|
||||
@ -110,7 +110,7 @@ public class MediaUploadController {
|
||||
// return R.error("资源上传失败");
|
||||
// }
|
||||
// }
|
||||
//上传到腾讯云oss
|
||||
|
||||
|
||||
|
||||
@PostMapping("/common/upload_media/chunk")
|
||||
@ -173,7 +173,7 @@ public class MediaUploadController {
|
||||
}
|
||||
return R.ok("文件上传成功");
|
||||
}
|
||||
|
||||
//上传到腾讯云cos
|
||||
@SysLog("图片资源上传")
|
||||
@PostMapping("/common/upload_media")
|
||||
@ApiOperation("图片资源上传")
|
||||
@ -207,7 +207,7 @@ public class MediaUploadController {
|
||||
localFile = File.createTempFile("temp", null);
|
||||
file.transferTo(localFile);
|
||||
// 指定要上传到 COS 上的路径
|
||||
String key = "/" + "/" + year + "/" + month + "/" + day + "/" + newFileName;
|
||||
String key = "/" + "/" + year + "/" + month+1 + "/" + day + "/" + newFileName;
|
||||
PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, key, localFile);
|
||||
PutObjectResult putObjectResult = cosclient.putObject(putObjectRequest);
|
||||
// return new UploadMsg(1,"上传成功",this.path + putObjectRequest.getKey());
|
||||
|
||||
30
src/main/java/com/platform/modules/lives/LivesSyscolumn.java
Normal file
30
src/main/java/com/platform/modules/lives/LivesSyscolumn.java
Normal file
@ -0,0 +1,30 @@
|
||||
package com.platform.modules.lives;
|
||||
|
||||
import com.platform.common.utils.R;
|
||||
import com.platform.modules.live.service.LiveChannelService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/lives")
|
||||
public class LivesSyscolumn {
|
||||
@Autowired
|
||||
private LiveChannelService liveChannelService;
|
||||
@GetMapping("/syscolumn/{id}")
|
||||
public R channels(@PathVariable("id") Long id){
|
||||
Long tenantId= id;
|
||||
|
||||
if (tenantId==1){
|
||||
return R.ok().put("list", liveChannelService.getAllList());
|
||||
|
||||
}else {
|
||||
return R.ok().put("list",liveChannelService.getAllChannelByTenant(tenantId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -8,6 +8,7 @@ import com.platform.common.validator.ValidatorUtils;
|
||||
import com.platform.modules.sys.entity.SysRoleEntity;
|
||||
import com.platform.modules.sys.service.SysRoleMenuService;
|
||||
import com.platform.modules.sys.service.SysRoleService;
|
||||
import com.platform.modules.sys.service.SysUserRoleService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -41,26 +42,42 @@ public class SysRoleController extends AbstractController {
|
||||
PageUtils page = sysRoleService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
// //lzy
|
||||
// if (getUserId() == Constant.SUPER_ADMIN){
|
||||
// PageUtils page = sysRoleService.queryPage(params);
|
||||
//
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 角色列表
|
||||
*/
|
||||
@Autowired
|
||||
private SysUserRoleService sysUserRoleService;
|
||||
@GetMapping("/select")
|
||||
@RequiresPermissions("sys:role:select")
|
||||
public R select(){
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
||||
|
||||
//如果不是超级管理员,则只查询自己所拥有的角色列表
|
||||
// if(getUserId() != Constant.SUPER_ADMIN){
|
||||
// // 20190309 TROY 字段名称错误
|
||||
// map.put("create_user_id", getUserId());
|
||||
// }
|
||||
List<SysRoleEntity> list = sysRoleService.selectByMap(map);
|
||||
|
||||
|
||||
|
||||
//2023年1月17日09:19:36 判断是否含有系统管理员权限,如果有则出现
|
||||
//设置评选判断条件
|
||||
List<Long> roleIdList = sysUserRoleService.queryRoleIdList(getUser().getUserId());
|
||||
if(roleIdList.contains(1L)){
|
||||
List<SysRoleEntity> list = sysRoleService.selectByMap(map);
|
||||
return R.ok().put("list", list);
|
||||
}
|
||||
//显示除系统管理员之外的角色
|
||||
List<SysRoleEntity>list=sysRoleService.selectNoAdmin();
|
||||
return R.ok().put("list", list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 角色信息
|
||||
*/
|
||||
@ -68,14 +85,14 @@ public class SysRoleController extends AbstractController {
|
||||
@RequiresPermissions("sys:role:info")
|
||||
public R info(@PathVariable("roleId") Long roleId){
|
||||
SysRoleEntity role = sysRoleService.selectById(roleId);
|
||||
|
||||
|
||||
//查询角色对应的菜单
|
||||
List<Long> menuIdList = sysRoleMenuService.queryMenuIdList(roleId);
|
||||
role.setMenuIdList(menuIdList);
|
||||
|
||||
|
||||
return R.ok().put("role", role);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存角色
|
||||
*/
|
||||
@ -84,13 +101,13 @@ public class SysRoleController extends AbstractController {
|
||||
@RequiresPermissions("sys:role:save")
|
||||
public R save(@RequestBody SysRoleEntity role){
|
||||
ValidatorUtils.validateEntity(role);
|
||||
|
||||
|
||||
role.setCreateUserId(getUserId());
|
||||
sysRoleService.save(role);
|
||||
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改角色
|
||||
*/
|
||||
@ -99,13 +116,13 @@ public class SysRoleController extends AbstractController {
|
||||
@RequiresPermissions("sys:role:update")
|
||||
public R update(@RequestBody SysRoleEntity role){
|
||||
ValidatorUtils.validateEntity(role);
|
||||
|
||||
|
||||
role.setCreateUserId(getUserId());
|
||||
sysRoleService.update(role);
|
||||
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除角色
|
||||
*/
|
||||
@ -114,7 +131,7 @@ public class SysRoleController extends AbstractController {
|
||||
@RequiresPermissions("sys:role:delete")
|
||||
public R delete(@RequestBody Long[] roleIds){
|
||||
sysRoleService.deleteBatch(roleIds);
|
||||
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
|
||||
@ -129,7 +129,7 @@ public class SysTenantController extends AbstractController {
|
||||
@ApiOperationSort(4)
|
||||
@ApiOperation(value = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@RequiresPermissions("sys:systenant:list")
|
||||
@RequiresPermissions("sys:systenant:page")
|
||||
public R page(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = sysTenantService.queryPage(params);
|
||||
return R.ok().put("page", page);
|
||||
@ -162,7 +162,7 @@ public class SysTenantController extends AbstractController {
|
||||
@ApiOperationSort(6)
|
||||
@ApiOperation(value = "机构详情")
|
||||
@GetMapping("/info/{id}")
|
||||
//@RequiresPermissions("sys:systenant:info")
|
||||
@RequiresPermissions("sys:systenant:info")
|
||||
public R info(@PathVariable("id") Long id){
|
||||
return sysTenantService.info(id);
|
||||
}
|
||||
|
||||
@ -11,9 +11,15 @@ import java.util.List;
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysRoleDao extends BaseMapper<SysRoleEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 查询用户创建的角色ID列表
|
||||
*/
|
||||
List<Long> queryRoleIdList(Long createUserId);
|
||||
|
||||
/**
|
||||
* 如果不是系统管理员,则不能显示系统管理员权限
|
||||
* @return
|
||||
*/
|
||||
List<SysRoleEntity> selectNoAdmin();
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.platform.modules.sys.dao;
|
||||
|
||||
import com.platform.modules.sys.entity.SysTenantEntity;
|
||||
import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import com.platform.modules.sys.vo.SysTenantVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@ -34,4 +35,15 @@ public interface SysTenantDao extends BaseMapper<SysTenantEntity> {
|
||||
String selectAnonymousurl(@Param("sceneid") Integer sceneId);
|
||||
|
||||
String selectTenant(@Param("sceneid")Integer sceneId);
|
||||
|
||||
/**
|
||||
* h5页面根据直播流查询默认视频播放头像,转发名称,转发头像
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
SysTenantVo selectTenantBySid(@Param("id") String id);
|
||||
|
||||
String selectbyWxID(@Param("url") String url);
|
||||
|
||||
String selectbysecret(@Param("url")String url);
|
||||
}
|
||||
|
||||
@ -101,5 +101,17 @@ public class SaveTenantDTO {
|
||||
* 机构默认评论头像
|
||||
*/
|
||||
private String anonymousUrl;
|
||||
|
||||
//2023年1月16日14:21:02 新增默认播放器头像和默认转发头像
|
||||
/**
|
||||
* 默认播放器头像
|
||||
*/
|
||||
private String imageTplayerUrl;
|
||||
/**
|
||||
* 默认转发头像
|
||||
*/
|
||||
private String tForwardUrl;
|
||||
/**
|
||||
* 转发名称名称
|
||||
*/
|
||||
private String tForwardName;
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotations.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotations.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
@ -90,6 +91,69 @@ public class SysTenantEntity implements Serializable {
|
||||
*/
|
||||
@ApiModelProperty(value = "机构评论匿名头像")
|
||||
private String anonymousUrl;
|
||||
//2023年1月16日14:23:50 新增默认播放器头像 和默认转发头像
|
||||
/**
|
||||
* 默认播放器头像
|
||||
*/
|
||||
@ApiModelProperty(value = "默认播放器头像")
|
||||
private String imageTplayerUrl;
|
||||
/**
|
||||
* 默认转发头像
|
||||
*/
|
||||
@ApiModelProperty(value = "默认转发头像")
|
||||
private String tForwardUrl;
|
||||
/**
|
||||
* 设置转发名称
|
||||
*/
|
||||
@ApiModelProperty(value = "转发名称")
|
||||
private String tForwardName;
|
||||
|
||||
/**
|
||||
* 微信APPid
|
||||
* @return
|
||||
*/
|
||||
@ApiModelProperty(value = "微信APPid")
|
||||
private String wxAppId;
|
||||
|
||||
/**
|
||||
* 微信appsecret
|
||||
* @return
|
||||
*/
|
||||
@ApiModelProperty(value = "微信appsecret")
|
||||
private String wxAppSecret;
|
||||
//**********************************
|
||||
|
||||
public String getWxAppId() {
|
||||
return wxAppId;
|
||||
}
|
||||
|
||||
public void setWxAppId(String wxAppId) {
|
||||
this.wxAppId = wxAppId;
|
||||
}
|
||||
|
||||
public String getWxAppSecret() {
|
||||
return wxAppSecret;
|
||||
}
|
||||
|
||||
public void setWxAppSecret(String wxAppSecret) {
|
||||
this.wxAppSecret = wxAppSecret;
|
||||
}
|
||||
|
||||
public String getImageTplayerUrl() {
|
||||
return imageTplayerUrl;
|
||||
}
|
||||
|
||||
public void setImageTplayerUrl(String imageTplayerUrl) {
|
||||
this.imageTplayerUrl = imageTplayerUrl;
|
||||
}
|
||||
|
||||
public String gettForwardName() {
|
||||
return tForwardName;
|
||||
}
|
||||
|
||||
public void settForwardName(String tForwardName) {
|
||||
this.tForwardName = tForwardName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@ -262,4 +326,27 @@ public class SysTenantEntity implements Serializable {
|
||||
}
|
||||
|
||||
|
||||
//2023年1月16日14:26:28
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 得到默认转发头像
|
||||
* @return
|
||||
*/
|
||||
public String gettForwardUrl() {
|
||||
return tForwardUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置默认转发头像
|
||||
* @param tForwardUrl
|
||||
*/
|
||||
public void settForwardUrl(String tForwardUrl) {
|
||||
this.tForwardUrl = tForwardUrl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -21,9 +21,15 @@ public interface SysRoleService extends IService<SysRoleEntity> {
|
||||
|
||||
void deleteBatch(Long[] roleIds);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询用户创建的角色ID列表
|
||||
*/
|
||||
List<Long> queryRoleIdList(Long createUserId);
|
||||
|
||||
/**
|
||||
* 如果登陆用户不是系统管理员,则不能将系统管理员显示
|
||||
* @return
|
||||
*/
|
||||
List<SysRoleEntity> selectNoAdmin();
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import com.platform.common.utils.PageUtils;
|
||||
import com.platform.common.utils.R;
|
||||
import com.platform.modules.sys.dto.SaveTenantDTO;
|
||||
import com.platform.modules.sys.entity.SysTenantEntity;
|
||||
import com.platform.modules.sys.vo.SysTenantVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -32,5 +33,13 @@ public interface SysTenantService extends IService<SysTenantEntity> {
|
||||
String selectAnonymousurl(Integer sceneId);
|
||||
|
||||
String selectTenant(Integer sceneId);
|
||||
|
||||
/**
|
||||
* 根据现场id查出tenantvo
|
||||
* @return
|
||||
*/
|
||||
SysTenantVo selectTenantBySid(String id);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -94,6 +94,11 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleDao, SysRoleEntity> i
|
||||
return baseMapper.queryRoleIdList(createUserId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysRoleEntity> selectNoAdmin() {
|
||||
return baseMapper.selectNoAdmin();
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查权限是否越权
|
||||
*/
|
||||
@ -102,10 +107,10 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleDao, SysRoleEntity> i
|
||||
if(role.getCreateUserId() == Constant.SUPER_ADMIN){
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
//查询用户所拥有的菜单列表
|
||||
List<Long> menuIdList = sysUserService.queryAllMenuId(role.getCreateUserId());
|
||||
|
||||
|
||||
//判断是否越权
|
||||
if(!menuIdList.containsAll(role.getMenuIdList())){
|
||||
throw new RRException("新增角色的权限,已超出你的权限范围");
|
||||
|
||||
@ -18,6 +18,7 @@ import com.platform.modules.sys.service.SysTenantService;
|
||||
import com.platform.modules.sys.service.SysUserRoleService;
|
||||
import com.platform.modules.sys.service.SysUserService;
|
||||
import com.platform.modules.sys.service.SysUserTokenService;
|
||||
import com.platform.modules.sys.vo.SysTenantVo;
|
||||
import org.apache.commons.lang.RandomStringUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.crypto.hash.Sha256Hash;
|
||||
@ -82,12 +83,19 @@ public class SysTenantServiceImpl extends ServiceImpl<SysTenantDao, SysTenantEnt
|
||||
|
||||
// 1.保存企业信息
|
||||
SysTenantEntity tenantEntity = new SysTenantEntity();
|
||||
//2.保存企业默认照片和机构默认评论
|
||||
//2.保存企业默认照片
|
||||
//tenantEntity.setTLogoUrl(MaterialUtils.getMaterialUrl(tenantDTO.getTLogoUrl(), foreignProperties.getMediaurl()));
|
||||
tenantEntity.setTLogoUrl(tenantDTO.getTLogoUrl());
|
||||
//2.1保存评论默认照片
|
||||
//tenantEntity.setAnonymousUrl(MaterialUtils.getMaterialUrl(tenantDTO.getAnonymousUrl(), foreignProperties.getMediaurl()));
|
||||
tenantEntity.setAnonymousUrl(tenantDTO.getAnonymousUrl());
|
||||
//2023年1月16日14:33:27
|
||||
//2.2默认保存播放器头像
|
||||
tenantEntity.setImageTplayerUrl(tenantDTO.getImageTplayerUrl());
|
||||
//2.3默认保存转发头像
|
||||
tenantEntity.settForwardUrl(tenantDTO.getTForwardUrl());
|
||||
//2.4保存转发名称
|
||||
tenantEntity.settForwardName(tenantDTO.getTForwardName());
|
||||
|
||||
tenantEntity.setTenantName(tenantDTO.getTenantName());
|
||||
tenantEntity.setStatus(tenantDTO.getTenantStatus() == null ? 1 : tenantDTO.getTenantStatus());
|
||||
@ -160,7 +168,8 @@ public class SysTenantServiceImpl extends ServiceImpl<SysTenantDao, SysTenantEnt
|
||||
if (StringUtils.isNotBlank(sysTenant.getTLogoUrl())) {
|
||||
|
||||
// MaterialUtils.getMaterialUrl(, foreignProperties.getVodmediaurl())
|
||||
tenantEntity.setTLogoUrl( handlerLicenseUrl(sysTenant.getTLogoUrl(), materiaFileProperties.getBasePath()));
|
||||
// tenantEntity.setTLogoUrl( handlerLicenseUrl(sysTenant.getTLogoUrl(), materiaFileProperties.getBasePath()));
|
||||
tenantEntity.setTLogoUrl( sysTenant.getTLogoUrl());
|
||||
}else {
|
||||
tenantEntity.setTLogoUrl(null);
|
||||
}
|
||||
@ -169,12 +178,47 @@ public class SysTenantServiceImpl extends ServiceImpl<SysTenantDao, SysTenantEnt
|
||||
*/
|
||||
if (StringUtils.isNotBlank(sysTenant.getAnonymousUrl())){
|
||||
|
||||
tenantEntity.setAnonymousUrl(handlerLicenseUrl(sysTenant.getAnonymousUrl(), materiaFileProperties.getBasePath()));
|
||||
//tenantEntity.setAnonymousUrl(handlerLicenseUrl(sysTenant.getAnonymousUrl(), materiaFileProperties.getBasePath()));
|
||||
tenantEntity.setAnonymousUrl(sysTenant.getAnonymousUrl());
|
||||
System.out.println("ttttttt"+tenantEntity.getAnonymousUrl());
|
||||
}else {
|
||||
tenantEntity.setAnonymousUrl(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改默认播放器图片
|
||||
*/
|
||||
// if (StringUtils.isNotBlank(sysTenant.gettPlayerUrl())){
|
||||
// tenantEntity.settPlayerUrl(sysTenant.gettPlayerUrl());
|
||||
// }else {
|
||||
// tenantEntity.settPlayerUrl(null);
|
||||
// }
|
||||
if (StringUtils.isNotBlank(sysTenant.getImageTplayerUrl())){
|
||||
tenantEntity.setImageTplayerUrl(sysTenant.getImageTplayerUrl());
|
||||
}else {
|
||||
tenantEntity.setImageTplayerUrl(null);
|
||||
}
|
||||
/**
|
||||
* 修改默认转发图片
|
||||
*/
|
||||
if (StringUtils.isNotBlank(sysTenant.gettForwardUrl())){
|
||||
tenantEntity.settForwardUrl(sysTenant.gettForwardUrl());
|
||||
}else {
|
||||
tenantEntity.settForwardUrl(null);
|
||||
}
|
||||
/**
|
||||
* 修改默认转发名称
|
||||
*/
|
||||
// if (StringUtils.isNotBlank(sysTenant.gettForwardName())){
|
||||
// tenantEntity.settForwardName(sysTenant.gettForwardName());
|
||||
// }else {
|
||||
// tenantEntity.settForwardName(null);
|
||||
// }
|
||||
if (StringUtils.isNotBlank(sysTenant.gettForwardName())){
|
||||
tenantEntity.settForwardName(sysTenant.gettForwardName());
|
||||
}else {
|
||||
tenantEntity.settForwardName(null);
|
||||
}
|
||||
//---------------------
|
||||
if (StringUtils.isNotBlank(sysTenant.getTenantName()))
|
||||
tenantEntity.setTenantName(sysTenant.getTenantName());
|
||||
if (null != sysTenant.getStatus())
|
||||
@ -255,6 +299,19 @@ public class SysTenantServiceImpl extends ServiceImpl<SysTenantDao, SysTenantEnt
|
||||
// sysTenantEntity.setAnonymousUrl(MaterialUtils.getMaterialUrl(sysTenantEntity.getAnonymousUrl(), materiaFileProperties.getBasePath()));
|
||||
sysTenantEntity.setAnonymousUrl(sysTenantEntity.getAnonymousUrl());
|
||||
}
|
||||
//2023年1月16日14:40:54
|
||||
//回显默认播放器头像
|
||||
if (StringUtils.isNotBlank(sysTenantEntity.getImageTplayerUrl())){
|
||||
sysTenantEntity.setImageTplayerUrl(sysTenantEntity.getImageTplayerUrl());
|
||||
}
|
||||
//回显默认转发头像
|
||||
if (StringUtils.isNotBlank(sysTenantEntity.gettForwardUrl())){
|
||||
sysTenantEntity.settForwardUrl(sysTenantEntity.gettForwardUrl());
|
||||
}
|
||||
//回显默认转发名称
|
||||
if (StringUtils.isNotBlank(sysTenantEntity.gettForwardName())){
|
||||
sysTenantEntity.settForwardName(sysTenantEntity.gettForwardName());
|
||||
}
|
||||
|
||||
return R.ok().put("sysTenant", sysTenantEntity);
|
||||
}
|
||||
@ -310,6 +367,14 @@ public class SysTenantServiceImpl extends ServiceImpl<SysTenantDao, SysTenantEnt
|
||||
return tenantUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysTenantVo selectTenantBySid(String id) {
|
||||
|
||||
SysTenantVo sysTenantVo=sysTenantDao.selectTenantBySid(id);
|
||||
return sysTenantVo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存员工信息
|
||||
*
|
||||
|
||||
117
src/main/java/com/platform/modules/sys/vo/SysTenantVo.java
Normal file
117
src/main/java/com/platform/modules/sys/vo/SysTenantVo.java
Normal file
@ -0,0 +1,117 @@
|
||||
package com.platform.modules.sys.vo;
|
||||
|
||||
import com.platform.common.validator.group.AddGroup;
|
||||
import com.platform.common.validator.group.UpdateGroup;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Email;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author MXY
|
||||
* 2019/11/15 14:43
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("机构信息vo")
|
||||
public class SysTenantVo {
|
||||
|
||||
// /**
|
||||
// * 机构名称
|
||||
// * */
|
||||
// @ApiModelProperty(value = "机构名称")
|
||||
// private String tenantName;
|
||||
// /**
|
||||
// * 营业执照注册号
|
||||
// * */
|
||||
// @ApiModelProperty(value = "营业执照注册号")
|
||||
// private String license;
|
||||
// /**
|
||||
// * 营业执照URL
|
||||
// * */
|
||||
// @ApiModelProperty(value = "营业执照URL")
|
||||
// private String licenseUrl;
|
||||
// /**
|
||||
// * 机构状态,0:禁用,1:启用
|
||||
// * */
|
||||
// @ApiModelProperty(value = "机构状态,0:禁用,1:启用")
|
||||
// private Integer tenantStatus;
|
||||
// /**
|
||||
// * 机构创建人ID
|
||||
// * */
|
||||
// @ApiModelProperty(value = "创建人ID")
|
||||
// private Long tenantCreateUserId;
|
||||
// /**
|
||||
// * 用户名
|
||||
// * */
|
||||
// @ApiModelProperty(value = "用户名")
|
||||
// private String username;
|
||||
// /**
|
||||
// * 真实姓名
|
||||
// * */
|
||||
// @ApiModelProperty(value = "真实姓名")
|
||||
// private String realName;
|
||||
// /**
|
||||
// * 密码
|
||||
// * */
|
||||
// @ApiModelProperty(value = "密码")
|
||||
// private String password;
|
||||
// /**
|
||||
// * 确认密码
|
||||
// * */
|
||||
// @ApiModelProperty(value = "确认密码")
|
||||
// private String confirmPwd;
|
||||
// /**
|
||||
// * 用户身份证号
|
||||
// * */
|
||||
// @ApiModelProperty(value = "用户身份证号")
|
||||
// private String idCard;
|
||||
// /**
|
||||
// * 邮箱
|
||||
// * */
|
||||
// @ApiModelProperty(value = "邮箱")
|
||||
// @Email(message="邮箱格式不正确", groups = {AddGroup.class, UpdateGroup.class})
|
||||
// private String email;
|
||||
// /**
|
||||
// * 手机号
|
||||
// * */
|
||||
// @ApiModelProperty(value = "手机号")
|
||||
// private String mobile;
|
||||
// /**
|
||||
// * 用户状态
|
||||
// * */
|
||||
// @ApiModelProperty(value = "用户状态")
|
||||
// private Integer userStatus;
|
||||
// /**
|
||||
// * 角色
|
||||
// * */
|
||||
// @ApiModelProperty(value = "角色")
|
||||
// private List<Long> roleIdList;
|
||||
// /**
|
||||
// * 创建人ID
|
||||
// * */
|
||||
// @ApiModelProperty(value = "创建人ID")
|
||||
// private Long userCreateUserId;
|
||||
// /**
|
||||
// * 机构头像
|
||||
// */
|
||||
// private String tLogoUrl;
|
||||
// /**
|
||||
// * 机构默认评论头像
|
||||
// */
|
||||
// private String anonymousUrl;
|
||||
//2023年1月16日14:21:02 新增默认播放器头像和默认转发头像
|
||||
/**
|
||||
* 默认播放器头像
|
||||
*/
|
||||
private String imageTplayerUrl;
|
||||
/**
|
||||
* 默认转发头像
|
||||
*/
|
||||
private String tForwardUrl;
|
||||
/**
|
||||
* 转发名称名称
|
||||
*/
|
||||
private String tForwardName;
|
||||
}
|
||||
@ -11,8 +11,10 @@ server:
|
||||
spring:
|
||||
# 环境 dev|test|prod
|
||||
profiles:
|
||||
active: dev, live-dev
|
||||
active: prod, live-prod
|
||||
# jackson时间格式化
|
||||
resources:
|
||||
static-locations: classpath:/META-INF/resources/,file:${image.imagePath}
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
@ -34,6 +36,14 @@ spring:
|
||||
max-wait: -1
|
||||
max-idle: 10
|
||||
min-idle: 5
|
||||
#腾讯云cos配置信息
|
||||
tengxun:
|
||||
accessKey: AKIDUnwtoleP0T0RhiW5PUVN3Xu50gJxSmt1
|
||||
secretKey: ODpAQccXDdotmIxSkmX2RfdbOyHNGzWr
|
||||
bucket: ap-beijing
|
||||
bucketName: ajinanlive-1303145222
|
||||
path: https://ajinanlive-1303145222.cos.ap-beijing.myqcloud.com
|
||||
|
||||
|
||||
|
||||
#mybatis
|
||||
@ -91,10 +101,14 @@ video:
|
||||
listenerPath: D:\\video
|
||||
interval: 1000
|
||||
baseSavePath: /video/
|
||||
image:
|
||||
# imagePath: /data/syspic
|
||||
baseSavePath: http://localhost:8081/
|
||||
materia:
|
||||
materiaPath:
|
||||
mediaPath: /media
|
||||
basePath: http://zklive.zhongkedongxin.com/platform/
|
||||
# basePath: https://m.livejinan.cn/platform/
|
||||
SPT: /
|
||||
foreign:
|
||||
wapurl: http://zklive.zhongkedongxin.com
|
||||
@ -112,3 +126,8 @@ platform:
|
||||
logging:
|
||||
file: /var/log/platform/platform.log
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -2,9 +2,12 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.platform.modules.sys.dao.SysRoleDao">
|
||||
|
||||
|
||||
<!-- 查询用户创建的角色ID列表 -->
|
||||
<select id="queryRoleIdList" resultType="long">
|
||||
select role_id from sys_role where create_user_id = #{createUserId}
|
||||
</select>
|
||||
</mapper>
|
||||
select role_id from sys_role where create_user_id = #{createUserId}
|
||||
</select>
|
||||
<select id="selectNoAdmin" resultType="com.platform.modules.sys.entity.SysRoleEntity">
|
||||
SELECT * FROM `sys_role` WHERE role_id != 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -34,5 +34,25 @@
|
||||
from live_scene ls LEFT JOIN sys_tenant st on ls.tenant_id= st.tenant_id
|
||||
where ls.id=#{sceneid}
|
||||
</select>
|
||||
<select id="selectTenantBySid" resultType="com.platform.modules.sys.vo.SysTenantVo">
|
||||
SELECT st.image_tplayer_url,
|
||||
st.t_forward_url,
|
||||
st.t_forward_name
|
||||
from live_scene ls LEFT JOIN sys_tenant st on ls.tenant_id= st.tenant_id
|
||||
where ls.id=#{id}
|
||||
|
||||
</select>
|
||||
<select id="selectbyWxID" resultType="java.lang.String">
|
||||
SELECT st.wx_app_id
|
||||
from live_scene ls LEFT JOIN sys_tenant st on ls.tenant_id= st.tenant_id
|
||||
where ls.id=#{url}
|
||||
|
||||
</select>
|
||||
<select id="selectbysecret" resultType="java.lang.String">
|
||||
SELECT st.wx_app_secret
|
||||
from live_scene ls LEFT JOIN sys_tenant st on ls.tenant_id= st.tenant_id
|
||||
where ls.id=#{url}
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user