|
@@ -3,6 +3,7 @@ package com.caimei365.commodity.service.impl;
|
|
|
import com.caimei365.commodity.mapper.StatisticsTypeMapper;
|
|
|
import com.caimei365.commodity.model.ResponseJson;
|
|
|
import com.caimei365.commodity.service.StatisticsTypeService;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -14,6 +15,7 @@ import java.util.Date;
|
|
|
* @创建时间 2022/8/30
|
|
|
* @描述
|
|
|
*/
|
|
|
+@Slf4j
|
|
|
@Service
|
|
|
public class StatisticsTypeServiceImpl implements StatisticsTypeService {
|
|
|
|
|
@@ -24,8 +26,12 @@ public class StatisticsTypeServiceImpl implements StatisticsTypeService {
|
|
|
* 点击时做修改统计
|
|
|
*/
|
|
|
@Override
|
|
|
- public ResponseJson alterTypeNumber(Integer typeId) {
|
|
|
- int i = typeMapper.updataTypeNumber(typeId,new Date());
|
|
|
- return ResponseJson.success(i);
|
|
|
+ public ResponseJson alterTypeNumber(Integer typeId, Integer bannerId) {
|
|
|
+ // 统计为 banner 进入时应记录 bannerId 统计 banner 点击次数
|
|
|
+ if (1 == typeId && null == bannerId) {
|
|
|
+ return ResponseJson.error(-1, "bannerId不能为空", null);
|
|
|
+ }
|
|
|
+ typeMapper.insertTypeNumber(typeId, bannerId);
|
|
|
+ return ResponseJson.success();
|
|
|
}
|
|
|
}
|