|
|
@@ -5,13 +5,12 @@ import com.cyksj.dto.Result;
|
|
|
import com.cyksj.enums.GatewayResponse;
|
|
|
import com.cyksj.mapper.channel.ChannelPopularizeMapper;
|
|
|
import com.cyksj.mapper.channel.ChannelPopularizeVisitMapper;
|
|
|
+import com.cyksj.mapper.channel.MoviesVisitRecordMapper;
|
|
|
import com.cyksj.model.entity.ChannelPopularize;
|
|
|
import com.cyksj.model.entity.ChannelPopularizeVisit;
|
|
|
+import com.cyksj.model.entity.MoviesVisitRecord;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
/**
|
|
|
* @author chan
|
|
|
@@ -26,6 +25,8 @@ public class ChannelController {
|
|
|
|
|
|
private final ChannelPopularizeMapper popularizeMapper;
|
|
|
|
|
|
+ private final MoviesVisitRecordMapper moviesVisitRecordMapper;
|
|
|
+
|
|
|
@GetMapping("/get/{id}")
|
|
|
public Result<ChannelPopularize> getById(@PathVariable Long id){
|
|
|
ChannelPopularize channelPopularize = popularizeMapper.selectById(id);
|
|
|
@@ -37,4 +38,15 @@ public class ChannelController {
|
|
|
channelPopularizeVisitMapper.insert(channelPopularizeVisit);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(channelPopularize);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 记录银河电影浏览量
|
|
|
+ */
|
|
|
+ @PostMapping("/movies/record/")
|
|
|
+ public Result<String> moviesVisitRecord() {
|
|
|
+ MoviesVisitRecord moviesVisitRecord = new MoviesVisitRecord();
|
|
|
+ moviesVisitRecord.setType(MoviesVisitRecord.Type.movies);
|
|
|
+ moviesVisitRecordMapper.insert(moviesVisitRecord);
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
+ }
|
|
|
}
|