Commit d51e654c d51e654c57c211050a8ab1b695f4b06c061baf48 by xianghan

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

1 parent bc32e2f6
......@@ -21,7 +21,7 @@ public interface UserAppService {
* @param username
* @return
*/
UserAppDTO findByUserName(String username);
UserAppDTO findByUsername(String username);
/**
......@@ -30,7 +30,7 @@ public interface UserAppService {
* @param password
* @return
*/
UserAppDTO findByUserNameAndPassword(String username, String password);
UserAppDTO findByUsernameAndPassword(String username, String password);
/**
* 检查账号和验证码
......@@ -38,7 +38,7 @@ public interface UserAppService {
* @param VerificationCode
* @return
*/
UserAppDTO findByUserNameAndVerificationCode(String username, String VerificationCode);
UserAppDTO findByUsernameAndVerificationCode(String username, String VerificationCode);
/**
* 检查通过第三方账号
......
......@@ -34,8 +34,6 @@ public class UserAppServiceImpl implements UserAppService {
private UserAppRepository userAppRepository;
@Autowired
private UserAppMapper userAppMapper;
@Autowired
private MemberService memberService;
@Override
......@@ -48,21 +46,22 @@ public class UserAppServiceImpl implements UserAppService {
@Override
@Transactional(readOnly = true)
public UserAppDTO findByUserName(String username) {
public UserAppDTO findByUsername(String username) {
UserApp userApp = this.userAppRepository.findByUsername(username).orElseGet(UserApp::new);
return this.userAppMapper.toDto(userApp);
}
@Override
@Transactional(readOnly = true)
public UserAppDTO findByUserNameAndPassword(String username, String password) {
public UserAppDTO findByUsernameAndPassword(String username, String password) {
UserApp userApp = this.userAppRepository.findByUsernameAndPassword(username, password).orElseGet(UserApp::new);
return this.userAppMapper.toDto(userApp);
}
@Override
@Transactional(readOnly = true)
public UserAppDTO findByUserNameAndVerificationCode(String username, String VerificationCode) {
public UserAppDTO findByUsernameAndVerificationCode(String username, String VerificationCode) {
// TDDO 需要接入短信网关
UserApp userApp = null;
return this.userAppMapper.toDto(userApp);
}
......
package com.topdraw.business.process.rest;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.topdraw.annotation.AnonymousAccess;
import com.topdraw.annotation.Log;
import com.topdraw.business.module.common.validated.CreateGroup;
import com.topdraw.business.module.common.validated.UpdateGroup;
import com.topdraw.business.module.member.domain.Member;
import com.topdraw.business.module.member.service.MemberService;
import com.topdraw.business.module.member.service.dto.MemberDTO;
import com.topdraw.business.module.user.app.domain.UserApp;
......@@ -35,13 +33,11 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotNull;
import java.io.IOException;
import java.net.URLDecoder;
import java.sql.Timestamp;
......@@ -77,18 +73,18 @@ public class UserOperationController {
@ApiOperation("app登录")
@AnonymousAccess
public ResultInfo appLogin(@Validated @RequestBody UserApp resources) {
log.info("新增App账号 ==>> param ==>> [addLogin#{}]", resources);
log.info("app登录 ==>> param ==>> [appLogin#{}]", resources);
this.userOperationService.appLogin(resources);
UserTvDTO userTvDTO = this.userOperationService.appLogin(resources);
return ResultInfo.success();
}
@Log
@PostMapping(value = "/appLogin")
@ApiOperation("app登录")
@PostMapping(value = "/updateUserApp")
@ApiOperation("修改app账号信息")
@AnonymousAccess
public ResultInfo updateAppCount(@Validated @RequestBody UserApp resources) {
log.info("新增App账号 ==>> param ==>> [addLogin#{}]", resources);
public ResultInfo updateUserApp(@Validated @RequestBody UserApp resources) {
log.info("修改app账号信息 ==>> param ==>> [updateUserApp#{}]", resources);
this.userOperationService.appLogin(resources);
return ResultInfo.success();
......
......@@ -172,6 +172,6 @@ public interface UserOperationService {
*
* @param resources
*/
void appLogin(UserApp resources);
UserTvDTO appLogin(UserApp resources);
}
......
......@@ -12,6 +12,8 @@ import com.topdraw.business.module.member.service.MemberService;
import com.topdraw.business.module.member.service.dto.MemberDTO;
import com.topdraw.business.module.member.service.dto.MemberSimpleDTO;
import com.topdraw.business.module.user.app.domain.UserApp;
import com.topdraw.business.module.user.app.service.UserAppService;
import com.topdraw.business.module.user.app.service.dto.UserAppDTO;
import com.topdraw.business.module.user.iptv.domain.UserConstant;
import com.topdraw.business.module.user.iptv.domain.UserTv;
import com.topdraw.business.module.user.iptv.domain.UserTvBuilder;
......@@ -77,6 +79,8 @@ public class UserOperationServiceImpl implements UserOperationService {
@Autowired
private MemberService memberService;
@Autowired
private UserAppService userAppService;
@Autowired
private UserWeixinService userWeixinService;
@Autowired
private UserWeixinRepository userWeixinRepository;
......@@ -111,9 +115,15 @@ public class UserOperationServiceImpl implements UserOperationService {
@Override
@Transactional(rollbackFor = Exception.class)
public void appLogin(UserApp resources) {
public UserTvDTO appLogin(UserApp resources) {
String username = resources.getUsername();
UserAppDTO userAppDTO = this.userAppService.findByUsername(username);
if (Objects.nonNull(userAppDTO)) {
}
return null;
}
/**
......