SellerLoginController.java 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package com.zhongzheng.controller.distribution;
  2. import com.zhongzheng.common.core.controller.BaseController;
  3. import com.zhongzheng.common.core.domain.AjaxResult;
  4. import com.zhongzheng.modules.distribution.bo.SellerAppAccountLoginBo;
  5. import com.zhongzheng.modules.distribution.bo.SellerAppRegisterBo;
  6. import com.zhongzheng.modules.distribution.service.IDistributionSellerService;
  7. import com.zhongzheng.modules.user.bo.*;
  8. import com.zhongzheng.modules.user.service.IUserService;
  9. import io.swagger.annotations.Api;
  10. import io.swagger.annotations.ApiOperation;
  11. import lombok.RequiredArgsConstructor;
  12. import org.springframework.beans.factory.annotation.Autowired;
  13. import org.springframework.web.bind.annotation.PostMapping;
  14. import org.springframework.web.bind.annotation.RequestBody;
  15. import org.springframework.web.bind.annotation.RequestMapping;
  16. import org.springframework.web.bind.annotation.RestController;
  17. import java.util.Map;
  18. /**
  19. * 客户端用户Controller
  20. *
  21. * @author hjl
  22. * @date 2021-06-08
  23. */
  24. @Api(value = "短信控制器", tags = {"登录控制器"})
  25. @RequiredArgsConstructor(onConstructor_ = @Autowired)
  26. @RestController
  27. @RequestMapping("/app/common/seller")
  28. public class SellerLoginController extends BaseController {
  29. private final IDistributionSellerService iDistributionSellerService;
  30. /**
  31. * 用户注册
  32. */
  33. @ApiOperation("业务员客户端注册")
  34. @PostMapping("/register")
  35. public AjaxResult<Void> register(@RequestBody SellerAppRegisterBo bo) {
  36. return toAjax(iDistributionSellerService.registerSeller(bo) ? 1 : 0);
  37. }
  38. @ApiOperation("业务员忘记密码")
  39. @PostMapping("/register_forget")
  40. public AjaxResult<Void> register_forget(@RequestBody SellerAppRegisterBo bo) {
  41. return toAjax(iDistributionSellerService.forgetUser(bo) ? 1 : 0);
  42. }
  43. @ApiOperation("业务员账号登录")
  44. @PostMapping("/account_login")
  45. public AjaxResult account_login(@RequestBody SellerAppAccountLoginBo bo) {
  46. Map<String,Object> map = iDistributionSellerService.accountLogin(bo);
  47. return AjaxResult.success(map);
  48. }
  49. }