| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import io.swagger.models.auth.In; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/selectCount") |
| | | public R selectCount(String uid) { |
| | | return R.data(integralService.selectCount(uid)); |
| | | public R selectCount(String uid,String type) { |
| | | List<Map<Object, Object>> list = integralService.selectCount(uid); |
| | | List<Map<Object, Object>> listAll = integralService.selectList(uid,type); |
| | | Map map = new HashMap(); |
| | | Integer a = Integer.parseInt(list.get(0).get("integral").toString()); |
| | | Integer b = Integer.parseInt(list.get(1).get("integral").toString()); |
| | | //总积分 |
| | | map.put("zjf", list.get(0)); |
| | | //总的用掉的积分 |
| | | map.put("yjf", list.get(1)); |
| | | //剩余积分 |
| | | map.put("sjf", a - b); |
| | | map.put("list",listAll); |
| | | return R.data(map); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询积分榜前十 |
| | | * @return |
| | | */ |
| | | @PostMapping("/order") |
| | | @ApiOperation(value = "排序") |
| | | public R order(){ |
| | | List<Integral> list = integralService.order(); |
| | | return R.data(list); |
| | | } |
| | | } |