Commit 1018d275 by “Kongxiangkun”

增加积分商城相关代码

parent fc2e4671
...@@ -15,6 +15,7 @@ import com.yizhi.point.application.vo.domain.PointVo; ...@@ -15,6 +15,7 @@ import com.yizhi.point.application.vo.domain.PointVo;
import com.yizhi.system.application.system.remote.AccountClient; import com.yizhi.system.application.system.remote.AccountClient;
import com.yizhi.system.application.vo.AccountVO; import com.yizhi.system.application.vo.AccountVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -34,6 +35,7 @@ import java.util.List; ...@@ -34,6 +35,7 @@ import java.util.List;
* @author bob123 * @author bob123
* @since 2018-04-20 * @since 2018-04-20
*/ */
@Slf4j
@Api(tags="积分商城", description="积分商城") @Api(tags="积分商城", description="积分商城")
@RestController @RestController
@RequestMapping("/api/point") @RequestMapping("/api/point")
...@@ -76,6 +78,7 @@ public class PointApiController { ...@@ -76,6 +78,7 @@ public class PointApiController {
public boolean readFinished( public boolean readFinished(
@RequestParam(name = "accountId" ,required = false ) Long accountId, @RequestParam(name = "accountId" ,required = false ) Long accountId,
@RequestParam(name = "infoId" ,required = false ) String infoId){ @RequestParam(name = "infoId" ,required = false ) String infoId){
log.info("阅读文章调用增加积分接口, accountId:{}, infoId:{}", accountId, infoId);
pointService.addPoint(accountId, "point_read", infoId); pointService.addPoint(accountId, "point_read", infoId);
return true; return true;
} }
......
...@@ -97,7 +97,7 @@ public class PointServiceImpl extends ServiceImpl<PointMapper, Point> implements ...@@ -97,7 +97,7 @@ public class PointServiceImpl extends ServiceImpl<PointMapper, Point> implements
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void addPoint(Long accountId, String type, String sourceId){ public void addPoint(Long accountId, String type, String sourceId){
if(accountId == null || StringUtils.isBlank(type) || StringUtils.isBlank(sourceId)){ if(accountId == null || StringUtils.isBlank(type)){
log.error("增加积分入参异常 accountId:{}, type:{}, sourceId:{}", accountId, type, sourceId); log.error("增加积分入参异常 accountId:{}, type:{}, sourceId:{}", accountId, type, sourceId);
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment