12 2021 档案

摘要:try{ String videoCacheKey = String.format(CacheKeyManager.VIDEO_DETAIL,videoId); Object cacheObj = baseCache.getOneHourCache().get( videoCacheKey ,()- 阅读全文
posted @ 2021-12-05 11:27 智慧搬运工 阅读(76) 评论(0) 推荐(0)
摘要:创建工具类: import com.google.common.cache.Cache;import com.google.common.cache.CacheBuilder;import org.springframework.stereotype.Component;import java.ut 阅读全文
posted @ 2021-12-05 11:00 智慧搬运工 阅读(295) 评论(0) 推荐(0)
摘要:controller类:/** * 下单接口 */@PostMapping("save")public JsonData save(@RequestBody VideoOrderRequest videoOrderRequest, HttpServletRequest request){ Integ 阅读全文
posted @ 2021-12-03 21:48 智慧搬运工 阅读(69) 评论(0) 推荐(0)
摘要:controller类:@GetMapping("find_by_token")public JsonData findByToken(HttpServletRequest request){//这里的getAttribute需要在拦截器中使用setAttribute才能获取到 Integer us 阅读全文
posted @ 2021-12-03 12:01 智慧搬运工 阅读(42) 评论(0) 推荐(0)
摘要:import com.example.online_class.interceptor.LoginInterceptor;import org.springframework.context.annotation.Bean;import org.springframework.context.ann 阅读全文
posted @ 2021-12-03 11:26 智慧搬运工 阅读(616) 评论(0) 推荐(0)
摘要:import com.example.online_class.utils.JsonData;import com.example.online_class.utils.JwtUtils;import com.fasterxml.jackson.databind.ObjectMapper;impor 阅读全文
posted @ 2021-12-03 11:02 智慧搬运工 阅读(34) 评论(0) 推荐(0)
摘要:<dependency> <groupId>io.jsonwebtoken</groupId> <artifactId>jjwt</artifactId> <version>0.9.1</version></dependency> 工具类:import com.example.online_clas 阅读全文
posted @ 2021-12-02 21:53 智慧搬运工 阅读(509) 评论(0) 推荐(0)
摘要:Mapper.xml文件:<resultMap id="VideoDetailResultMap" type="Video"> <id column="id" jdbcType="INTEGER" property="id"/> <result column="title" jdbcType="VA 阅读全文
posted @ 2021-12-01 20:04 智慧搬运工 阅读(64) 评论(0) 推荐(0)
摘要:<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional></dependency> <plugin> 阅读全文
posted @ 2021-12-01 12:47 智慧搬运工 阅读(40) 评论(0) 推荐(0)