blob 相关权限内容

develop
zhouj1203@hotmail.com 2 months ago
parent f52559da2b
commit 8879b87bd2

@ -3,6 +3,7 @@ package cn.teammodel.controller.admin.controller;
import cn.teammodel.common.R;
import cn.teammodel.controller.admin.service.ExamService;
import cn.teammodel.model.dto.admin.art.ArtFindDto;
import cn.teammodel.model.dto.admin.exam.BlobSasDto;
import cn.teammodel.model.dto.admin.exam.OverViewDto;
import cn.teammodel.model.vo.admin.ArtElementsVo;
import io.swagger.annotations.Api;
@ -30,4 +31,10 @@ public class ExamController {
Map<String, Object> res = examService.getAnalysis(overViewDto,request);
return R.success(res);
}
@PostMapping("getBlobSas")
@ApiOperation("获取blob 读写权限")
public R<Map<String, Object>> getBlobSas(@Valid @RequestBody BlobSasDto blobSasDto, HttpServletRequest request) {
Map<String, Object> res = examService.getBlobSas(blobSasDto,request);
return R.success(res);
}
}

@ -1,5 +1,6 @@
package cn.teammodel.controller.admin.service;
import cn.teammodel.model.dto.admin.exam.BlobSasDto;
import cn.teammodel.model.dto.admin.exam.OverViewDto;
import javax.servlet.http.HttpServletRequest;
@ -7,4 +8,5 @@ import java.util.Map;
public interface ExamService {
Map<String,Object> getAnalysis(OverViewDto overViewDto, HttpServletRequest request);
Map<String,Object> getBlobSas(BlobSasDto blobSasDto, HttpServletRequest request);
}

@ -3,6 +3,7 @@ package cn.teammodel.controller.admin.service.impl;
import cn.teammodel.common.ErrorCode;
import cn.teammodel.config.exception.ServiceException;
import cn.teammodel.controller.admin.service.ExamService;
import cn.teammodel.model.dto.admin.exam.BlobSasDto;
import cn.teammodel.model.dto.admin.exam.OverViewDto;
import cn.teammodel.utils.GroupUtil;
import org.springframework.beans.factory.annotation.Autowired;
@ -48,4 +49,19 @@ public class ExamServiceImpl implements ExamService {
}
return overView;
}
@Override
public Map<String, Object> getBlobSas(BlobSasDto blobSasDto, HttpServletRequest request) {
Map<String, Object> sas;
String url = env.getProperty("ies.server-url-blob-sas-rcwld");
try {
sas = GroupUtil.getGroupId(blobSasDto,new GroupUtil(env), request,url);
}catch (Exception e) {
throw new ServiceException(ErrorCode.SYSTEM_ERROR.getCode(), "数据转换错误");
}
return sas;
}
}

@ -0,0 +1,10 @@
package cn.teammodel.model.dto.admin.exam;
import lombok.Data;
@Data
public class BlobSasDto {
public String name;
public String role;
public String code;
}

@ -75,3 +75,4 @@ ies:
server-url-overview: /overall-education/overview
server-url-exam-rate: /common/exam/get-exam-point
server-url-art-analysis: /analysis/art/statistics
server-url-blob-sas-rcwld: /blob/sas-rcwld
Loading…
Cancel
Save