Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
Ecsite
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shoei.kanno
Ecsite
Commits
96460008
Commit
96460008
authored
Oct 16, 2020
by
keita.onoguchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
一覧表示画面途中
parent
fcb099e8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
2 deletions
+70
-2
pom.xml
bin/pom.xml
+2
-1
pom.xml
pom.xml
+0
-1
Shoes.java
src/main/java/com/example/domain/Shoes.java
+2
-0
EcsiteController.java
src/main/java/com/example/web/EcsiteController.java
+66
-0
No files found.
bin/pom.xml
View file @
96460008
...
...
@@ -67,7 +67,8 @@
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
...
...
pom.xml
View file @
96460008
...
...
@@ -55,7 +55,6 @@
<artifactId>
spring-security-test
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
...
...
src/main/java/com/example/domain/Shoes.java
View file @
96460008
...
...
@@ -28,4 +28,6 @@ public class Shoes {
private
Integer
Size
;
@Column
(
nullable
=
false
)
private
Integer
productStatus
;
@Column
(
nullable
=
false
)
private
String
path
;
}
src/main/java/com/example/web/EcsiteController.java
View file @
96460008
package
com
.
example
.
web
;
import
java.awt.image.BufferedImage
;
import
java.io.BufferedOutputStream
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.OutputStream
;
import
java.util.Iterator
;
import
javax.imageio.IIOImage
;
import
javax.imageio.ImageIO
;
import
javax.imageio.ImageWriteParam
;
import
javax.imageio.ImageWriter
;
import
javax.imageio.plugins.jpeg.JPEGImageWriteParam
;
import
javax.imageio.stream.ImageOutputStream
;
import
org.springframework.security.core.annotation.AuthenticationPrincipal
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.example.domain.Shoes
;
import
com.example.domain.User
;
import
com.example.service.LoginUser
;
...
...
@@ -25,4 +42,53 @@ public class EcsiteController {
public
String
list
()
{
return
"Hello world"
;
}
//画像登録用
// @PostMapping("admin/management/shoes")
// public String CreateShoes(@Validated,
// MultipartFile multipartFile) throws Exception {
//
// if (!multipartFile.isEmpty()) {
// try {
// // ファイル名をリネイム
// File oldFileName = new File(multipartFile.getOriginalFilename());
// File newFileName = new File(oldFileName + ".jpg");
// oldFileName.renameTo(newFileName);
//
// // 保存先を定義
// String uploadPath = "src/main/resources/static/upload/";
// byte[] bytes = multipartFile.getBytes();
//
// // 指定ファイルへ読み込みファイルを書き込み
// BufferedOutputStream stream = new BufferedOutputStream(
// new FileOutputStream(new File(uploadPath + newFileName)));
// stream.write(bytes);
// stream.close();
//
// // 圧縮
// File input = new File(uploadPath + newFileName);
// BufferedImage image = ImageIO.read(input);
// OutputStream os = new FileOutputStream(input);
// Iterator<ImageWriter> writers = ImageIO
// .getImageWritersByFormatName("jpg");
// ImageWriter writer = (ImageWriter) writers.next();
// ImageOutputStream ios = ImageIO.createImageOutputStream(os);
// writer.setOutput(ios);
// ImageWriteParam param = new JPEGImageWriteParam(null);
// param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
// param.setCompressionQuality(0.30f);
// writer.write(null, new IIOImage(image, null, null), param);
// os.close();
// ios.close();
// writer.dispose();
//
// // DBに写真の名前を格納する
// service.updatePhoto(account.getUsername(), newFileName.toString());
//
// } catch (Exception e) {
// System.out.println(e);
// }
// }
// return "forward:/top";
// }
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment