|
|
@@ -4,13 +4,14 @@ import com.gis.common.exception.BaseRuntimeException;
|
|
|
import com.gis.common.util.Result;
|
|
|
import com.gis.domain.entity.SceneCountEntity;
|
|
|
import com.gis.service.SceneCountService;
|
|
|
+import com.gis.web.Dto.EditVisitDto;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-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.*;
|
|
|
+
|
|
|
+import javax.validation.Valid;
|
|
|
+import java.util.Date;
|
|
|
|
|
|
/**
|
|
|
* Created by owen on 2021/8/10 0010 10:50
|
|
|
@@ -63,6 +64,38 @@ public class SceneCountController {
|
|
|
return entityService.saveVisit(sceneCode, type);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * by owen 2026-1-20 编辑访问量
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "v1.2-编辑访问量")
|
|
|
+ @PostMapping("/editVisit")
|
|
|
+ public Result editVisit(@Valid @RequestBody EditVisitDto param){
|
|
|
+ String sceneCode = param.getSceneCode();
|
|
|
+ SceneCountEntity entity = entityService.findBySceneCode(sceneCode);
|
|
|
+ if (entity == null){
|
|
|
+ return Result.failure("场景码不已存在, 编辑失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ Integer pcsVisit = param.getPcsVisit();
|
|
|
+ Integer pcsShare = param.getPcsShare();
|
|
|
+ Integer pcsStar = param.getPcsStar();
|
|
|
+
|
|
|
+ if (pcsVisit != null && pcsVisit > 0 ){
|
|
|
+ entity.setVisitSum(pcsVisit);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (pcsShare != null && pcsShare > 0 ){
|
|
|
+ entity.setShareSum(pcsShare);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (pcsStar != null && pcsStar > 0 ){
|
|
|
+ entity.setStarSum(pcsStar);
|
|
|
+ }
|
|
|
+ entityService.update(entity);
|
|
|
+ return Result.success(entity);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 2022-3-25
|