package com.panzhihua.applets.api;
|
|
|
import com.panzhihua.common.model.dtos.property.CommonPage;
|
import com.panzhihua.common.model.vos.R;
|
import com.panzhihua.common.model.vos.community.social.SocialProjectVO;
|
import com.panzhihua.common.service.community.CommunityService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
|
/**
|
* 三社联动项目表(ComActSocialProject)表控制层
|
*
|
* @author zzj
|
* @since 2021-12-22 14:02:48
|
*/
|
@Slf4j
|
@Api(tags = {"项目管理"})
|
@RestController
|
@RequestMapping("comActSocialProject")
|
public class ComActSocialProjectApi {
|
/**
|
* 服务对象
|
*/
|
@Resource
|
private CommunityService communityService;
|
|
/**
|
* 分页查询所有数据
|
*
|
* @param commonPage 查询实体
|
* @return 所有数据
|
*/
|
@ApiOperation(value = "分页查询接口",response =SocialProjectVO.class )
|
@PostMapping("queryAll")
|
public R selectAll(@RequestBody CommonPage commonPage) {
|
return communityService.selectAllComActSocialProject(commonPage);
|
}
|
|
/**
|
* 平台详情接口
|
*
|
* @param id 主键
|
* @return 单条数据
|
*/
|
@ApiOperation(value = "平台详情接口",response =SocialProjectVO.class )
|
@GetMapping("{id}")
|
public R selectOne(@PathVariable("id") Long id) {
|
return communityService.getAppletComActSocialProject(id);
|
}
|
/**
|
* 根据项目id分页获取关联项目
|
*/
|
@ApiOperation(value = "根据项目id分页获取关联项目")
|
@PostMapping("/getRelation")
|
public R getRelation(@RequestBody CommonPage commonPage){
|
return communityService.getRelationComActSocialProject(commonPage);
|
}
|
|
/**
|
* 新增数据
|
*
|
* @param socialProjectVO 实体对象
|
* @return 新增结果
|
*/
|
@ApiOperation(value = "新增数据")
|
@PostMapping
|
public R insert(@RequestBody SocialProjectVO socialProjectVO) {
|
return communityService.insertComActSocialProject(socialProjectVO);
|
}
|
|
/**
|
* 修改数据
|
*
|
* @param socialProjectVO 实体对象
|
* @return 修改结果
|
*/
|
@ApiOperation(value = "修改数据")
|
@PostMapping("/update")
|
public R update(@RequestBody SocialProjectVO socialProjectVO) {
|
return communityService.updateComActSocialProject(socialProjectVO);
|
}
|
|
/**
|
* 删除数据
|
*
|
* @param id 主键结合
|
* @return 删除结果
|
*/
|
@ApiOperation(value = "删除数据")
|
@GetMapping("del")
|
public R delete(@RequestParam("id") Long id) {
|
return communityService.deleteComActSocialProject(id);
|
}
|
|
}
|