package com.kwan.springbootkwan.controller; import com.kwan.springbootkwan.entity.Result; import com.kwan.springbootkwan.service.CsdnLikeService; import com.kwan.springbootkwan.service.CsdnService; import lombok.extern.slf4j.Slf4j; import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @Slf4j @RestController @RequestMapping("/csdn") public class CsdnController { @Autowired private CsdnService csdnService; @Autowired private CsdnLikeService csdnLikeService; @GetMapping("/isLike") public Result isLike(@Param("articleId") String articleId, @Param("userName") String userName) { return Result.ok(csdnLikeService.isLike(articleId, userName)); } @GetMapping("/singleLike") public Result singleLike(@Param("articleId") String articleId) { return Result.ok(csdnLikeService.like(articleId)); } @GetMapping("/singleTriplet") public Result singleTriplet(@Param("username") String username) { csdnService.singleArticle(username); return Result.ok("三连完成"); } @GetMapping("/multiTriplet") public Result multiTriplet() { csdnService.multiTriplet(); return Result.ok("三连完成"); } }