| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.cloud.web; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.annotation.LoginNoRequired; |
| | | import com.doumee.core.annotation.trace.Trace; |
| | | import com.doumee.service.business.third.model.ApiResponse; |
| | | import com.doumee.service.business.third.model.LoginUserInfo; |
| | | import com.doumee.service.business.third.model.PageData; |
| | | import com.doumee.service.business.third.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.model.VisitReason; |
| | | import com.doumee.dao.business.model.Visits; |
| | | import com.doumee.dao.web.reqeust.CheckVisitedDTO; |
| | | import com.doumee.dao.web.response.MemberVO; |
| | | import com.doumee.dao.web.response.VisitDetailVO; |
| | | import com.doumee.dao.web.response.WxAuthorizeVO; |
| | | import com.doumee.service.business.MemberService; |
| | | import com.doumee.service.business.VisitReasonService; |
| | | import com.doumee.service.business.VisitsService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | | * |
| | | * @Author : Rk |
| | | * @create 2023/12/7 10:40 |
| | | */ |
| | | |
| | | @Api(tags = "ãå
¬ä¼å·ã访客ä¸å¡") |
| | | @Trace(exclude = true) |
| | | @RestController |
| | | @LoginNoRequired |
| | | @RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/web/visitor") |
| | | @Slf4j |
| | | public class VisitorWebController extends BaseController { |
| | | |
| | | @Autowired |
| | | private MemberService memberService; |
| | | |
| | | @Autowired |
| | | private VisitsService visitsService; |
| | | |
| | | @Autowired |
| | | private VisitReasonService visitReasonService; |
| | | |
| | | @ApiOperation(value = "访客微信ææ", notes = "访客微信ææè·åopenId") |
| | | @GetMapping("/wxAuthorize") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", dataType = "String", name = "code", value = "ææç ", required = true), |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "source", value = "æ¥æº:0=叿ºï¼1=访客ï¼2=å
é¨åå·¥", required = true) |
| | | }) |
| | | public ApiResponse<WxAuthorizeVO> wxAuthorize(@RequestParam String code,@RequestParam Integer source) { |
| | | WxAuthorizeVO wxAuthorizeVO = memberService.wxAuthorize(code,source); |
| | | return ApiResponse.success("æ¥è¯¢æå",wxAuthorizeVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢è¢«è®¿é®äººä¿¡æ¯", notes = "æ¥è¯¢è¢«è®¿é®äººä¿¡æ¯") |
| | | @PostMapping("/getVisitedMember") |
| | | public ApiResponse<List<MemberVO>> getVisitedMember(@Valid @RequestBody CheckVisitedDTO checkVisitedDTO) { |
| | | return ApiResponse.success("æ¥è¯¢æå", memberService.getVisitedMember(checkVisitedDTO)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "è®¿å®¢è®°å½æäº¤", notes = "访客æäº¤") |
| | | @PostMapping("/createFk") |
| | | public ApiResponse createFk(@RequestBody Visits visits) { |
| | | visits.setSourceType(Constants.ZERO); |
| | | return ApiResponse.success("æ¥è¯¢æå", visitsService.createFk(visits,false,Constants.ZERO)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "æ¥è®¿äºç±", notes = "æ¥è®¿äºç±") |
| | | @PostMapping("/visitReason") |
| | | public ApiResponse<List<VisitReason>> visitReason() { |
| | | return ApiResponse.success("æ¥è¯¢æå", visitReasonService.findList(null)); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "访客记å½è¯¦æ
", notes = "访客记å½è¯¦æ
") |
| | | @GetMapping("/detail") |
| | | public ApiResponse<VisitDetailVO> detail(@RequestParam Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | LoginUserInfo loginUserInfo = getLoginUser(token); |
| | | return ApiResponse.success("æ¥è¯¢æå", visitsService.getVisitDetail(id, Objects.isNull(loginUserInfo)?null:loginUserInfo.getMemberId())); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("è®¿å®¢è®°å½ - å页å表") |
| | | @PostMapping("/visitPage") |
| | | public ApiResponse<PageData<Visits>> visitPage (@RequestBody PageWrap<Visits> pageWrap) { |
| | | if(Objects.isNull(pageWrap.getModel()) || StringUtils.isBlank(pageWrap.getModel().getOpenid())){ |
| | | pageWrap.getModel().setMemberId(0); |
| | | }else{ |
| | | if(Objects.nonNull(pageWrap.getModel()) && Objects.nonNull(pageWrap.getModel().getStatus()) ){ |
| | | pageWrap.getModel().setBusinessStatus(pageWrap.getModel().getStatus()); |
| | | pageWrap.getModel().setStatus(null); |
| | | } |
| | | } |
| | | return ApiResponse.success(visitsService.findPage(pageWrap)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |