|
@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import cn.com.qmth.examcloud.commons.base.exception.ExamCloudRuntimeException;
|
|
import cn.com.qmth.examcloud.commons.base.exception.ExamCloudRuntimeException;
|
|
|
|
+import cn.com.qmth.examcloud.commons.base.exception.StatusException;
|
|
import cn.com.qmth.examcloud.commons.base.util.AES;
|
|
import cn.com.qmth.examcloud.commons.base.util.AES;
|
|
import cn.com.qmth.examcloud.commons.web.security.bean.User;
|
|
import cn.com.qmth.examcloud.commons.web.security.bean.User;
|
|
import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
@@ -37,12 +38,16 @@ public class UpyunController extends ControllerSupport {
|
|
AES aes = new AES();
|
|
AES aes = new AES();
|
|
|
|
|
|
@ApiOperation(value = "保存照片")
|
|
@ApiOperation(value = "保存照片")
|
|
- @PutMapping("put/{siteId}/{fileName}.{fileSuffix}")
|
|
|
|
- public String putFile(@PathVariable String siteId, @PathVariable String fileName,
|
|
|
|
- @PathVariable String fileSuffix, HttpServletRequest req) {
|
|
|
|
|
|
+ @PutMapping("put/{siteId}/{fileSuffix}")
|
|
|
|
+ public String putFile(@PathVariable String siteId, @PathVariable String fileSuffix,
|
|
|
|
+ HttpServletRequest req) {
|
|
|
|
|
|
User accessUser = getAccessUser();
|
|
User accessUser = getAccessUser();
|
|
|
|
|
|
|
|
+ if (!fileSuffix.matches("\\w+")) {
|
|
|
|
+ throw new StatusException("EX-600100", "fileSuffix is wrong");
|
|
|
|
+ }
|
|
|
|
+
|
|
fileSuffix = "." + fileSuffix;
|
|
fileSuffix = "." + fileSuffix;
|
|
|
|
|
|
ServletInputStream in = null;
|
|
ServletInputStream in = null;
|