| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.vaccines.VaccinesEnrollByAppDTO; |
| | | import com.panzhihua.common.model.dtos.vaccines.VaccinesEnrollUserByAppDTO; |
| | |
| | | import com.panzhihua.common.model.vos.vaccines.VaccinesEnrollUserByAppVO; |
| | | import com.panzhihua.common.model.vos.vaccines.VaccinesUserInoculationByAppVO; |
| | | 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.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @auther lyq |
| | |
| | | @RestController |
| | | @RequestMapping("/vaccines/") |
| | | @Api(tags = {"疫苗服务"}) |
| | | public class VaccinesApi extends BaseController{ |
| | | public class VaccinesApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "疫苗分类列表" , response = VaccinesByAppVO.class) |
| | | @ApiOperation(value = "疫苗分类列表", response = VaccinesByAppVO.class) |
| | | @PostMapping("list") |
| | | public R getVaccinesListByApp() { |
| | | return communityService.getVaccinesListByApp(); |
| | | } |
| | | |
| | | @ApiOperation(value = "疫苗类型对应家庭成员接种列表" , response = VaccinesEnrollUserByAppVO.class) |
| | | @ApiOperation(value = "疫苗类型对应家庭成员接种列表", response = VaccinesEnrollUserByAppVO.class) |
| | | @PostMapping("user/list") |
| | | public R getVaccinesUserListByApp(@RequestBody VaccinesEnrollUserByAppDTO enrollUserByAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if(loginUserInfo == null){ |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | enrollUserByAppDTO.setUserId(loginUserInfo.getUserId()); |
| | |
| | | |
| | | @ApiOperation(value = "用户疫苗报名") |
| | | @PostMapping("enroll") |
| | | public R VaccinesEnrollByApp(@RequestBody VaccinesEnrollByAppDTO enrollByAppDTO){ |
| | | public R VaccinesEnrollByApp(@RequestBody VaccinesEnrollByAppDTO enrollByAppDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if(loginUserInfo == null){ |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | enrollByAppDTO.setUserId(loginUserInfo.getUserId()); |
| | |
| | | return communityService.VaccinesEnrollByApp(enrollByAppDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户家庭接种记录" , response = VaccinesUserInoculationByAppVO.class) |
| | | @ApiOperation(value = "用户家庭接种记录", response = VaccinesUserInoculationByAppVO.class) |
| | | @PostMapping("user/inoculation/list") |
| | | public R getVaccinesUserInoculationListByApp() { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if(loginUserInfo == null){ |
| | | if (loginUserInfo == null) { |
| | | return R.fail("请先登录"); |
| | | } |
| | | return communityService.getVaccinesUserInoculationListByApp(loginUserInfo.getUserId()); |