master
‘mahaoran’ 2024-12-03 11:59:51 +08:00
parent 1b75139b17
commit e2d2634ee8
6 changed files with 20 additions and 18 deletions

View File

@ -1,7 +0,0 @@
package com.muyu;
public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}

View File

@ -7,6 +7,8 @@ import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
@ -22,6 +24,7 @@ import org.hibernate.validator.constraints.Length;
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder @Builder
@TableName(value = "activity_team_open_info")
public class ActivityTeamOpenInfo implements Serializable { public class ActivityTeamOpenInfo implements Serializable {
/** /**

View File

@ -1,5 +1,7 @@
package com.muyu.marketing.controller; package com.muyu.marketing.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.muyu.common.core.domain.Result; import com.muyu.common.core.domain.Result;
import com.muyu.common.core.web.page.TableDataInfo; import com.muyu.common.core.web.page.TableDataInfo;
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel; import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
@ -15,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
import java.util.concurrent.Phaser;
@Api(tags = "商品拼团信息") @Api(tags = "商品拼团信息")
@RestController @RestController
@RequestMapping("/team") @RequestMapping("/team")
@ -27,16 +31,16 @@ public class ActivityTeamController {
* @return * @return
*/ */
@PostMapping("list") @PostMapping("list")
public Result<TableDataInfo<TeamInfoListResp>> list(@RequestBody TeamInfoReqListReq teamInfoReqListReq){ public Result<PageInfo<TeamInfoListResp>> list(@RequestBody TeamInfoReqListReq teamInfoReqListReq){
PageHelper.startPage(teamInfoReqListReq.getPageNum(),teamInfoReqListReq.getPageSize());
TableDataInfo<ActivityTeamInfoListModel> tableDataInfo = activityTeamInfoService.query(teamInfoReqListReq.buildQueryModel()); TableDataInfo<ActivityTeamInfoListModel> tableDataInfo = activityTeamInfoService.query(teamInfoReqListReq.buildQueryModel());
List<TeamInfoListResp> respList = tableDataInfo.getRows().stream().map(TeamInfoListResp::listModelBuild).toList(); List<TeamInfoListResp> respList = tableDataInfo.getRows().stream().map(TeamInfoListResp::listModelBuild).toList();
return Result.success( PageInfo<TeamInfoListResp> pageInfo = new PageInfo<>(respList);
new TableDataInfo<>(){{ return Result.success(pageInfo);
setRows(respList); // new TableDataInfo<>(){{
setTotal(tableDataInfo.getTotal()); // setRows(respList);
}} // setTotal(tableDataInfo.getTotal());
); // }}
} }
/** /**

View File

@ -14,7 +14,7 @@ public class ActivityOpenInfoServiceImpl extends ServiceImpl<ActivityTeamOpenInf
public Long getTeamOpenNumberByTeamIdAndType(Long teamId) { public Long getTeamOpenNumberByTeamIdAndType(Long teamId) {
LambdaQueryWrapper<ActivityTeamOpenInfo> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ActivityTeamOpenInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActivityTeamOpenInfo::getTeamId,teamId); queryWrapper.eq(ActivityTeamOpenInfo::getTeamId,teamId);
queryWrapper.eq(ActivityTeamOpenInfo::getTeamType,TeamOpenTypeEnum.OPEN_TEAM.Code()); queryWrapper.eq(ActivityTeamOpenInfo::getTeamType,TeamOpenTypeEnum.OPEN_TEAM.Label());
return this.count(queryWrapper); return this.count(queryWrapper);
} }
@ -22,7 +22,7 @@ public class ActivityOpenInfoServiceImpl extends ServiceImpl<ActivityTeamOpenInf
public Long getTeamInNumberByTeamIdAndType(Long teamId) { public Long getTeamInNumberByTeamIdAndType(Long teamId) {
LambdaQueryWrapper<ActivityTeamOpenInfo> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ActivityTeamOpenInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ActivityTeamOpenInfo::getTeamId,teamId); queryWrapper.eq(ActivityTeamOpenInfo::getTeamId,teamId);
queryWrapper.eq(ActivityTeamOpenInfo::getTeamType,TeamOpenTypeEnum.IN_TEAM.Code()); queryWrapper.eq(ActivityTeamOpenInfo::getTeamType,TeamOpenTypeEnum.IN_TEAM.Label());
return this.count(queryWrapper); return this.count(queryWrapper);
} }
} }

View File

@ -29,6 +29,8 @@ import java.util.List;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Stream; import java.util.stream.Stream;
import static com.muyu.common.core.utils.PageUtils.startPage;
/** /**
* Service * Service
* *