| | |
| | | import com.doumee.core.annotation.trace.Trace; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.dao.business.model.Member; |
| | | import com.doumee.dao.dto.ShopLoginDTO; |
| | | import com.doumee.dao.dto.WxPhoneRequest; |
| | | import com.doumee.dao.vo.AccountResponse; |
| | | import com.doumee.dao.vo.ShopLoginVO; |
| | | import com.doumee.service.business.MemberService; |
| | | import com.doumee.service.business.ShopInfoService; |
| | | 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.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private MemberService memberService; |
| | | |
| | | @Autowired |
| | | private ShopInfoService shopInfoService; |
| | | |
| | | |
| | | @Trace |
| | | @ApiOperation(value = "微信授权", notes = "小程序端") |
| | | @ApiOperation(value = "会员微信授权", notes = "小程序端") |
| | | @GetMapping("/wxLogin") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", dataType = "String", name = "code", value = "微信code", required = true) |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "授权手机号", notes = "小程序端") |
| | | @ApiOperation(value = "会员授权手机号", notes = "小程序端") |
| | | @PostMapping("/wxAuthPhone") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", dataType = "String", name = "code", value = "微信code", required = true) |
| | |
| | | return ApiResponse.success("操作成功",memberService.wxAuthPhone(wxPhoneRequest)); |
| | | } |
| | | |
| | | @LoginRequired |
| | | @ApiOperation(value = "退出登录", notes = "小程序端") |
| | | @GetMapping("/logOff") |
| | | |
| | | @ApiOperation(value = "门店账号密码登录", notes = "小程序端,门店用户通过手机号+密码登录") |
| | | @PostMapping("/shopLogin") |
| | | public ApiResponse<ShopLoginVO> shopLogin(@RequestBody @Validated ShopLoginDTO dto) { |
| | | return ApiResponse.success("操作成功", shopInfoService.shopPasswordLogin(dto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "门店静默登录", notes = "根据openid自动登录门店,未绑定则返回空") |
| | | @GetMapping("/shopSilentLogin") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), |
| | | @ApiImplicitParam(paramType = "query", dataType = "String", name = "openid", value = "微信openid", required = true) |
| | | }) |
| | | public ApiResponse logOff() { |
| | | String token = this.getRequest().getHeader(JwtTokenUtil.HEADER_KEY); |
| | | memberService.logOut(token,getMemberId()); |
| | | return ApiResponse.success("操作成功"); |
| | | public ApiResponse<ShopLoginVO> shopSilentLogin(@RequestParam String openid) { |
| | | return ApiResponse.success("操作成功", shopInfoService.shopSilentLogin(openid)); |
| | | } |
| | | |
| | | @LoginRequired |
| | | @ApiOperation(value = "用户注销", notes = "小程序端") |
| | | @ApiOperation(value = "退出登录", notes = "小程序端") |
| | | @GetMapping("/logOut") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), |
| | |
| | | return ApiResponse.success("操作成功"); |
| | | } |
| | | |
| | | @LoginRequired |
| | | @ApiOperation(value = "用户注销", notes = "小程序端") |
| | | @GetMapping("/logOff") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), |
| | | }) |
| | | public ApiResponse logOff() { |
| | | String token = this.getRequest().getHeader(JwtTokenUtil.HEADER_KEY); |
| | | memberService.logOff(token,getMemberId()); |
| | | return ApiResponse.success("操作成功"); |
| | | } |
| | | |
| | | |
| | | |
| | | |