Commit d51e654c d51e654c57c211050a8ab1b695f4b06c061baf48 by xianghan

1.添加海南app登录实现逻辑

1 parent bc32e2f6
...@@ -21,7 +21,7 @@ public interface UserAppService { ...@@ -21,7 +21,7 @@ public interface UserAppService {
21 * @param username 21 * @param username
22 * @return 22 * @return
23 */ 23 */
24 UserAppDTO findByUserName(String username); 24 UserAppDTO findByUsername(String username);
25 25
26 26
27 /** 27 /**
...@@ -30,7 +30,7 @@ public interface UserAppService { ...@@ -30,7 +30,7 @@ public interface UserAppService {
30 * @param password 30 * @param password
31 * @return 31 * @return
32 */ 32 */
33 UserAppDTO findByUserNameAndPassword(String username, String password); 33 UserAppDTO findByUsernameAndPassword(String username, String password);
34 34
35 /** 35 /**
36 * 检查账号和验证码 36 * 检查账号和验证码
...@@ -38,7 +38,7 @@ public interface UserAppService { ...@@ -38,7 +38,7 @@ public interface UserAppService {
38 * @param VerificationCode 38 * @param VerificationCode
39 * @return 39 * @return
40 */ 40 */
41 UserAppDTO findByUserNameAndVerificationCode(String username, String VerificationCode); 41 UserAppDTO findByUsernameAndVerificationCode(String username, String VerificationCode);
42 42
43 /** 43 /**
44 * 检查通过第三方账号 44 * 检查通过第三方账号
......
...@@ -34,8 +34,6 @@ public class UserAppServiceImpl implements UserAppService { ...@@ -34,8 +34,6 @@ public class UserAppServiceImpl implements UserAppService {
34 private UserAppRepository userAppRepository; 34 private UserAppRepository userAppRepository;
35 @Autowired 35 @Autowired
36 private UserAppMapper userAppMapper; 36 private UserAppMapper userAppMapper;
37 @Autowired
38 private MemberService memberService;
39 37
40 38
41 @Override 39 @Override
...@@ -48,21 +46,22 @@ public class UserAppServiceImpl implements UserAppService { ...@@ -48,21 +46,22 @@ public class UserAppServiceImpl implements UserAppService {
48 46
49 @Override 47 @Override
50 @Transactional(readOnly = true) 48 @Transactional(readOnly = true)
51 public UserAppDTO findByUserName(String username) { 49 public UserAppDTO findByUsername(String username) {
52 UserApp userApp = this.userAppRepository.findByUsername(username).orElseGet(UserApp::new); 50 UserApp userApp = this.userAppRepository.findByUsername(username).orElseGet(UserApp::new);
53 return this.userAppMapper.toDto(userApp); 51 return this.userAppMapper.toDto(userApp);
54 } 52 }
55 53
56 @Override 54 @Override
57 @Transactional(readOnly = true) 55 @Transactional(readOnly = true)
58 public UserAppDTO findByUserNameAndPassword(String username, String password) { 56 public UserAppDTO findByUsernameAndPassword(String username, String password) {
59 UserApp userApp = this.userAppRepository.findByUsernameAndPassword(username, password).orElseGet(UserApp::new); 57 UserApp userApp = this.userAppRepository.findByUsernameAndPassword(username, password).orElseGet(UserApp::new);
60 return this.userAppMapper.toDto(userApp); 58 return this.userAppMapper.toDto(userApp);
61 } 59 }
62 60
63 @Override 61 @Override
64 @Transactional(readOnly = true) 62 @Transactional(readOnly = true)
65 public UserAppDTO findByUserNameAndVerificationCode(String username, String VerificationCode) { 63 public UserAppDTO findByUsernameAndVerificationCode(String username, String VerificationCode) {
64 // TDDO 需要接入短信网关
66 UserApp userApp = null; 65 UserApp userApp = null;
67 return this.userAppMapper.toDto(userApp); 66 return this.userAppMapper.toDto(userApp);
68 } 67 }
......
1 package com.topdraw.business.process.rest; 1 package com.topdraw.business.process.rest;
2 2
3 import cn.hutool.core.util.ObjectUtil; 3 import cn.hutool.core.util.ObjectUtil;
4 import cn.hutool.core.util.StrUtil;
5 4
6 import com.alibaba.fastjson.JSONObject; 5 import com.alibaba.fastjson.JSONObject;
7 import com.topdraw.annotation.AnonymousAccess; 6 import com.topdraw.annotation.AnonymousAccess;
8 import com.topdraw.annotation.Log; 7 import com.topdraw.annotation.Log;
9 import com.topdraw.business.module.common.validated.CreateGroup; 8 import com.topdraw.business.module.common.validated.CreateGroup;
10 import com.topdraw.business.module.common.validated.UpdateGroup; 9 import com.topdraw.business.module.common.validated.UpdateGroup;
11 import com.topdraw.business.module.member.domain.Member;
12 import com.topdraw.business.module.member.service.MemberService; 10 import com.topdraw.business.module.member.service.MemberService;
13 import com.topdraw.business.module.member.service.dto.MemberDTO; 11 import com.topdraw.business.module.member.service.dto.MemberDTO;
14 import com.topdraw.business.module.user.app.domain.UserApp; 12 import com.topdraw.business.module.user.app.domain.UserApp;
...@@ -35,13 +33,11 @@ import io.swagger.annotations.Api; ...@@ -35,13 +33,11 @@ import io.swagger.annotations.Api;
35 import io.swagger.annotations.ApiOperation; 33 import io.swagger.annotations.ApiOperation;
36 import lombok.extern.slf4j.Slf4j; 34 import lombok.extern.slf4j.Slf4j;
37 import org.apache.commons.lang3.StringUtils; 35 import org.apache.commons.lang3.StringUtils;
38 import org.springframework.beans.BeanUtils;
39 import org.springframework.beans.factory.annotation.Autowired; 36 import org.springframework.beans.factory.annotation.Autowired;
40 import org.springframework.util.Assert; 37 import org.springframework.util.Assert;
41 import org.springframework.validation.annotation.Validated; 38 import org.springframework.validation.annotation.Validated;
42 import org.springframework.web.bind.annotation.*; 39 import org.springframework.web.bind.annotation.*;
43 40
44 import javax.validation.constraints.NotNull;
45 import java.io.IOException; 41 import java.io.IOException;
46 import java.net.URLDecoder; 42 import java.net.URLDecoder;
47 import java.sql.Timestamp; 43 import java.sql.Timestamp;
...@@ -77,18 +73,18 @@ public class UserOperationController { ...@@ -77,18 +73,18 @@ public class UserOperationController {
77 @ApiOperation("app登录") 73 @ApiOperation("app登录")
78 @AnonymousAccess 74 @AnonymousAccess
79 public ResultInfo appLogin(@Validated @RequestBody UserApp resources) { 75 public ResultInfo appLogin(@Validated @RequestBody UserApp resources) {
80 log.info("新增App账号 ==>> param ==>> [addLogin#{}]", resources); 76 log.info("app登录 ==>> param ==>> [appLogin#{}]", resources);
81 77
82 this.userOperationService.appLogin(resources); 78 UserTvDTO userTvDTO = this.userOperationService.appLogin(resources);
83 return ResultInfo.success(); 79 return ResultInfo.success();
84 } 80 }
85 81
86 @Log 82 @Log
87 @PostMapping(value = "/appLogin") 83 @PostMapping(value = "/updateUserApp")
88 @ApiOperation("app登录") 84 @ApiOperation("修改app账号信息")
89 @AnonymousAccess 85 @AnonymousAccess
90 public ResultInfo updateAppCount(@Validated @RequestBody UserApp resources) { 86 public ResultInfo updateUserApp(@Validated @RequestBody UserApp resources) {
91 log.info("新增App账号 ==>> param ==>> [addLogin#{}]", resources); 87 log.info("修改app账号信息 ==>> param ==>> [updateUserApp#{}]", resources);
92 88
93 this.userOperationService.appLogin(resources); 89 this.userOperationService.appLogin(resources);
94 return ResultInfo.success(); 90 return ResultInfo.success();
......
...@@ -172,6 +172,6 @@ public interface UserOperationService { ...@@ -172,6 +172,6 @@ public interface UserOperationService {
172 * 172 *
173 * @param resources 173 * @param resources
174 */ 174 */
175 void appLogin(UserApp resources); 175 UserTvDTO appLogin(UserApp resources);
176 176
177 } 177 }
......
...@@ -12,6 +12,8 @@ import com.topdraw.business.module.member.service.MemberService; ...@@ -12,6 +12,8 @@ import com.topdraw.business.module.member.service.MemberService;
12 import com.topdraw.business.module.member.service.dto.MemberDTO; 12 import com.topdraw.business.module.member.service.dto.MemberDTO;
13 import com.topdraw.business.module.member.service.dto.MemberSimpleDTO; 13 import com.topdraw.business.module.member.service.dto.MemberSimpleDTO;
14 import com.topdraw.business.module.user.app.domain.UserApp; 14 import com.topdraw.business.module.user.app.domain.UserApp;
15 import com.topdraw.business.module.user.app.service.UserAppService;
16 import com.topdraw.business.module.user.app.service.dto.UserAppDTO;
15 import com.topdraw.business.module.user.iptv.domain.UserConstant; 17 import com.topdraw.business.module.user.iptv.domain.UserConstant;
16 import com.topdraw.business.module.user.iptv.domain.UserTv; 18 import com.topdraw.business.module.user.iptv.domain.UserTv;
17 import com.topdraw.business.module.user.iptv.domain.UserTvBuilder; 19 import com.topdraw.business.module.user.iptv.domain.UserTvBuilder;
...@@ -77,6 +79,8 @@ public class UserOperationServiceImpl implements UserOperationService { ...@@ -77,6 +79,8 @@ public class UserOperationServiceImpl implements UserOperationService {
77 @Autowired 79 @Autowired
78 private MemberService memberService; 80 private MemberService memberService;
79 @Autowired 81 @Autowired
82 private UserAppService userAppService;
83 @Autowired
80 private UserWeixinService userWeixinService; 84 private UserWeixinService userWeixinService;
81 @Autowired 85 @Autowired
82 private UserWeixinRepository userWeixinRepository; 86 private UserWeixinRepository userWeixinRepository;
...@@ -111,9 +115,15 @@ public class UserOperationServiceImpl implements UserOperationService { ...@@ -111,9 +115,15 @@ public class UserOperationServiceImpl implements UserOperationService {
111 115
112 @Override 116 @Override
113 @Transactional(rollbackFor = Exception.class) 117 @Transactional(rollbackFor = Exception.class)
114 public void appLogin(UserApp resources) { 118 public UserTvDTO appLogin(UserApp resources) {
119
120 String username = resources.getUsername();
121 UserAppDTO userAppDTO = this.userAppService.findByUsername(username);
122 if (Objects.nonNull(userAppDTO)) {
115 123
124 }
116 125
126 return null;
117 } 127 }
118 128
119 /** 129 /**
......