查询用户积分

master
382696293@qq.com 2 years ago
parent b68819ffc3
commit d0c14ebf8b

@ -1,6 +1,7 @@
package com.flossom.common.core.mapper;
import com.flossom.common.core.domain.entity.WxUserIntegralLog;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -59,4 +60,6 @@ public interface WxUserIntegralLogMapper
* @return
*/
public int deleteWxUserIntegralLogByIds(Long[] ids);
List<WxUserIntegralLog> obtainUserIntegral(@Param("userId") Long userId);
}

@ -37,6 +37,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</select>
<select id="obtainUserIntegral" resultType="com.flossom.common.core.domain.entity.WxUserIntegralLog">
<include refid="selectWxUserIntegralLogVo"/>
WHERE
user_id = #{userId}
ORDER BY
create_time DESC
</select>
<insert id="insertWxUserIntegralLog" parameterType="WxUserIntegralLog" useGeneratedKeys="true" keyProperty="id">
insert into wx_user_integral_log
<trim prefix="(" suffix=")" suffixOverrides=",">

@ -0,0 +1,39 @@
package com.flossom.miniProgram.controller;
import com.flossom.common.core.domain.entity.WxUserIntegralLog;
import com.flossom.common.core.web.controller.BaseController;
import com.flossom.common.core.web.domain.AjaxResult;
import com.flossom.common.core.web.page.TableDataInfo;
import com.flossom.miniProgram.service.IWxUserIntegralService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Controller
*
* @author flossom
* @date 2023-12-14
*/
@RestController
@RequestMapping("/integralLog")
public class WxUserIntegraController extends BaseController {
@Autowired
private IWxUserIntegralService wxUserIntegralLogService;
/**
*
*
* @return
*/
@GetMapping("/obtainUserIntegral")
public TableDataInfo obtainUserIntegral() {
startPage();
List<WxUserIntegralLog> list = wxUserIntegralLogService.obtainUserIntegral();
return getDataTable(list);
}
}

@ -0,0 +1,11 @@
package com.flossom.miniProgram.service;
import com.flossom.common.core.domain.entity.WxUserIntegralLog;
import java.util.List;
public interface IWxUserIntegralService {
List<WxUserIntegralLog> obtainUserIntegral();
}

@ -0,0 +1,25 @@
package com.flossom.miniProgram.service.impl;
import com.flossom.common.core.domain.entity.WxUserIntegralLog;
import com.flossom.common.core.domain.entity.WxUserMember;
import com.flossom.common.core.mapper.WxUserIntegralLogMapper;
import com.flossom.common.security.utils.SecurityUtils;
import com.flossom.miniProgram.service.IWxUserIntegralService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class WxUserIntegralServiceImpl implements IWxUserIntegralService {
@Autowired
private WxUserIntegralLogMapper wxUserIntegralLogMapper;
@Override
public List<WxUserIntegralLog> obtainUserIntegral() {
WxUserMember wxUserMember = SecurityUtils.getLoginUser().getWxUserMember();
return wxUserIntegralLogMapper.obtainUserIntegral(wxUserMember.getId());
}
}
Loading…
Cancel
Save