package com.panzhihua.service_community.api;
|
|
import javax.annotation.Resource;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import com.panzhihua.common.model.dtos.community.easyPhoto.AddEasyPhotoActivityDTO;
|
import com.panzhihua.common.model.dtos.community.easyPhoto.EditEasyPhotoActivityDTO;
|
import com.panzhihua.common.model.dtos.community.easyPhoto.PageEasyPhotoActivityDTO;
|
import com.panzhihua.common.model.dtos.community.easyPhoto.PageEasyPhotoActivityUserDTO;
|
import com.panzhihua.common.model.vos.R;
|
import com.panzhihua.service_community.service.ComActEasyPhotoActivityService;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@Slf4j
|
@RestController
|
@RequestMapping("/easy/photo/activity")
|
public class EasyPhotoActivityApi {
|
|
@Resource
|
private ComActEasyPhotoActivityService comActEasyPhotoActivityService;
|
|
/**
|
* 社区后台-分页查询随手拍活动列表
|
*
|
* @param pageEasyPhotoActivityDTO
|
* 请求参数
|
* @return 随手拍活动列表
|
*/
|
@PostMapping("/page")
|
public R page(@RequestBody PageEasyPhotoActivityDTO pageEasyPhotoActivityDTO) {
|
return comActEasyPhotoActivityService.pageActivity(pageEasyPhotoActivityDTO);
|
}
|
|
/**
|
* 社区后台-添加随手拍活动
|
*
|
* @param addEasyPhotoActivityDTO
|
* 请求参数
|
* @return 添加结果
|
*/
|
@PostMapping("/add")
|
public R add(@RequestBody AddEasyPhotoActivityDTO addEasyPhotoActivityDTO) {
|
return comActEasyPhotoActivityService.addActivity(addEasyPhotoActivityDTO);
|
}
|
|
/**
|
* 社区后台-编辑随手拍活动
|
*
|
* @param editEasyPhotoActivityDTO
|
* 请求参数
|
* @return 编辑结果
|
*/
|
@PostMapping("/edit")
|
public R edit(@RequestBody EditEasyPhotoActivityDTO editEasyPhotoActivityDTO) {
|
return comActEasyPhotoActivityService.editActivity(editEasyPhotoActivityDTO);
|
}
|
|
/**
|
* 社区后台-取消随手拍活动
|
*
|
* @param id
|
* 随手拍活动id
|
* @return 取消结果
|
*/
|
@GetMapping("/cancel")
|
public R cancel(@RequestParam("id") Long id) {
|
return comActEasyPhotoActivityService.cancelActivity(id);
|
}
|
|
/**
|
* 分页查询随手拍活动下居民参与记录
|
*
|
* @param pageEasyPhotoActivityUserDTO
|
* 请求参数
|
* @return 居民参与记录
|
*/
|
@PostMapping("/page/user")
|
public R pageUser(@RequestBody PageEasyPhotoActivityUserDTO pageEasyPhotoActivityUserDTO) {
|
return comActEasyPhotoActivityService.pageActivityUser(pageEasyPhotoActivityUserDTO);
|
}
|
|
}
|