Browse Source

Merge branch 'test' of ssh://git@git.jishutao.com:55555/jishutao/jitao-server.git into test

limin 7 years ago
parent
commit
be69ee414a

+ 15 - 0
src/main/java/com/goafanti/business/controller/UserJtBusinessController.java

@@ -1,5 +1,6 @@
 package com.goafanti.business.controller;
 
+import java.util.Base64;
 import java.util.Date;
 
 import javax.annotation.Resource;
@@ -21,6 +22,7 @@ import com.goafanti.common.model.JtBusinessCategory;
 import com.goafanti.common.model.JtBusinessProject;
 import com.goafanti.common.model.JtTag;
 import com.goafanti.common.utils.StringUtils;
+import com.goafanti.core.shiro.token.TokenManager;
 
 @RestController
 @RequestMapping(value = "/api/user/jtBusiness")
@@ -154,6 +156,19 @@ public class UserJtBusinessController extends CertifyApiController{
 		}
 		return res;
 	}
+	@RequestMapping(value = "/project/uploadPicture64", method = RequestMethod.POST)
+	public Result uploadProjectPicture64(String picturebase, String filename,String sign) {
+		Result res = new Result();
+ 		byte[] bs=Base64.getDecoder().decode(picturebase);
+		AttachmentType attachmentType = AttachmentType.getField(sign);
+		if (attachmentType == AttachmentType.JT_PROJECT_PICTURE) {
+			//res.setData(handleFiles(res, "/jtProjects/", false, req, sign, ""));
+			res.setData(handleBaseFiles(res, "/jtProjects/", false,bs, sign, TokenManager.getUserId(),filename));
+		} else {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "图片"));
+		}
+		return res;
+	}
 	
 	/*
 	 * 查询品类

+ 0 - 1
src/main/java/com/goafanti/common/utils/FileUtils.java

@@ -16,7 +16,6 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.multipart.MultipartFile;
 
-import com.goafanti.common.enums.AttachmentType;
 
 public class FileUtils {
 	@Value(value = "${upload.private.path}")

+ 0 - 4
src/main/java/com/goafanti/user/controller/UserRegisterController.java

@@ -2,7 +2,6 @@ package com.goafanti.user.controller;
 
 import java.util.Calendar;
 import java.util.Date;
-import java.util.List;
 import java.util.UUID;
 import javax.annotation.Resource;
 import javax.validation.Valid;
@@ -18,12 +17,9 @@ import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.BaseController;
-import com.goafanti.common.dao.UserMapper;
 import com.goafanti.common.enums.UserAuthentication;
 import com.goafanti.common.enums.UserFields;
 import com.goafanti.common.enums.UserLevel;
-import com.goafanti.common.enums.VoucherSourceType;
-import com.goafanti.common.model.JtVoucherDetail;
 import com.goafanti.common.model.User;
 import com.goafanti.common.utils.InvitationCodeUtils;
 import com.goafanti.common.utils.PasswordUtil;