huanghongfa
2020-12-22 47de8ceefb38ee55fc577f94bfda09dd5adbd29d
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/CommunityApi.java
@@ -5,10 +5,12 @@
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.*;
import com.panzhihua.common.service.community.CommunityService;
import com.panzhihua.common.validated.AddGroup;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.util.ObjectUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -80,7 +82,7 @@
    @PostMapping("dynamicuser")
    public R addDynamicUser(@RequestBody ComActDynVO comActDynVO){
        Long id = comActDynVO.getId();
        if (ObjectUtils.isEmpty(id)||id==0) {
        if (null==id||id==0) {
            return R.fail("社区动态不存在");
        }
        Long userId = this.getUserId();
@@ -89,7 +91,7 @@
    @ApiOperation(value = "志愿者申请")
    @PostMapping("volunteer")
    public R addVolunteer(@RequestBody ComMngVolunteerMngVO comMngVolunteerMngVO){
    public R addVolunteer(@RequestBody @Validated(AddGroup.class) ComMngVolunteerMngVO comMngVolunteerMngVO){
        comMngVolunteerMngVO.setState(1);
        return communityService.addVolunteer(comMngVolunteerMngVO);
    }