| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.VolunteerActivityVO; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.service.VolunteerActivityService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/Volunteer") |
| | | public class VolunteerActivityApi |
| | | public class VolunteerActivityApi extends BaseController |
| | | { |
| | | @Resource |
| | | private VolunteerActivityService volunteerActivityService; |
| | |
| | | @GetMapping("/queryById") |
| | | public R queryById(@RequestParam("id") String id) |
| | | { |
| | | return R.ok(volunteerActivityService.queryById(id)); |
| | | return R.ok(volunteerActivityService.queryById(id,getUserId()+"")); |
| | | } |
| | | |
| | | /** |
| | |
| | | @RequestParam(value = "actityBeginTime", required = false) Date actityBeginTime, |
| | | @RequestParam(value = "actityEndTime", required = false) Date actityEndTime) |
| | | { |
| | | if(StringUtils.isEmpty(acState)) |
| | | { |
| | | acState=null; |
| | | } |
| | | |
| | | return R.ok(volunteerActivityService.queryList(pageNum, pageSize, name, acState, acType, actityBeginTime, actityEndTime)); |
| | | if(StringUtils.isEmpty(acType)) |
| | | { |
| | | acType=null; |
| | | } |
| | | return R.ok(volunteerActivityService.queryList(pageNum, pageSize, name, acState, acType,getUserId()+"", actityBeginTime, actityEndTime)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @PostMapping("/insertVolunteer") |
| | | R insertVolunteer(@RequestBody VolunteerActivityVO volunteerActivityVO) |
| | | { |
| | | if(StringUtils.isEmpty(volunteerActivityVO.getCommunityId())) |
| | | { |
| | | volunteerActivityVO.setCommunityId(getCommunityId()+""); |
| | | } |
| | | int num = volunteerActivityService.insertVolunteer(volunteerActivityVO); |
| | | if(num>0) |
| | | { |
| | |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping("/timedTaskVolunteerActivitiesJobHandler") |
| | | R timedTaskVolunteerActivitiesJobHandler() |
| | | { |
| | | int num = volunteerActivityService.timedTaskVolunteerActivitiesJobHandler(); |
| | | if(num>0) |
| | | { |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | |
| | | } |