12 2020 档案

摘要:public class Code { public static void main(String[] args) { IntStreams.range(1,4) .forEach(System.out::println); // 1 2 3 Arrays.stream(new int[] {1, 阅读全文
posted @ 2020-12-30 03:47 Zhentiw 阅读(73) 评论(0) 推荐(0) 编辑
摘要:public class Code { public static void main(String[] args) { Arrays.asList("red", "green", "blue") .stream() .sorted() .findFirst() .ifPresent(System. 阅读全文
posted @ 2020-12-30 03:43 Zhentiw 阅读(66) 评论(0) 推荐(0) 编辑
摘要:public class Code { public static void main(String[] args) { List<String> names = Arrays.asList("Paul", "Jane", "Sam", "Michaela"); // Way to sort pri 阅读全文
posted @ 2020-12-30 03:32 Zhentiw 阅读(84) 评论(0) 推荐(0) 编辑
摘要:<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <groupId>c 阅读全文
posted @ 2020-12-27 22:59 Zhentiw 阅读(91) 评论(0) 推荐(0) 编辑
摘要:application-docker.properties: spring.datasource.url=jdbc:mysql://${server}:${port}/explorecali spring.datasource.username=${dbuser} spring.datasource 阅读全文
posted @ 2020-12-27 22:52 Zhentiw 阅读(114) 评论(0) 推荐(0) 编辑
摘要:application-mysql.properties: spring.datasource.url=jdbc:mysql://ec-mysql:3306/explorecali spring.datasource.username=cali_user spring.datasource.pass 阅读全文
posted @ 2020-12-27 22:44 Zhentiw 阅读(75) 评论(0) 推荐(0) 编辑
摘要:Before build the docker file, build the jar package: mvn package -DskipTests=true Dockerfile: FROM java:8 WORKDIR / ADD target/explorecali-2.0.0-SNAPS 阅读全文
posted @ 2020-12-27 22:32 Zhentiw 阅读(72) 评论(0) 推荐(0) 编辑
摘要:Extending, Securing and Dockerizing Spring Boot Microservices Final Product requires External MySql Database. Install Docker For Mac/Windows/Linux ### 阅读全文
posted @ 2020-12-27 22:23 Zhentiw 阅读(75) 评论(0) 推荐(0) 编辑
摘要:Testing JWT proteceted endpoint: /** * HTTP POST /tours/{tourId}/ratings */ @Test public void createTourRating() throws Exception { restTemplate.excha 阅读全文
posted @ 2020-12-27 22:09 Zhentiw 阅读(208) 评论(0) 推荐(0) 编辑
摘要:Provider: package com.example.ec.security; import com.example.ec.domain.Role; import io.jsonwebtoken.*; import org.springframework.beans.factory.annot 阅读全文
posted @ 2020-12-27 22:01 Zhentiw 阅读(160) 评论(0) 推荐(0) 编辑
摘要:If you find yourself filling out the same form over and over again, or working through a weird workflow to enable certain features in your app just to 阅读全文
posted @ 2020-12-26 18:28 Zhentiw 阅读(109) 评论(0) 推荐(0) 编辑
摘要:require.context: https://webpack.js.org/guides/dependency-management/#requirecontext require.context(directory, useSubdirectories = true, regExp = /^\ 阅读全文
posted @ 2020-12-26 18:14 Zhentiw 阅读(161) 评论(0) 推荐(0) 编辑
摘要:package com.example.ec.security; import com.example.ec.repo.RoleRepository; import org.springframework.beans.factory.annotation.Autowired; import org. 阅读全文
posted @ 2020-12-26 04:54 Zhentiw 阅读(84) 评论(0) 推荐(0) 编辑
摘要:Controller: @RestController @RequestMapping(path = "/ratings") public class RatingController { private static final Logger LOGGER = LoggerFactory.getL 阅读全文
posted @ 2020-12-26 04:33 Zhentiw 阅读(133) 评论(0) 推荐(0) 编辑
摘要:Service: package com.example.ec.service; import com.example.ec.domain.Tour; import com.example.ec.domain.TourRating; import com.example.ec.repo.TourRa 阅读全文
posted @ 2020-12-23 03:40 Zhentiw 阅读(468) 评论(0) 推荐(0) 编辑
摘要:If one request failed, we want to keep database untouched as if the request never happen. Spring makes it easy to add: @Transactional To the method or 阅读全文
posted @ 2020-12-23 02:14 Zhentiw 阅读(94) 评论(0) 推荐(0) 编辑
摘要:The CSS property object-fit instructs an img to act as the container for its own contents. We can then use the value cover to have the image content b 阅读全文
posted @ 2020-12-20 21:35 Zhentiw 阅读(91) 评论(0) 推荐(0) 编辑
摘要:Learn how to use the modern CSS property clamp() to create responsive layout sizing that adjusts to the viewport size without the use of media queries 阅读全文
posted @ 2020-12-20 21:32 Zhentiw 阅读(95) 评论(0) 推荐(0) 编辑
摘要:Apply a grayscale and blurred effect on an image without the use of graphics software by using the CSS filter property. Additionally, use an inset box 阅读全文
posted @ 2020-12-20 21:28 Zhentiw 阅读(98) 评论(0) 推荐(0) 编辑
摘要:Repo: public interface CourseRepository extends CrudRepository<Course,Integer>{ Optional<Course> findByName(String name); @Query("Select new com.examp 阅读全文
posted @ 2020-12-20 20:40 Zhentiw 阅读(181) 评论(0) 推荐(0) 编辑
摘要:@Test public void queryByExample() { System.out.println("\nFind the Department with the name 'Humanities' \n" + departmentRepository.findOne(Example.o 阅读全文
posted @ 2020-12-18 04:24 Zhentiw 阅读(137) 评论(0) 推荐(0) 编辑
摘要:package com.example.university.repo; import com.example.university.domain.Staff; import org.springframework.data.domain.Page; import org.springframewo 阅读全文
posted @ 2020-12-18 04:20 Zhentiw 阅读(119) 评论(0) 推荐(0) 编辑
摘要:package com.example.university.repo; import com.example.university.domain.Staff; import com.example.university.domain.Student; import com.example.univ 阅读全文
posted @ 2020-12-18 04:10 Zhentiw 阅读(222) 评论(0) 推荐(0) 编辑
摘要:Entity: package com.example.university.domain; import javax.persistence.*; import java.util.ArrayList; import java.util.List; /** * JPA Entity represe 阅读全文
posted @ 2020-12-18 03:59 Zhentiw 阅读(108) 评论(0) 推荐(0) 编辑
摘要:New broadcaster: compose: export let combine = (broadcaster1, broadcaster2) => listener => { let value1; let value2; let cancel1 = broadcaster1(value 阅读全文
posted @ 2020-12-17 15:49 Zhentiw 阅读(103) 评论(0) 推荐(0) 编辑
摘要:All features of CrudRepository plus: void flush(); saveAndFlush() delteInBatch() delteAllInBatch() package com.example.university.repo; import com.exa 阅读全文
posted @ 2020-12-17 02:36 Zhentiw 阅读(111) 评论(0) 推荐(0) 编辑
摘要:domain/Course.java package com.example.university.domain; import javax.persistence.*; /** * JPA Entity for a Course offered at the University. * <p> * 阅读全文
posted @ 2020-12-17 02:31 Zhentiw 阅读(123) 评论(0) 推荐(0) 编辑
摘要:@OneToMany: One Student To Many Courses. @JoinTable(name = "Enrollment"): Join Enrollment table. joinColumns: with use "student_id" to link Student an 阅读全文
posted @ 2020-12-17 02:14 Zhentiw 阅读(306) 评论(0) 推荐(0) 编辑
摘要:Repo: package com.example.ec.repo; import com.example.ec.domain.TourRating; import com.example.ec.domain.TourRatingPk; import org.springframework.data 阅读全文
posted @ 2020-12-16 03:13 Zhentiw 阅读(94) 评论(0) 推荐(0) 编辑
摘要:package com.example.ec.web; import com.example.ec.domain.Tour; import com.example.ec.domain.TourRating; import com.example.ec.domain.TourRatingPk; imp 阅读全文
posted @ 2020-12-16 03:02 Zhentiw 阅读(290) 评论(0) 推荐(0) 编辑
摘要:Controller: package com.example.ec.web; import com.example.ec.domain.Tour; import com.example.ec.domain.TourRating; import com.example.ec.domain.TourR 阅读全文
posted @ 2020-12-15 02:53 Zhentiw 阅读(115) 评论(0) 推荐(0) 编辑
摘要:In software, we come across many use cases when we need to have a composite primary key to define an entry in a table. Composite primary keys are keys 阅读全文
posted @ 2020-12-15 02:05 Zhentiw 阅读(204) 评论(0) 推荐(0) 编辑
摘要:@RestResource(exported = false): makes the endpoint no longer visible for public. package com.example.ec.repo; import com.example.ec.domain.TourPackag 阅读全文
posted @ 2020-12-14 04:16 Zhentiw 阅读(74) 评论(0) 推荐(0) 编辑
摘要:package com.example.ec.repo; import com.example.ec.domain.Difficulty; import com.example.ec.domain.Region; import com.example.ec.domain.Tour; import o 阅读全文
posted @ 2020-12-14 03:51 Zhentiw 阅读(59) 评论(0) 推荐(0) 编辑
摘要:Entity: package com.example.ec.domain; import javax.persistence.*; @Entity public class Tour { @Id @GeneratedValue private Integer id; @Column private 阅读全文
posted @ 2020-12-12 22:01 Zhentiw 阅读(125) 评论(0) 推荐(0) 编辑
摘要:To build out our word game, we will have to be able to share the word across a few places. This means we have to set up a broadcaster that will push t 阅读全文
posted @ 2020-12-10 17:00 Zhentiw 阅读(116) 评论(0) 推荐(0) 编辑
摘要:The racing condition would be one possible bug when we apply cache a newtwork request. For example, we implement a search box, for all the requests, w 阅读全文
posted @ 2020-12-09 15:59 Zhentiw 阅读(62) 评论(0) 推荐(0) 编辑
摘要:Caches exist to make things faster (at the expense of taking up more memory and possibly outdated results). Our live search is a great use case for im 阅读全文
posted @ 2020-12-09 15:40 Zhentiw 阅读(90) 评论(0) 推荐(0) 编辑
摘要:Create you own decreator! Add dependency: <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.9.5</version> 阅读全文
posted @ 2020-12-09 03:35 Zhentiw 阅读(169) 评论(0) 推荐(0) 编辑
摘要:In previous post, we check how to use ifElse to branch out the logic: https://www.cnblogs.com/Answer1215/p/14093562.html let inputToBooks = pipe( wait 阅读全文
posted @ 2020-12-08 22:28 Zhentiw 阅读(108) 评论(0) 推荐(0) 编辑
摘要:You can do git log first to check which commit message you want to revert to. For example 'xxxxx123' is the commit id we want to revert to. Then do: g 阅读全文
posted @ 2020-12-08 15:19 Zhentiw 阅读(229) 评论(0) 推荐(0) 编辑
摘要:Dendron is a Visual Studio Code extension that you can download and install free of charge. To download a visual studio code extension, we press Comma 阅读全文
posted @ 2020-12-08 03:37 Zhentiw 阅读(160) 评论(0) 推荐(0) 编辑
摘要:So far, we've used filter to prevent values when a condition is met. Sometimes you want two different behaviors based on a condition which is where yo 阅读全文
posted @ 2020-12-06 18:05 Zhentiw 阅读(147) 评论(0) 推荐(0) 编辑
摘要:Besides using Profiles, we can also us Spring Expression Language. package com.frankmoley.lil.fid.config; import com.frankmoley.lil.fid.service.Greeti 阅读全文
posted @ 2020-12-04 22:23 Zhentiw 阅读(84) 评论(0) 推荐(0) 编辑
摘要:For example, inside code, we want production env & dev env print different time format. @Bean @Profile("!dev") public TimeService timeService(){ retur 阅读全文
posted @ 2020-12-04 16:01 Zhentiw 阅读(83) 评论(0) 推荐(0) 编辑
摘要:We can have some properties defined inside application.properties or application.yml file. application.properties: app.name=Frank app.greeting=Hello W 阅读全文
posted @ 2020-12-04 15:50 Zhentiw 阅读(99) 评论(0) 推荐(0) 编辑
摘要:pom.xml: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> SecurityConfigur 阅读全文
posted @ 2020-12-01 15:41 Zhentiw 阅读(81) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示