¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.cloud.web; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.annotation.LoginNoRequired; |
| | | import com.doumee.config.annotation.LoginRequired; |
| | | import com.doumee.core.annotation.trace.Trace; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.dao.business.model.PlatformBooks; |
| | | import com.doumee.dao.business.model.PlatformJob; |
| | | import com.doumee.dao.business.model.Visits; |
| | | import com.doumee.dao.web.reqeust.*; |
| | | import com.doumee.dao.web.response.DriverHomeVO; |
| | | import com.doumee.dao.web.response.LineUpVO; |
| | | import com.doumee.dao.web.response.MemberVO; |
| | | import com.doumee.dao.web.response.VisitRecordVO; |
| | | import com.doumee.service.business.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | | * |
| | | * @Author : Rk |
| | | * @create 2023/12/28 14:31 |
| | | */ |
| | | |
| | | @Api(tags = "ãå
¬ä¼å·ãç©æµè½¦å¸æºä¸å¡") |
| | | @Trace(exclude = true) |
| | | @RestController |
| | | @RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/web/driverPlatform") |
| | | @Slf4j |
| | | @LoginNoRequired |
| | | public class DriverPlatformController extends BaseController { |
| | | |
| | | @Autowired |
| | | private VisitsService visitsService; |
| | | |
| | | @Autowired |
| | | private PlatformJobService platformJobService; |
| | | |
| | | @Autowired |
| | | private PlatformBooksService platformBooksService; |
| | | |
| | | @ApiOperation("叿ºé¦é¡µä¿¡æ¯") |
| | | @GetMapping("/driverHome") |
| | | public ApiResponse<DriverHomeVO> driverHome (@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | DriverHomeVO driverHomeVO = platformJobService.getDriverHome(getLoginUser(token).getMemberId()); |
| | | return ApiResponse.success(driverHomeVO); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("æ¥è¯¢å¯é¢çº¦é") |
| | | @PostMapping("/checkSurplusNum") |
| | | public ApiResponse<BigDecimal> checkSurplusNum (@RequestBody PlatformBooksCheckNumDTO platformBooksCheckNumDTO , @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success(platformBooksService.checkNum(platformBooksCheckNumDTO)); |
| | | } |
| | | |
| | | @ApiOperation("ç©æµè½¦é¢çº¦") |
| | | @PostMapping("/checkSurplusNum") |
| | | public ApiResponse<Integer> checkSurplusNum (@RequestBody PlatformBooksApplyDTO platformBooksApplyDTO , @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | platformBooksApplyDTO.setUserId(getLoginUser(token).getMemberId()); |
| | | return ApiResponse.success(platformBooksService.apply(platformBooksApplyDTO)); |
| | | } |
| | | |
| | | @ApiOperation("ç©æµè½¦é¢çº¦è®°å½") |
| | | @PostMapping("/page") |
| | | public ApiResponse<PageData<PlatformBooks>> findPage (@RequestBody PageWrap<PlatformBooks> pageWrap, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | pageWrap.getModel().setQueryDate(DateUtil.getBeforDay(new Date(),30)); |
| | | return ApiResponse.success(platformBooksService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("ç©æµè½¦é¢çº¦è¯¦æ
") |
| | | @GetMapping("/getDetail") |
| | | public ApiResponse<PlatformBooks> getDetail (@RequestParam Integer id, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | PlatformBooks platformBooks = platformBooksService.getDetail(id,getLoginUser(token).getMemberId()); |
| | | return ApiResponse.success(platformBooks); |
| | | } |
| | | |
| | | @ApiOperation("ç©æµè½¦é¢çº¦æ¤é") |
| | | @PostMapping("/revoke") |
| | | public ApiResponse revoke (@RequestBody RevokeDTO revokeDTO, @RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | platformBooksService.revoke(revokeDTO,getLoginUser(token)); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | |
| | | /******************************************************叿ºä»»å¡æ¥å£************************************************************************/ |
| | | |
| | | @ApiOperation("ä»»å¡ç¾å°") |
| | | @PostMapping("/signIn") |
| | | public ApiResponse signIn (@RequestBody SignInDTO signInDTO, @RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | signInDTO.setLoginUserInfo(getLoginUser(token)); |
| | | platformJobService.signIn(signInDTO); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | @ApiOperation("ä»»å¡è¯¦æ
") |
| | | @PostMapping("/jobDetail") |
| | | public ApiResponse<PlatformJob> jobDetail (@RequestBody JobDetailDTO jobDetailDTO, @RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | return ApiResponse.success(platformJobService.getDetail(jobDetailDTO)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("æ¥è¯¢æéæ
åµ") |
| | | @PostMapping("/jobDetail") |
| | | public ApiResponse<LineUpVO> lineUpDetail (@RequestBody LineUpDetailDTO lineUpDetailDTO, @RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | return ApiResponse.success(platformJobService.lineUpDetail(lineUpDetailDTO)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |