| | |
| | | import com.mzl.flower.base.ReturnDataDTO; |
| | | import com.mzl.flower.config.exception.ValidationException; |
| | | import com.mzl.flower.config.security.SecurityUtils; |
| | | import com.mzl.flower.constant.Constants; |
| | | import com.mzl.flower.dto.request.supplier.*; |
| | | import com.mzl.flower.dto.response.supplier.SupplierDTO; |
| | | import com.mzl.flower.entity.customer.Customer; |
| | | import com.mzl.flower.service.TosService; |
| | | import com.mzl.flower.service.oss.TosOssService; |
| | | import com.mzl.flower.service.customer.CustomerService; |
| | | import com.mzl.flower.service.supplier.SupplierService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import java.util.UUID; |
| | | |
| | | import static com.google.common.io.Files.getFileExtension; |
| | | import static sun.font.CreatedFontTracker.MAX_FILE_SIZE; |
| | | |
| | | @RestController |
| | |
| | | private CustomerService customerService; |
| | | |
| | | @Autowired |
| | | private TosService tosService; |
| | | private TosOssService tosOssService; |
| | | |
| | | public SupplierController(SupplierService supplierService) { |
| | | this.supplierService = supplierService; |
| | |
| | | String newFileName = originalFilename + (extension != null ? extension : ""); |
| | | |
| | | // 4. 上传到 OSS |
| | | avatarUrl = tosService.uploadFile( avatar.getInputStream(),newFileName); |
| | | avatarUrl = tosOssService.uploadFile( avatar.getInputStream(),newFileName); |
| | | } |
| | | |
| | | // 5. 更新用户信息 |